@font-face {
  font-family: "Horizon";
  src: url("/fonts/horizon/horizon.woff2") format("woff2"),
       url("/fonts/horizon/horizon.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-024F;
}

@font-face {
  font-family: "Horizon Outlined";
  src: url("/fonts/horizon/horizon-outlined.woff2") format("woff2"),
       url("/fonts/horizon/horizon-outlined.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-024F;
}

:root {
  color-scheme: dark;
  --bg: #09060f;
  --bg-raised: #0e0a14;
  --panel: #15101d;
  --panel-2: #1c1526;
  --panel-3: #251b31;
  --panel-hover: #2c203a;
  --input: #0d0913;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f8f4fb;
  --text-soft: #d1c9d7;
  --muted: #a096a8;
  --muted-2: #6f6578;
  --accent: #ff2d7a;
  --accent-strong: #ff5a9b;
  --accent-soft: rgba(255, 45, 122, .13);
  --green: #66e49b;
  --green-soft: rgba(102, 228, 155, .13);
  --blue: #35d9ff;
  --blue-soft: rgba(53, 217, 255, .13);
  --purple: #a96bff;
  --purple-soft: rgba(169, 107, 255, .13);
  --orange: #ee9b55;
  --orange-soft: rgba(238, 155, 85, .13);
  --danger: #f06f76;
  --danger-soft: rgba(240, 111, 118, .12);
  --font: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "Horizon", "Segoe UI Variable Display", Inter, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --topbar: 76px;
  --statusbar: 32px;
  --rail: 132px;
  --sidebar: 304px;
  --properties: 364px;
  --bottom: 204px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .48);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: fixed; width: 0; height: 0; pointer-events: none; }
.sr-only, .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c333e; border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
::selection { background: rgba(255, 45, 122, .28); }

.studio-app { width: 100vw; height: 100dvh; display: grid; grid-template-rows: var(--topbar) minmax(0, 1fr) var(--statusbar); background: var(--bg); }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 0 18px 0 14px; background: rgba(14, 9, 20, .96); border-bottom: 1px solid var(--line); z-index: 30; }
.brand { height: 40px; display: flex; align-items: center; gap: 9px; text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #ff5a9b, #ff2d7a); color: #fff; box-shadow: inset 0 1px rgba(255, 255, 255, .38), 0 8px 25px rgba(255, 45, 122, .24); }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2.1; }
.brand-copy { display: grid; line-height: 1; letter-spacing: .08em; }
.brand-copy strong { font-family: var(--display); font-size: 12px; font-weight: 800; }
.brand-copy small { margin-top: 4px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .22em; }
.hub-return { height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hub-return:hover { border-color: var(--line-strong); background: var(--panel-2); color: var(--text-soft); }
.hub-return svg { width: 14px; height: 14px; }
.project-context { height: 36px; min-width: 0; max-width: 380px; display: flex; align-items: center; gap: 4px; padding: 0 7px; border-left: 1px solid var(--line); }
.context-select { min-width: 80px; max-width: 170px; height: 30px; padding: 0 26px 0 7px; border: 0; outline: 0; background: transparent; color: var(--text-soft); font-size: 12px; font-weight: 650; text-overflow: ellipsis; }
.world-select { max-width: 130px; color: var(--muted); }
.context-select:hover, .context-select:focus { color: var(--text); background: var(--panel-2); border-radius: 7px; }
.context-separator { color: var(--muted-2); }
.environment-badge { flex: 0 0 auto; margin-left: 4px; padding: 3px 6px; border: 1px solid rgba(92, 203, 132, .32); border-radius: 5px; background: var(--green-soft); color: var(--green); font: 750 8px/1 var(--font); letter-spacing: .08em; }
.command-trigger { min-width: 210px; max-width: 360px; height: 34px; flex: 1 1 320px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); color: var(--muted); text-align: left; }
.command-trigger:hover { border-color: var(--line-strong); background: var(--panel); color: var(--text-soft); }
.command-trigger svg { width: 15px; height: 15px; }
.command-trigger span { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
kbd { min-width: 34px; padding: 3px 5px; border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 5px; background: var(--panel-2); color: var(--muted); font: 600 9px/1.2 var(--font); text-align: center; }
.top-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.button, .icon-btn, .ai-button, .avatar, .runtime-pill { border: 1px solid var(--line); background: var(--panel-2); }
.button { height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; border-radius: 8px; color: var(--text-soft); font-size: 11px; font-weight: 700; white-space: nowrap; transition: .14s ease; }
.button svg { width: 15px; height: 15px; }
.button:hover { border-color: var(--line-strong); background: var(--panel-hover); color: var(--text); transform: translateY(-1px); }
.button.ghost { background: transparent; }
.button.primary { border-color: rgba(255, 45, 122, .55); background: var(--accent); color: #fff; box-shadow: 0 9px 24px rgba(255,45,122,.14); }
.button.primary:hover { background: var(--accent-strong); }
.button.publish { border-color: rgba(92, 203, 132, .42); background: var(--green); color: #07130b; }
.button.publish:hover { background: #70dc96; }
.button.danger { border-color: rgba(240, 111, 118, .35); background: var(--danger-soft); color: var(--danger); }
.button.small { height: 29px; padding: 0 8px; font-size: 10px; }
.icon-btn, .ai-button, .avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border-radius: 8px; color: var(--muted); }
.icon-btn:hover, .ai-button:hover { border-color: var(--line-strong); background: var(--panel-hover); color: var(--text); }
.icon-btn.subtle { border-color: transparent; background: transparent; }
.ai-button { border-color: var(--line-strong); background: var(--panel-2); color: var(--text-soft); }
.avatar { border-color: rgba(255, 45, 122, .35); border-radius: 50%; background: linear-gradient(145deg, #3b2030, #1b1018); color: var(--accent); font-size: 9px; font-weight: 800; }
.runtime-pill { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.runtime-pill:hover { border-color: var(--line-strong); color: var(--text-soft); }
.runtime-dot, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(238, 155, 85, .1); }
.runtime-pill.online .runtime-dot, .statusbar .online .status-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(92, 203, 132, .1); }
.runtime-pill.offline .runtime-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(240, 111, 118, .1); }

/* Main layout */
.studio-layout { min-width: 0; min-height: 0; display: grid; grid-template-columns: var(--rail) var(--sidebar) minmax(420px, 1fr) var(--properties); }
.studio-app.sidebar-hidden .studio-layout { grid-template-columns: var(--rail) 0 minmax(420px, 1fr) var(--properties); }
.studio-app.sidebar-hidden .sidebar { display: none; }
.studio-app.properties-hidden .studio-layout { grid-template-columns: var(--rail) var(--sidebar) minmax(420px, 1fr) 0; }
.studio-app.properties-hidden .properties { display: none; }
.studio-app.sidebar-hidden.properties-hidden .studio-layout { grid-template-columns: var(--rail) 0 minmax(420px, 1fr) 0; }
.activity-rail { min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 12px 8px 8px; background: #0b0710; border-right: 1px solid var(--line); }
.activity-btn { width: 100%; height: 44px; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 8px; position: relative; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-2); text-align: left; }
.activity-btn::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 99px; background: transparent; }
.activity-btn:hover { background: var(--panel-2); color: var(--text-soft); }
.activity-btn.active { background: var(--accent-soft); color: var(--accent); }
.activity-btn.active::before { background: var(--accent); }
.activity-btn span { display: block; overflow: hidden; color: inherit; font-size: 10px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.activity-btn svg { width: 19px; height: 19px; }
.rail-spacer { flex: 1; }

/* The project home behaves like a regular website dashboard. Editor chrome is
   restored automatically as soon as an object or a specialist builder opens. */
.studio-app.dashboard-mode .studio-layout { grid-template-columns: var(--rail) var(--sidebar) minmax(420px, 1fr) 0; }
.studio-app.dashboard-mode .properties { display: none; }
.studio-app.dashboard-mode .workbench,
.studio-app.dashboard-mode .workbench.bottom-collapsed { grid-template-rows: 0 52px minmax(0, 1fr) 34px; }
.studio-app.dashboard-mode .tab-strip { display: flex; visibility: hidden; overflow: hidden; border: 0; }
.studio-app.dashboard-mode .editor-header { padding-inline: 20px; background: var(--bg-raised); }
.studio-app.dashboard-mode .editor-canvas { padding: 28px clamp(20px, 3vw, 44px) 44px; }

.sidebar, .properties { min-width: 0; min-height: 0; display: grid; background: var(--panel); }
.sidebar { grid-template-rows: auto auto minmax(0, 1fr) auto; border-right: 1px solid var(--line); }
.panel-heading, .properties-heading { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--line); }
.eyebrow { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .17em; }
.panel-heading h1, .properties-heading h2 { margin: 0; font-family: var(--display); font-size: 15px; font-weight: 720; letter-spacing: -.01em; }
.sidebar-tools { display: grid; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.search-field { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--input); color: var(--muted); }
.search-field:focus-within { border-color: rgba(231, 196, 90, .45); box-shadow: 0 0 0 3px rgba(231, 196, 90, .06); }
.search-field svg { width: 14px; height: 14px; flex: 0 0 auto; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-soft); font-size: 11px; }
.search-field input::placeholder { color: var(--muted-2); }
.search-field kbd { min-width: 25px; border: 0; background: transparent; padding: 0; }
.create-button { height: 34px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(231, 196, 90, .26); border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; }
.create-button:hover { border-color: rgba(231, 196, 90, .48); background: rgba(231, 196, 90, .18); }
.create-button svg { width: 14px; height: 14px; }
.sidebar-content { min-height: 0; overflow: auto; padding: 8px 7px 16px; }
.sidebar-footer { padding: 8px; border-top: 1px solid var(--line); }
.sync-summary { width: 100%; min-height: 48px; display: grid; grid-template-columns: 31px minmax(0, 1fr) 16px; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); color: var(--text-soft); text-align: left; }
.sync-summary:hover { border-color: var(--line-strong); background: var(--panel-2); }
.sync-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: var(--green-soft); color: var(--green); }
.sync-icon svg { width: 15px; height: 15px; }
.sync-summary strong, .sync-summary small { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sync-summary strong { font-size: 10px; }
.sync-summary small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.sync-summary .chevron { width: 13px; height: 13px; color: var(--muted-2); }

/* Explorer */
.tree-root { display: grid; gap: 2px; }
.tree-section { margin-bottom: 5px; }
.tree-section-head, .tree-category, .tree-object { width: 100%; display: grid; align-items: center; border: 1px solid transparent; background: transparent; color: inherit; text-align: left; }
.tree-section-head { grid-template-columns: 15px minmax(0, 1fr) auto; gap: 5px; height: 30px; padding: 0 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tree-section-head:hover { color: var(--text-soft); }
.tree-section-head svg { width: 12px; height: 12px; transition: transform .15s; }
.tree-section.collapsed .tree-section-head svg { transform: rotate(-90deg); }
.tree-section.collapsed .tree-section-body { display: none; }
.tree-section-head .tree-total { color: var(--muted-2); font-size: 9px; }
.tree-category { grid-template-columns: 23px minmax(0, 1fr) auto; gap: 7px; min-height: 33px; padding: 3px 7px; border-radius: 7px; color: var(--text-soft); }
.tree-category:hover, .tree-category.active { background: var(--panel-2); }
.tree-category.active { border-color: rgba(231, 196, 90, .18); color: var(--accent); }
.tree-icon, .object-icon { display: grid; place-items: center; border-radius: 6px; background: var(--panel-3); color: var(--muted); font-size: 11px; font-weight: 800; }
.tree-icon { width: 22px; height: 22px; }
.tree-category strong { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; font-weight: 650; }
.tree-count { min-width: 18px; padding: 2px 4px; border-radius: 99px; background: rgba(255,255,255,.04); color: var(--muted-2); font-size: 8px; text-align: center; }
.tree-object { grid-template-columns: 3px 25px minmax(0, 1fr) auto; gap: 7px; min-height: 37px; margin: 1px 0; padding: 3px 6px 3px 11px; border-radius: 7px; }
.tree-object:hover { background: var(--panel-2); }
.tree-object.selected { border-color: rgba(231, 196, 90, .22); background: var(--accent-soft); }
.object-state { width: 3px; height: 18px; border-radius: 99px; background: transparent; }
.tree-object.selected .object-state { background: var(--accent); }
.object-icon { width: 25px; height: 25px; color: var(--blue); }
.object-icon[data-tone="green"] { color: var(--green); background: var(--green-soft); }
.object-icon[data-tone="purple"] { color: var(--purple); background: var(--purple-soft); }
.object-icon[data-tone="orange"] { color: var(--orange); background: var(--orange-soft); }
.object-icon[data-tone="gold"] { color: var(--accent); background: var(--accent-soft); }
.tree-object-copy { min-width: 0; }
.tree-object-copy strong, .tree-object-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tree-object-copy strong { color: var(--text-soft); font-size: 10.5px; font-weight: 650; }
.tree-object-copy small { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.tree-object-status { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.empty-sidebar { min-height: 210px; display: grid; align-content: center; justify-items: center; padding: 25px 15px; color: var(--muted); text-align: center; }
.empty-sidebar .empty-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--muted-2); }
.empty-sidebar strong { color: var(--text-soft); font-size: 11px; }
.empty-sidebar p { max-width: 210px; margin: 6px 0 12px; font-size: 9.5px; line-height: 1.55; }

/* Workbench */
.workbench { min-width: 0; min-height: 0; display: grid; grid-template-rows: 38px 42px minmax(0, 1fr) var(--bottom); background: var(--bg); }
.workbench.bottom-collapsed { grid-template-rows: 38px 42px minmax(0, 1fr) 34px; }
.tab-strip { min-width: 0; display: flex; align-items: stretch; overflow-x: auto; overflow-y: hidden; background: #0d1015; border-bottom: 1px solid var(--line); }
.workspace-tab { min-width: 120px; max-width: 210px; height: 38px; display: grid; grid-template-columns: 15px minmax(0, 1fr) 20px; align-items: center; gap: 7px; padding: 0 6px 0 10px; border: 0; border-right: 1px solid var(--line); border-bottom: 2px solid transparent; background: #0f1319; color: var(--muted); text-align: left; }
.workspace-tab:hover { background: var(--panel-2); color: var(--text-soft); }
.workspace-tab.active { border-bottom-color: var(--accent); background: var(--panel); color: var(--text); }
.workspace-tab svg { width: 13px; height: 13px; }
.workspace-tab > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; font-weight: 620; }
.tab-close { width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: transparent; font-size: 14px; }
.workspace-tab:hover .tab-close, .workspace-tab.active .tab-close { color: var(--muted); }
.tab-close:hover { background: var(--panel-hover); color: var(--text) !important; }
.tab-dirty::after { content: ""; width: 6px; height: 6px; justify-self: center; border-radius: 50%; background: var(--accent); }
.tab-dirty .tab-close { display: none; }
.editor-header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 11px 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9.5px; }
.breadcrumbs span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.breadcrumbs .current { color: var(--text-soft); font-weight: 650; }
.breadcrumb-sep { color: var(--muted-2); }
.editor-actions { display: flex; align-items: center; gap: 6px; }
.editor-viewport { min-width: 0; min-height: 0; overflow: auto; position: relative; background: radial-gradient(900px circle at 50% -20%, rgba(231,196,90,.045), transparent 48%), var(--bg); }
.editor-canvas { min-height: 100%; padding: 20px; }

/* Overview */
.overview { width: min(1180px, 100%); margin: 0 auto; display: grid; gap: 18px; }
.project-hero { min-height: 230px; display: grid; grid-template-columns:minmax(0, 1.45fr) minmax(280px, .55fr); overflow: hidden; position: relative; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(420px circle at 88% 18%,rgba(53,217,255,.12),transparent 56%),linear-gradient(135deg, rgba(255,45,122,.16), rgba(169,107,255,.055) 50%, var(--panel) 82%); box-shadow: 0 24px 65px rgba(0,0,0,.24); }
.project-hero::after { content: ""; position: absolute; width: 320px; height: 320px; right: -110px; top: -170px; border: 1px solid rgba(231,196,90,.12); border-radius: 42%; transform: rotate(20deg); box-shadow: inset 0 0 80px rgba(231,196,90,.045); }
.hero-copy { align-self: center; padding: 27px 30px; position: relative; z-index: 1; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.hero-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.hero-copy h2 { margin: 10px 0 8px; font-family: var(--display); font-size: clamp(22px, 2.4vw, 34px); line-height: 1.05; letter-spacing: -.035em; }
.hero-copy p { max-width: 650px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.hero-actions { display: flex; gap: 7px; margin-top: 18px; }
.builder-path { display: grid; grid-template-columns: minmax(210px,.7fr) minmax(0,2fr); align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.builder-path-title strong { display: block; color: var(--text-soft); font-size: 11px; }
.builder-path-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.builder-path-steps button { min-width: 0; min-height: 54px; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); color: var(--text-soft); text-align: left; }
.builder-path-steps button:hover { border-color: rgba(231,196,90,.28); background: var(--panel-2); }
.builder-path-steps i { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-style: normal; font-weight: 850; }
.builder-path-steps strong, .builder-path-steps small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.builder-path-steps strong { font-size: 9.5px; }
.builder-path-steps small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.hero-score { display: grid; place-items: center; position: relative; z-index: 1; border-left: 1px solid var(--line); background: rgba(8,10,13,.28); }
.score-ring { --score: 82; width: 112px; height: 112px; display: grid; place-items: center; position: relative; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--score) * 1%), rgba(255,255,255,.06) 0); }
.score-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--panel); }
.score-ring div { position: relative; display: grid; text-align: center; }
.score-ring strong { font-family: var(--display); font-size: 25px; }
.score-ring small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.score-caption { margin-top: 9px; color: var(--text-soft); font-size: 10px; font-weight: 650; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric-card { min-height: 84px; display: grid; grid-template-columns: 39px minmax(0, 1fr); align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.metric-card .metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-soft); color: var(--blue); }
.metric-card:nth-child(2) .metric-icon { background: var(--purple-soft); color: var(--purple); }
.metric-card:nth-child(3) .metric-icon { background: var(--green-soft); color: var(--green); }
.metric-card:nth-child(4) .metric-icon { background: var(--accent-soft); color: var(--accent); }
.metric-card strong, .metric-card small { display: block; }
.metric-card strong { font-family: var(--display); font-size: 20px; line-height: 1; }
.metric-card small { margin-top: 5px; color: var(--muted); font-size: 9.5px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 12px; }
.surface-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.surface-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.surface-head h3 { margin: 0; font-size: 12px; font-weight: 720; }
.surface-head small { color: var(--muted); font-size: 9.5px; }
.surface-body { padding: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-card { min-height: 106px; display: grid; align-content: space-between; gap: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); color: var(--text-soft); text-align: left; }
.quick-card:hover { border-color: rgba(231,196,90,.28); background: var(--panel-2); transform: translateY(-1px); }
.quick-card .quick-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { font-size: 11px; }
.quick-card small { margin-top: 4px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.health-list, .recent-list { display: grid; }
.health-row, .recent-row { min-height: 47px; display: grid; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.health-row:last-child, .recent-row:last-child { border-bottom: 0; }
.health-row { grid-template-columns: 9px minmax(0, 1fr) auto; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.health-dot.warn { background: var(--orange); }
.health-row strong, .health-row small { display: block; }
.health-row strong { color: var(--text-soft); font-size: 9.5px; }
.health-row small { margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.health-row > span:last-child { color: var(--muted); font-size: 8px; }
.recent-row { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 4px 0; cursor: pointer; }
.recent-row:hover strong { color: var(--accent); }
.recent-row .object-icon { width: 29px; height: 29px; }
.recent-row strong, .recent-row small { display: block; }
.recent-row strong { color: var(--text-soft); font-size: 9.5px; }
.recent-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.recent-row time { color: var(--muted-2); font-size: 8px; }

/* Object editors */
.object-editor { width: min(1120px, 100%); margin: 0 auto; display: grid; gap: 14px; }
.object-banner { min-height: 92px; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--accent-soft), transparent 36%), var(--panel); }
.object-banner .object-icon { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; }
.object-banner-copy { min-width: 0; flex: 1; }
.object-banner h2 { margin: 0; font-family: var(--display); font-size: 18px; letter-spacing: -.02em; }
.object-banner p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.object-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg-raised); color: var(--muted); font-size: 8px; font-weight: 700; }
.pill.live { border-color: rgba(92,203,132,.26); background: var(--green-soft); color: var(--green); }
.pill.warn { border-color: rgba(238,155,85,.28); background: var(--orange-soft); color: var(--orange); }
.editor-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 12px; }
.preview-stage { min-height: 330px; display: grid; place-items: center; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.018) 1px,transparent 1px), radial-gradient(500px circle at 50% 44%, rgba(105,167,255,.09), transparent 58%), var(--bg-raised); background-size: 32px 32px, 32px 32px, auto, auto; }
.stage-label { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.stage-controls { position: absolute; right: 10px; top: 10px; display: flex; gap: 5px; }
.stage-controls button { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--muted); }
.item-preview { display: grid; justify-items: center; gap: 18px; }
.item-model { width: 112px; height: 112px; display: grid; place-items: center; position: relative; border: 1px solid rgba(105,167,255,.24); border-radius: 26px; background: linear-gradient(145deg, rgba(105,167,255,.22), rgba(169,139,255,.08)); color: var(--blue); box-shadow: 0 24px 60px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.08); transform: rotate(-5deg); }
.item-model::before, .item-model::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.05); border-radius: 19px; }
.item-model::after { inset: 22px; border-radius: 13px; }
.item-model svg { width: 55px; height: 55px; stroke-width: 1.2; }
.item-card { min-width: 250px; max-width: 330px; padding: 12px 14px; border: 1px solid rgba(169,139,255,.28); border-radius: 8px; background: rgba(11,13,18,.94); box-shadow: 0 15px 50px rgba(0,0,0,.42); font-family: var(--mono); }
.item-card strong { color: #e0b8ff; font-size: 11px; }
.item-card p { margin: 7px 0; color: #a8abb4; font-size: 9px; line-height: 1.55; white-space: pre-line; }
.item-card small { color: #7f8490; font-size: 8px; }
.npc-preview { display: grid; justify-items: center; gap: 10px; }
.npc-avatar { width: 106px; height: 176px; position: relative; }
.npc-head { width: 62px; height: 62px; margin: 0 auto; border: 1px solid rgba(231,196,90,.35); border-radius: 14px; background: linear-gradient(145deg,#c99065,#704832); box-shadow: 0 10px 28px rgba(0,0,0,.3); }
.npc-body { width: 82px; height: 105px; margin: 4px auto 0; border: 1px solid rgba(105,167,255,.26); border-radius: 13px 13px 8px 8px; background: linear-gradient(160deg,#315d82,#1b3049); }
.npc-nameplate { padding: 5px 10px; border-radius: 5px; background: rgba(0,0,0,.55); color: var(--accent); font-size: 9px; font-weight: 700; }
.summary-list { display: grid; }
.summary-row { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); font-size: 9px; }
.summary-row strong { color: var(--text-soft); font-size: 9.5px; font-weight: 650; text-align: right; }
.section-tabs { display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.section-tabs button { min-height: 29px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.section-tabs button.active { background: var(--panel-3); color: var(--text); }
.item-section-tabs { position: sticky; top: 0; z-index: 4; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; box-shadow: 0 10px 30px rgba(0,0,0,.16); backdrop-filter: blur(16px); }
.item-section-tabs::-webkit-scrollbar { display: none; }
.item-section-tabs button { flex: 0 0 auto; transition: color .18s ease, background .18s ease, transform .18s ease; }
.item-section-tabs button:hover { color: var(--text); transform: translateY(-1px); }
.item-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
.item-metric { min-height: 92px; display: grid; align-content: space-between; gap: 5px; position: relative; overflow: hidden; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(145deg, rgba(255,255,255,.025), transparent), var(--panel); transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.item-metric::after { content: ""; width: 42px; height: 42px; position: absolute; right: -12px; top: -14px; border-radius: 50%; background: currentColor; filter: blur(22px); opacity: .24; }
.item-metric:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 15px 35px rgba(0,0,0,.18); }
.item-metric small { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.item-metric strong { color: var(--text); font-family: var(--display); font-size: 20px; letter-spacing: -.03em; }
.item-metric span { color: var(--muted); font-size: 8px; }
.item-metric[data-tone="red"] { color: var(--danger); }
.item-metric[data-tone="blue"] { color: var(--blue); }
.item-metric[data-tone="purple"] { color: var(--purple); }
.item-metric[data-tone="green"] { color: var(--green); }
.item-metric[data-tone="gold"] { color: var(--accent); }
.item-runtime-card { overflow: visible; }

/* GUI Builder */
.gui-layout { display: grid; grid-template-columns: minmax(430px, 1fr) 260px; gap: 12px; }
.inventory-wrap { min-height: 440px; display: grid; place-items: center; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: radial-gradient(550px circle at center, rgba(231,196,90,.055), transparent 65%), var(--bg-raised); }
.inventory-window { width: min(610px, 100%); padding: 15px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; background: #c7c7c7; color: #282828; box-shadow: inset 0 1px #fff, 0 22px 55px rgba(0,0,0,.42); }
.inventory-title { margin-bottom: 9px; font: 700 11px/1 var(--font); }
.inventory-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.inventory-slot { aspect-ratio: 1; min-width: 0; display: grid; place-items: center; position: relative; border: 2px solid; border-color: #777 #eee #eee #777; background: #9c9c9c; color: #333; font-size: 16px; }
.inventory-slot:hover { background: #adadad; }
.inventory-slot.selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.inventory-slot.filled { color: #342b18; background: #ad9f73; }
.inventory-slot .slot-count { position: absolute; right: 2px; bottom: 1px; color: #fff; font: 800 8px/1 var(--mono); text-shadow: 1px 1px #222; }
.palette-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.palette-item { min-height: 66px; display: grid; place-items: center; gap: 4px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); color: var(--muted); }
.palette-item:hover { border-color: var(--line-strong); background: var(--panel-2); color: var(--text-soft); }
.palette-item b { font-size: 8px; }

/* Game, quest and logic */
.game-flow { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.state-card { min-width: 150px; min-height: 112px; display: grid; align-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); }
.state-card.active { border-color: rgba(92,203,132,.35); background: var(--green-soft); }
.state-card .state-index { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--panel-3); color: var(--muted); font-size: 8px; font-weight: 800; }
.state-card strong { display: block; font-size: 9.5px; }
.state-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.flow-arrow { align-self: center; color: var(--muted-2); }
.flow-arrow svg { width: 14px; height: 14px; }
.arena-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.arena-card { min-height: 100px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); }
.arena-card strong { display: block; font-size: 10px; }
.arena-card p { margin: 7px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.5; }
.quest-timeline { display: grid; gap: 0; padding: 8px 4px; }
.quest-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; min-height: 82px; position: relative; }
.quest-step:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 31px; bottom: 0; width: 1px; background: var(--line-strong); }
.quest-step-index { width: 33px; height: 33px; display: grid; place-items: center; z-index: 1; border: 1px solid rgba(231,196,90,.26); border-radius: 50%; background: var(--panel-2); color: var(--accent); font-size: 9px; font-weight: 800; }
.quest-step-copy { padding: 4px 0 16px; }
.quest-step-copy strong { display: block; font-size: 10px; }
.quest-step-copy p { margin: 5px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.5; }
/* Worlds, assets and history */
.world-map { min-height: 390px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg, rgba(74,113,62,.26), rgba(40,72,92,.18)), repeating-linear-gradient(45deg, rgba(255,255,255,.018) 0 12px, transparent 12px 24px), var(--bg-raised); }
.map-region { position: absolute; display: grid; place-items: center; border: 1px dashed rgba(231,196,90,.7); border-radius: 10px; background: rgba(231,196,90,.08); color: var(--accent); font-size: 8px; font-weight: 750; }
.map-marker { position: absolute; width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid var(--panel); border-radius: 50%; background: var(--green); color: #07130b; font-size: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.asset-browser { width: min(1180px,100%); margin: 0 auto; display: grid; gap: 13px; }
.asset-toolbar { display: flex; align-items: center; gap: 7px; }
.asset-toolbar .search-field { flex: 1; max-width: 390px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 9px; }
.asset-card { min-width: 0; display: grid; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; text-align: left; }
.asset-card:hover { border-color: rgba(231,196,90,.28); background: var(--panel-2); transform: translateY(-1px); }
.asset-thumb { aspect-ratio: 1.45; display: grid; place-items: center; border-radius: 8px; background: radial-gradient(circle, rgba(105,167,255,.13), transparent 68%), var(--bg-raised); color: var(--blue); }
.asset-thumb svg { width: 38px; height: 38px; stroke-width: 1.2; }
.asset-card strong, .asset-card small { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.asset-card strong { font-size: 9.5px; }
.asset-card small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.external-asset-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.external-asset { align-content: start; }
.external-asset .button { width: 100%; margin-top: auto; }
.section-title-row { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title-row h3 { margin: 0; font-size: 13px; }
.pill.danger { border-color: rgba(240,111,118,.26); background: var(--danger-soft); color: var(--danger); }
.capability-row { display: flex; gap: 5px; flex-wrap: wrap; }
.history-list { display: grid; }
.history-entry { display: grid; grid-template-columns: 31px minmax(0,1fr) auto; gap: 9px; min-height: 58px; align-items: center; border-bottom: 1px solid var(--line); }
.history-entry:last-child { border-bottom: 0; }
.history-entry .history-icon { width: 30px; height: 30px; display: grid; place-items:center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); }
.history-entry strong, .history-entry small { display:block; }
.history-entry strong { font-size: 9.5px; }
.history-entry small { margin-top: 4px; color:var(--muted); font-size:8px; }
.history-entry time { color:var(--muted-2); font-size:8px; }
.script-editor { width: min(1050px,100%); min-height: 590px; margin:0 auto; display:grid; grid-template-rows:auto minmax(420px,1fr); border:1px solid var(--line); border-radius:var(--radius-lg); overflow:hidden; background:var(--panel); }
.script-meta { min-height:50px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 13px; border-bottom:1px solid var(--line); }
.script-meta strong { font:650 10px var(--mono); }
.script-area { width:100%; min-height:420px; padding:18px 20px; resize:none; border:0; outline:0; background:#0a0d12; color:#c8d2df; font:12px/1.65 var(--mono); tab-size:4; }

/* Properties */
.properties { grid-template-rows: auto minmax(0, 1fr); border-left: 1px solid var(--line); }
.properties-content { min-height: 0; overflow: auto; padding: 10px; }
.properties-empty { min-height: 300px; display: grid; align-content: center; justify-items: center; padding: 25px; color: var(--muted); text-align: center; }
.properties-empty .empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); color: var(--muted-2); }
.properties-empty strong { color: var(--text-soft); font-size: 11px; }
.properties-empty p { max-width: 250px; margin: 7px 0 0; font-size: 9px; line-height: 1.55; }
.property-section { margin-bottom: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); overflow: hidden; }
.property-filter { min-height: 42px; display: grid; grid-template-columns: 18px minmax(0,1fr) auto; align-items: center; gap: 7px; position: sticky; top: -10px; z-index: 8; margin: -10px -10px 0; padding: 7px 10px; border-bottom: 1px solid var(--line); background: rgba(12,15,20,.92); backdrop-filter: blur(18px); }
.property-filter span { display: grid; color: var(--muted); }
.property-filter svg { width: 14px; height: 14px; }
.property-filter input { width: 100%; min-width: 0; height: 29px; padding: 0 8px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 9px; }
.property-filter input::placeholder { color: var(--muted-2); }
.property-filter kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); color: var(--muted-2); font: 7px var(--mono); }
.property-filter-status { margin: 8px 1px 9px; color: var(--muted-2); font-size: 7.5px; line-height: 1.4; }
.property-filter-field[hidden], .property-section[hidden] { display: none; }
.property-collapsible { transition: border-color .22s ease, box-shadow .22s ease, background .22s ease; }
.property-collapsible > summary { cursor: pointer; list-style: none; user-select: none; }
.property-collapsible > summary::-webkit-details-marker { display: none; }
.property-collapsible > summary > span { min-width: 0; display: flex; align-items: center; gap: 7px; }
.property-collapsible > summary b { min-width: 22px; color: var(--muted-2); font: 700 7px var(--mono); letter-spacing: .06em; }
.property-collapsible > summary small { max-width: 48%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.property-collapsible > summary i { color: var(--muted-2); font: 12px/1 var(--font); transition: transform .18s ease, color .18s ease; }
.property-collapsible[open] > summary { border-bottom: 1px solid var(--line); }
.property-collapsible[open] > summary i { color: var(--accent); transform: rotate(180deg); }
.property-section-highlight { border-color: rgba(231,196,90,.5); box-shadow: 0 0 0 3px rgba(231,196,90,.07), 0 16px 40px rgba(0,0,0,.2); }
.property-section-head { min-height: 37px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-bottom: 1px solid var(--line); color: var(--text-soft); font-size: 9px; font-weight: 750; }
.property-section-head small { color: var(--muted-2); font-size: 8px; font-weight: 600; }
.property-section-body { display: grid; gap: 10px; padding: 10px; }
.field { display: grid; gap: 5px; }
.field > span, .field-label { color: var(--muted); font-size: 8.5px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: var(--input); color: var(--text-soft); font-size: 10px; }
.field input, .field select { height: 34px; padding: 0 9px; }
.field textarea { min-height: 68px; padding: 8px 9px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(231,196,90,.45); box-shadow: 0 0 0 3px rgba(231,196,90,.06); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-hint { color: var(--muted-2); font-size: 7.5px; line-height: 1.4; }
.toggle-field { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toggle-copy strong, .toggle-copy small { display: block; }
.toggle-copy strong { color: var(--text-soft); font-size: 9px; }
.toggle-copy small { margin-top: 3px; color: var(--muted); font-size: 7.5px; }
.switch { width: 35px; height: 20px; flex: 0 0 auto; position: relative; border: 0; border-radius: 99px; background: var(--panel-3); }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #8b919b; transition: transform .15s, background .15s; }
.switch.on { background: rgba(92,203,132,.32); }
.switch.on::after { transform: translateX(15px); background: var(--green); }
.property-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.danger-zone { border-color: rgba(240,111,118,.22); }
.danger-zone .property-section-head { color: var(--danger); }

/* Bottom panel */
.bottom-panel { min-height: 0; display: grid; grid-template-rows: 34px minmax(0, 1fr); border-top: 1px solid var(--line); background: #0c0f14; }
.bottom-tabs { display: flex; align-items: center; gap: 2px; padding: 0 5px; border-bottom: 1px solid var(--line); }
.bottom-tab { height: 33px; padding: 0 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 9px; font-weight: 650; }
.bottom-tab:hover { color: var(--text-soft); }
.bottom-tab.active { border-bottom-color: var(--accent); color: var(--text); }
.count-badge { min-width: 16px; display: inline-grid; place-items: center; margin-left: 4px; padding: 1px 4px; border-radius: 99px; background: var(--danger-soft); color: var(--danger); font-size: 8px; }
.bottom-toggle { width: 30px; height: 28px; margin-left: auto; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.bottom-toggle:hover { background: var(--panel-2); color: var(--text); }
.bottom-content { min-height: 0; overflow: auto; padding: 5px 9px; font-family: var(--mono); }
.bottom-collapsed .bottom-content { display: none; }
.bottom-collapsed .bottom-tabs { border-bottom: 0; }
.bottom-collapsed .bottom-toggle { transform: rotate(180deg); }
.problem-row, .output-row { min-height: 27px; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 0 5px; border-radius: 5px; color: var(--muted); font-size: 8.5px; }
.problem-row:hover, .output-row:hover { background: var(--panel-2); color: var(--text-soft); }
.problem-row.error { color: #dca1a5; }
.problem-row.warning { color: #d6ae88; }
.problem-row svg, .output-row svg { width: 12px; height: 12px; }
.problem-row .problem-source, .output-row time { color: var(--muted-2); }
.bottom-empty { height: 100%; display: grid; place-items: center; color: var(--muted-2); font: 8.5px var(--mono); }

/* Statusbar */
.statusbar { min-width: 0; display: flex; align-items: center; gap: 13px; padding: 0 9px; border-top: 1px solid var(--line); background: #0b0e12; color: var(--muted); font-size: 8px; }
.statusbar button { height: 23px; display: flex; align-items: center; gap: 6px; padding: 0 3px; border: 0; background: transparent; color: inherit; font-size: inherit; }
.statusbar button:hover { color: var(--text-soft); }
.statusbar svg { width: 11px; height: 11px; }
.statusbar .status-dot { width: 6px; height: 6px; }
.status-spacer { flex: 1; }

/* Modals, AI, context menu, toasts */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 7vh 20px 30px; overflow: auto; background: rgba(4,6,9,.74); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .14s, visibility .14s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { width: min(720px, 100%); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--panel); box-shadow: var(--shadow); transform: translateY(-10px) scale(.985); transition: transform .16s; }
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal-header { min-height: 84px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 19px 15px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-family: var(--display); font-size: 19px; letter-spacing: -.025em; }
.modal-header p { margin: 7px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.modal-body { padding: 16px 19px; }
.modal-footer { min-height: 60px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 11px 19px; border-top: 1px solid var(--line); background: var(--bg-raised); }
.modal-search { max-width: 100%; margin-bottom: 12px; }
.type-grid { max-height: 410px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; overflow: auto; padding-right: 3px; }
.type-card { min-height: 92px; display: grid; align-content: space-between; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); color: var(--text-soft); text-align: left; }
.type-card:hover { border-color: var(--line-strong); background: var(--panel-2); }
.type-card.selected { border-color: rgba(231,196,90,.5); background: var(--accent-soft); }
.type-card .object-icon { width: 31px; height: 31px; }
.type-card strong, .type-card small { display: block; }
.type-card strong { font-size: 9.5px; }
.type-card small { margin-top: 4px; color: var(--muted); font-size: 7.5px; line-height: 1.4; }
.create-fields { display: none; grid-template-columns: 1fr 1.4fr; gap: 9px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.create-fields.visible { display: grid; }
.command-modal { width: min(680px, calc(100vw - 30px)); }
#commandModal { padding-top: 10vh; align-items: start; }
.command-search-wrap { height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.command-search-wrap > svg { width: 19px; height: 19px; color: var(--accent); }
.command-search-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.command-results { max-height: 430px; overflow: auto; padding: 7px; }
.command-group-label { padding: 8px 8px 5px; color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.command-item { width: 100%; min-height: 46px; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-soft); text-align: left; }
.command-item:hover, .command-item.active { border-color: var(--line); background: var(--panel-2); }
.command-item strong, .command-item small { display: block; }
.command-item strong { font-size: 10px; }
.command-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.command-item .object-icon { width: 29px; height: 29px; }
.command-item kbd { min-width: 24px; }
.command-help { min-height: 32px; display: flex; align-items: center; gap: 16px; padding: 0 12px; border-top: 1px solid var(--line); background: var(--bg-raised); color: var(--muted-2); font-size: 8px; }
.publish-modal { width: min(610px,100%); }
.publish-summary { display: grid; gap: 8px; }
.publish-step { min-height: 51px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); }
.publish-step-icon { width: 29px; height: 29px; display: grid; place-items:center; border-radius:7px; background:var(--panel-3); color:var(--muted); }
.publish-step.ready .publish-step-icon { background:var(--green-soft); color:var(--green); }
.publish-step strong, .publish-step small { display:block; }
.publish-step strong { font-size:9.5px; }
.publish-step small { margin-top:3px; color:var(--muted); font-size:8px; }
.publish-step > span:last-child { color:var(--muted); font-size:8px; }
.live-warning { margin-top:10px; padding:10px; border:1px solid rgba(238,155,85,.25); border-radius:8px; background:var(--orange-soft); color:#d9b18f; font-size:8.5px; line-height:1.55; }
.ai-drawer { position: fixed; z-index: 110; right: 0; top: var(--topbar); bottom: var(--statusbar); width: min(390px, 100vw); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto auto; border-left: 1px solid var(--line-strong); background: var(--panel); box-shadow: -20px 0 60px rgba(0,0,0,.35); transform: translateX(102%); transition: transform .18s ease; }
.ai-drawer.open { transform: translateX(0); }
.ai-header { min-height: 64px; display: grid; grid-template-columns: 38px minmax(0,1fr) 34px; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ai-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.ai-header strong, .ai-header small { display: block; }
.ai-header strong { font-size: 11px; }
.ai-header small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.ai-context { padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg-raised); color: var(--muted); font-size: 8px; }
.ai-conversation { min-height: 0; overflow: auto; padding: 13px; }
.ai-message { max-width: 90%; margin-bottom: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.ai-message.user { margin-left: auto; border-color: rgba(231,196,90,.22); background: var(--accent-soft); }
.ai-message strong { font-size: 9.5px; }
.ai-message p { margin: 5px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.55; white-space: pre-line; }
.ai-suggestions { display: flex; gap: 5px; overflow-x: auto; padding: 8px 11px 0; }
.ai-suggestions button { min-height: 26px; flex: 0 0 auto; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--panel-2); color: var(--text-soft); font-size: 8px; }
.ai-compose { display: grid; grid-template-columns: minmax(0,1fr) 34px; align-items: end; gap: 7px; padding: 10px 11px 12px; }
.ai-compose textarea { min-height: 58px; max-height: 140px; padding: 9px 10px; resize: none; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--input); color: var(--text-soft); font-size: 9.5px; line-height: 1.45; }
.ai-compose textarea:focus { border-color: rgba(231,196,90,.45); }
.ai-send { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--accent); color: #17130a; font-weight: 900; }
.field-hint.field-error { color: var(--danger); }
.context-menu { position: fixed; z-index: 150; min-width: 180px; display: none; padding: 5px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-2); box-shadow: var(--shadow); }
.context-menu.open { display: grid; }
.context-menu button { min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-soft); font-size: 9px; text-align: left; }
.context-menu button:hover { background: var(--panel-hover); }
.context-menu button.danger { color: var(--danger); }
.context-menu hr { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
.toast-stack { position: fixed; z-index: 200; right: 14px; bottom: 38px; width: min(340px, calc(100vw - 28px)); display: grid; gap: 7px; pointer-events: none; }
.toast { min-height: 52px; display: grid; grid-template-columns: 27px minmax(0,1fr); align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(21,26,34,.97); box-shadow: 0 12px 35px rgba(0,0,0,.34); animation: toast-in .18s ease; }
.toast-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: var(--green-soft); color: var(--green); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast strong, .toast small { display: block; }
.toast strong { font-size: 9.5px; }
.toast small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.loading-shell { min-height: 440px; display: grid; place-items: center; color: var(--muted); }
.loading-ring { width: 34px; height: 34px; margin: 0 auto 10px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive layout */
@media (max-width: 1420px) {
  :root { --sidebar: 268px; --properties: 318px; }
  .button.ghost span, .runtime-pill span:last-child { display: none; }
  .button.ghost { width: 34px; padding: 0; }
  .runtime-pill { width: 34px; padding: 0; justify-content: center; }
}
@media (max-width: 1180px) {
  .item-metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .studio-layout { grid-template-columns: var(--rail) var(--sidebar) minmax(0, 1fr); }
  .studio-app.properties-hidden .studio-layout { grid-template-columns: var(--rail) var(--sidebar) minmax(0, 1fr); }
  .studio-app.sidebar-hidden .studio-layout,
  .studio-app.sidebar-hidden.properties-hidden .studio-layout { grid-template-columns: var(--rail) 0 minmax(0, 1fr); }
  .properties { position: fixed; z-index: 55; top: var(--topbar); right: 0; bottom: var(--statusbar); width: min(360px, calc(100vw - var(--rail))); display: grid; border-left: 1px solid var(--line-strong); box-shadow: -18px 0 50px rgba(0,0,0,.42); }
  .studio-app.properties-hidden .properties { display: none; }
  .overview-grid, .editor-columns { grid-template-columns: 1fr; }
  .project-hero { grid-template-columns: 1fr; }
  .hero-score { display: none; }
}
@media (max-width: 1100px) {
  :root { --rail: 52px; }
  .activity-btn { grid-template-columns: 1fr; place-items: center; padding: 0; }
  .activity-btn span { display: none; }
  .project-context { display: none; }
  .builder-path { grid-template-columns: 1fr; }
  .builder-path-steps, .metric-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  :root { --rail: 52px; }
  .studio-layout { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .studio-app.dashboard-mode .studio-layout { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .studio-app.properties-hidden .studio-layout,
  .studio-app.sidebar-hidden .studio-layout,
  .studio-app.sidebar-hidden.properties-hidden .studio-layout { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 54; top: var(--topbar); left: var(--rail); bottom: var(--statusbar); width: min(292px, calc(100vw - var(--rail))); display: grid; border-right: 1px solid var(--line-strong); box-shadow: 18px 0 50px rgba(0,0,0,.42); }
  .studio-app.sidebar-hidden .sidebar { display: none; }
  .project-context { display: none; }
  .hub-return { display: none; }
  .command-trigger { min-width: 120px; }
  .command-trigger span { display: none; }
  .command-trigger { flex: 1; max-width: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .gui-layout { grid-template-columns: 1fr; }
  .builder-path { grid-template-columns: 1fr; }
  .builder-path-steps { grid-template-columns: 1fr 1fr; }
  .activity-btn { grid-template-columns: 1fr; place-items: center; padding: 0; }
  .activity-btn span { display: none; }
}
@media (max-width: 640px) {
  .item-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  :root { --rail: 44px; --bottom: 150px; }
  .brand-copy, .top-actions .icon-btn, .top-actions .runtime-pill, .button.publish span { display: none; }
  .topbar { gap: 7px; padding-right: 7px; }
  .brand-mark { width: 32px; height: 32px; }
  .button.publish { width: 34px; padding: 0; }
  .studio-layout { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .editor-canvas { padding: 12px; }
  .metric-grid, .quick-grid, .arena-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .create-fields { grid-template-columns: 1fr; }
  .object-banner { align-items: flex-start; flex-wrap: wrap; }
  .object-badges { width: 100%; }
  .inventory-wrap { padding: 10px; }
  .bottom-tab { padding: 0 6px; font-size: 8px; }
  .builder-path-steps { grid-template-columns: 1fr; }
}

/* Readable Studio scale. Horizon is the display/brand face; Segoe UI keeps
   Cyrillic controls compact and legible because Horizon is a Latin font. */
.brand-copy strong,
.panel-heading h1,
.properties-heading h2,
.hero-copy h2,
.object-banner h2,
.modal-header h2,
.metric-card strong,
.score-ring strong { font-family: var(--display); }

.brand-copy strong { font-size: 15px !important; }
.brand-copy small,
.eyebrow,
.hero-kicker,
.command-group-label,
.stage-label { font-size: 11px !important; }

.button,
.button.small,
.hub-return,
.runtime-pill,
.command-trigger span,
.context-select,
.search-field input,
.create-button,
.activity-btn span,
.workspace-tab > span,
.section-tabs button,
.bottom-tab,
.context-menu button,
.ai-suggestions button { font-size: 13px !important; }

.tree-section-head,
.tree-section-head .tree-total,
.tree-category strong,
.tree-object-copy strong,
.empty-sidebar strong,
.surface-head h3,
.quick-card strong,
.object-banner p,
.pill,
.item-card strong,
.npc-nameplate,
.summary-row span,
.summary-row strong,
.palette-item b,
.state-card strong,
.arena-card strong,
.quest-step-copy strong,
.map-region,
.map-marker,
.asset-card strong,
.section-title-row h3,
.history-entry strong,
.properties-empty strong,
.property-section-head,
.field > span,
.field-label,
.field input,
.field select,
.field textarea,
.toggle-copy strong,
.problem-row,
.output-row,
.statusbar,
.type-card strong,
.command-item strong,
.publish-step strong,
.live-warning,
.ai-header strong,
.ai-context,
.ai-message strong,
.ai-compose textarea,
.toast strong { font-size: 13px !important; }

.brand-copy small,
.sync-summary small,
.tree-count,
.tree-object-copy small,
.empty-sidebar p,
.breadcrumbs,
.builder-path-steps strong,
.builder-path-steps small,
.score-ring small,
.score-caption,
.metric-card small,
.surface-head small,
.quick-card small,
.health-row strong,
.health-row small,
.health-row > span:last-child,
.recent-row strong,
.recent-row small,
.recent-row time,
.item-card p,
.item-card small,
.state-card small,
.arena-card p,
.quest-step-copy p,
.asset-card small,
.history-entry small,
.history-entry time,
.properties-empty p,
.property-section-head small,
.field-hint,
.toggle-copy small,
.count-badge,
.modal-header p,
.type-card small,
.command-item small,
.command-help,
.publish-step small,
.publish-step > span:last-child,
.ai-header small,
.ai-message p,
.toast small { font-size: 12px !important; }

.button { height: 40px; padding-inline: 14px; }
.button.small { height: 35px; padding-inline: 11px; }
.hub-return,
.runtime-pill,
.icon-btn,
.avatar { height: 40px; }
.context-select { height: 36px; }
.create-button { height: 40px; }
.tree-section-head { height: 36px; }
.tree-category { min-height: 40px; }
.tree-object { min-height: 50px; }
.workspace-tab { min-height: 40px; }
.surface-head { min-height: 52px; }
.property-section-head { min-height: 46px; }
.field input,
.field select { min-height: 40px; }
.field textarea { min-height: 76px; padding: 10px 11px; line-height: 1.5; }
.bottom-tab { height: 40px; }
.problem-row,
.output-row { min-height: 34px; }
.statusbar button { min-height: 28px; }

@media (max-width: 1420px) {
  :root { --rail: 132px; --sidebar: 268px; --properties: 310px; }
  .hub-return { display: none; }
}

@media (max-width: 1100px) {
  :root { --rail: 58px; }
}

@media (max-width: 640px) {
  :root { --topbar: 68px; --statusbar: 32px; --rail: 50px; --bottom: 176px; }
}

/* Advanced world editors */
.menu-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.menu-tools > span { margin-inline: 3px 1px; color: var(--muted); font-size: 12px; font-weight: 750; }
.inventory-slot.background { background: linear-gradient(145deg, #4b5058, #343941); color: #b9c0ca; }
.inventory-slot.background:hover { filter: brightness(1.12); }

.command-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 16px; border: 1px solid rgba(105,167,255,.24); border-radius: 11px; background: var(--blue-soft); }
.command-preview code { color: var(--blue); font: 700 19px/1.2 var(--mono); }
.command-preview span { color: var(--text-soft); font-size: 13px; }
.command-action-list { display: grid; gap: 8px; }
.command-action-card { width: 100%; min-height: 58px; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); color: var(--text-soft); text-align: left; }
.command-action-card:hover, .command-action-card.selected { border-color: rgba(105,167,255,.46); background: var(--blue-soft); }
.command-action-card .state-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--panel-3); color: var(--blue); font-size: 11px; font-weight: 800; }
.command-action-card strong, .command-action-card small { display: block; }
.command-action-card strong { font-size: 13px; }
.command-action-card small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.hologram-stage, .hud-stage { min-height: 330px; }
.hologram-preview { display: grid; justify-items: center; gap: 12px; transform: perspective(700px) rotateX(2deg); }
.hologram-panel { min-width: 230px; padding: 13px 18px; border-radius: 4px; background: rgba(0,0,0,.55); box-shadow: 0 9px 35px rgba(0,0,0,.38); opacity: var(--hologram-opacity, 1); text-align: center; }
.hologram-panel span { display: block; color: #fff; font-size: 16px; line-height: 1.45; text-shadow: 0 2px 2px #000; }
.hologram-preview small { color: var(--muted); font-size: 12px; }

.scoreboard-preview { min-width: 255px; display: grid; gap: 5px; padding: 12px 14px; border-left: 4px solid var(--accent); border-radius: 4px; background: rgba(7,8,10,.88); box-shadow: 0 15px 45px rgba(0,0,0,.4); }
.scoreboard-preview strong { margin-bottom: 4px; color: var(--accent); font-size: 16px; text-align: center; }
.scoreboard-preview span { color: #f4f4f4; font-size: 13px; line-height: 1.35; }
.tab-preview { width: min(520px, 88%); display: grid; gap: 10px; padding: 16px 20px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: rgba(4,5,7,.88); box-shadow: 0 15px 45px rgba(0,0,0,.42); text-align: center; }
.tab-copy { color: var(--text-soft); font-size: 13px; white-space: pre-line; }
.tab-player { padding: 8px 12px; border-radius: 4px; background: rgba(255,255,255,.07); color: #fff; font-size: 14px; text-align: left; }
.bossbar-preview { width: min(520px, 88%); display: grid; justify-items: center; gap: 9px; }
.bossbar-preview strong { color: #fff; font-size: 15px; text-shadow: 0 2px 3px #000; }
.bossbar-preview > div { width: 100%; height: 12px; overflow: hidden; border: 2px solid #1b101f; background: #241329; }
.bossbar-preview > div > span { display: block; height: 100%; background: linear-gradient(90deg, #8a3fc1, #bd6ce8); }
.bossbar-preview small { color: var(--muted); font-size: 12px; }

.creative-launch { min-width: 0; display: grid; grid-template-columns: minmax(270px,.7fr) minmax(380px,1.3fr); overflow: hidden; border-color: rgba(231,196,90,.26); background: radial-gradient(circle at 12% 10%, rgba(231,196,90,.09), transparent 40%), var(--panel); }
.creative-launch-copy { align-content: center; display: grid; gap: 11px; padding: 30px; border-right: 1px solid var(--line); }
.creative-launch-copy h3 { margin: 0; font-family: var(--display); color: var(--text); font-size: clamp(25px,3vw,42px); font-weight: 500; letter-spacing: -.035em; }
.creative-launch-copy p { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.creative-launch-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.creative-open-button { width: max-content; min-height: 44px; margin-top: 7px; padding-inline: 16px; }
.creative-open-button span { margin-left: 8px; font-size: 17px; }
.creative-launch-file { overflow: hidden; color: var(--muted-2); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.creative-launch-preview { min-width: 0; min-height: 350px; display: grid; place-items: center; position: relative; padding: 26px; background: #0c0e13; }
.creative-launch-preview > .stage-label { z-index: 8; }
.creative-mini-canvas { width: min(720px,100%); aspect-ratio: 16 / 9; overflow: hidden; position: relative; container-type: size; border: 1px solid rgba(231,196,90,.28); border-radius: 14px; background: var(--creative-background, #151821); box-shadow: inset 0 0 70px rgba(0,0,0,.34), 0 24px 60px rgba(0,0,0,.4); isolation: isolate; }
.creative-background-image { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 0; }
.creative-paint-layer { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.creative-paint-mark { position: absolute; transform: translate(-50%,-50%); border-radius: 50%; background: var(--creative-mark,#e7c45a); opacity: var(--creative-mark-opacity,1); }
.creative-mini-grid,
.creative-grid { display: grid; grid-template-columns: repeat(var(--creative-columns), minmax(0,1fr)); grid-template-rows: repeat(var(--creative-rows), minmax(0,1fr)); position: absolute; inset: 0; z-index: 4; }
.creative-mini-cell { min-width: 0; min-height: 0; border-right: 1px solid rgba(255,255,255,.025); border-bottom: 1px solid rgba(255,255,255,.025); }
.creative-mini-cell.painted { background: var(--creative-cell, #e7c45a); opacity: var(--creative-cell-opacity, 1); }
.creative-cell { min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-right: 1px solid rgba(255,255,255,.075); border-bottom: 1px solid rgba(255,255,255,.075); border-radius: 0; background: transparent; cursor: crosshair; }
.creative-cell:hover { outline: 1px solid rgba(231,196,90,.72); outline-offset: -1px; background-color: rgba(231,196,90,.1); }
.creative-cell.painted { background: var(--creative-cell, #e7c45a); opacity: var(--creative-cell-opacity, 1); }
.creative-cell.shape-preview { background: var(--creative-preview, #e7c45a) !important; box-shadow: inset 0 0 0 2px rgba(255,255,255,.75); opacity: .78; }
.creative-live-preview { min-width: 0; display: grid; place-items: center; position: absolute; inset: 12%; z-index: 6; pointer-events: none; filter: drop-shadow(0 12px 25px rgba(0,0,0,.42)); }
.creative-live-preview .tab-preview, .creative-live-preview .bossbar-preview { width: min(520px, 92%); }
.creative-file { min-width: 0; display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.creative-file span, .creative-file small { color: var(--muted); font-size: 10px; }
.creative-file strong { overflow: hidden; color: var(--text-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.creative-file .button { margin-top: 7px; }
.creative-menu-preview { min-width: 240px; display: grid; justify-items: center; gap: 7px; padding: 18px 22px; border: 2px solid #272b32; border-radius: 8px; background: rgba(18,20,24,.9); box-shadow: inset 0 0 0 3px #090b0e, 0 18px 45px rgba(0,0,0,.4); }
.creative-menu-preview strong { color: #fff; font-size: 16px; }
.creative-menu-preview span { color: var(--accent); font-size: 13px; font-weight: 750; }
.creative-menu-preview small { color: var(--muted); font-size: 11px; text-align: center; }

body.creative-editor-open { overflow: hidden; }
.creative-editor-overlay { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: 72px minmax(0,1fr); overflow: hidden; background: #090b0f; color: var(--text); opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.995); transition: opacity .15s, visibility .15s, transform .15s; }
.creative-editor-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; transform: scale(1); }
.creative-overlay-header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--line-strong); background: rgba(16,18,24,.98); box-shadow: 0 8px 30px rgba(0,0,0,.28); }
.creative-overlay-title, .creative-overlay-actions { min-width: 0; display: flex; align-items: center; gap: 9px; }
.creative-overlay-title > span:first-of-type { min-width: 0; display: grid; gap: 2px; }
.creative-overlay-title small { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.creative-overlay-title strong { overflow: hidden; color: var(--text); font-family: var(--display); font-size: 19px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.creative-back { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--text); font-size: 21px; cursor: pointer; }
.creative-back:hover { border-color: var(--accent); }
.creative-overlay-actions { flex-wrap: wrap; justify-content: flex-end; }
.creative-overlay-body { min-width: 0; min-height: 0; display: grid; grid-template-columns: 102px minmax(0,1fr) 286px; overflow: hidden; }
.creative-tool-rail { min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 7px; padding: 13px 10px; overflow-y: auto; border-right: 1px solid var(--line); background: #101218; }
.creative-tool-rail > strong { padding: 3px 2px 7px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.creative-tool { min-height: 55px; display: grid; place-items: center; gap: 1px; padding: 5px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.creative-tool span { color: var(--text-soft); font-size: 21px; line-height: 1; }
.creative-tool small { font-size: 9px; }
.creative-tool:hover { border-color: var(--line-strong); background: var(--panel-2); color: var(--text); }
.creative-tool.active { border-color: rgba(231,196,90,.42); background: rgba(231,196,90,.12); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.creative-tool.active span { color: var(--accent); }
.creative-rail-color { min-height: 54px; display: grid; place-items: center; gap: 3px; margin-top: 5px; padding: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.creative-rail-color input { width: 34px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.creative-brush-size { display: grid; gap: 5px; padding: 8px 3px; color: var(--muted); font-size: 9px; }
.creative-brush-size span { display: flex; justify-content: space-between; }
.creative-brush-controls { display: grid !important; gap: 5px; }
.creative-brush-controls input[type="number"] { width: 100%; min-width: 0; height: 27px; padding: 0 5px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: var(--input); color: var(--text-soft); font: 10px var(--mono); }
.creative-brush-size input, .creative-zoom input, .creative-setting-group input[type="range"] { width: 100%; accent-color: var(--accent); }
.creative-stage { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px minmax(0,1fr) 50px; background: radial-gradient(circle at center, #1a1e29, #0b0d12 68%); }
.creative-stage-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid rgba(255,255,255,.045); color: var(--muted); font-size: 10px; }
.creative-stage-mode { display: flex; gap: 3px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--input); }
.creative-stage-mode button { min-height: 25px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 8px; cursor: pointer; }
.creative-stage-mode button.active { background: var(--accent); color: #17130a; font-weight: 850; }
.creative-stage-scroll { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 54px; scrollbar-color: #333846 #0b0d12; }
.creative-overlay-canvas { flex: none; overflow: hidden; position: relative; container-type: size; border: 1px solid rgba(231,196,90,.36); border-radius: 4px; background: var(--creative-background,#151821); box-shadow: 0 28px 90px rgba(0,0,0,.52), 0 0 0 9px rgba(255,255,255,.025); isolation: isolate; touch-action: none; user-select: none; }
.creative-zoom { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 14px; border-top: 1px solid rgba(255,255,255,.055); background: rgba(13,15,20,.92); }
.creative-zoom button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--text); font-size: 17px; cursor: pointer; }
.creative-zoom input { width: min(260px,32vw); }
.creative-zoom strong { width: 44px; color: var(--text-soft); font-size: 10px; }
.creative-zoom small { color: var(--muted-2); font-size: 9px; }
.creative-inspector { min-width: 0; min-height: 0; align-content: start; display: grid; gap: 15px; padding: 18px 15px; overflow-y: auto; border-left: 1px solid var(--line); background: #101218; }
.creative-inspector h3 { margin: 4px 0 0; font-family: var(--display); font-size: 23px; font-weight: 500; }
.creative-setting-group { display: grid; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.creative-setting-group > span { color: var(--text-soft); font-size: 11px; font-weight: 800; }
.creative-setting-group > small { color: var(--muted-2); font-size: 9px; line-height: 1.45; }
.creative-setting-group code { color: var(--accent); }
.creative-setting-group label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.creative-setting-group label b { color: var(--text-soft); font-weight: 700; }
.creative-setting-group input[type="color"] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--input); }
.creative-setting-group input[type="text"] { width: 100%; height: 35px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: var(--input); color: var(--text-soft); font-size: 10px; }
.creative-setting-group select { width: 100%; height: 35px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: var(--input); color: var(--text-soft); font-size: 10px; }
.creative-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); }
.creative-segmented button { min-height: 31px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.creative-segmented button.active { background: var(--accent); color: #17130a; font-weight: 850; }
.creative-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 9px; }
.creative-shortcuts strong { grid-column: 1 / -1; margin-bottom: 2px; color: var(--text-soft); font-size: 10px; }
.creative-shortcuts span { display: flex; align-items: center; gap: 5px; }
.creative-shortcuts kbd { min-width: 20px; padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg-raised); color: var(--accent); font: inherit; text-align: center; }

.import-file-summary { min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); color: var(--text-soft); font-size: 12px; line-height: 1.5; white-space: pre-line; }

@media (max-width: 900px) {
  .creative-launch { grid-template-columns: 1fr; }
  .creative-launch-copy { border-right: 0; border-bottom: 1px solid var(--line); }
  .creative-overlay-header { align-items: flex-start; }
  .creative-overlay-title .pill { display: none; }
  .creative-overlay-body { grid-template-columns: 88px minmax(0,1fr) 240px; }
  .creative-tool-rail { padding-inline: 7px; }
  .creative-stage-scroll { padding: 38px; }
}

@media (max-width: 700px) {
  .creative-overlay-body { grid-template-columns: 78px minmax(0,1fr); }
  .creative-inspector { display: none; }
}

@media (max-width: 560px) {
  .creative-launch-copy { padding: 22px; }
  .creative-launch-preview { min-height: 280px; padding: 18px; }
  .creative-editor-overlay { grid-template-rows: auto minmax(0,1fr); }
  .creative-overlay-header { display: grid; gap: 8px; }
  .creative-overlay-actions { display: grid; grid-template-columns: repeat(5,1fr); }
  .creative-overlay-actions .button { min-width: 0; padding-inline: 6px; font-size: 8px; }
  .creative-overlay-body { grid-template-columns: 70px minmax(0,1fr); }
  .creative-tool { min-height: 48px; }
  .creative-tool span { font-size: 18px; }
  .creative-tool small { font-size: 7px; }
  .creative-stage-scroll { padding: 25px; }
  .creative-zoom small { display: none; }
  .creative-live-preview { inset: 8%; transform: scale(.82); }
}

/* World-scoped emoji bitmap-font editor */
.emoji-browser { display: grid; gap: 14px; }
.emoji-flow { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.emoji-flow > div { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.emoji-flow i { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-style: normal; font-weight: 900; }
.emoji-flow strong,.emoji-flow small { display: block; }
.emoji-flow small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.emoji-editor-grid { display: grid; grid-template-columns: minmax(210px,.7fr) minmax(300px,1.3fr); gap: 18px; }
.emoji-upload-zone { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 20px; border: 1px dashed rgba(231,196,90,.35); border-radius: 14px; background: radial-gradient(circle at 50% 25%,rgba(231,196,90,.09),transparent 48%),var(--panel-2); text-align: center; }
.emoji-upload-zone p { max-width: 330px; margin: 0 0 4px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.emoji-upload-preview { width: 104px; height: 104px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #0b0e13; color: var(--accent); }
.emoji-upload-preview svg { width: 42px; height: 42px; }
.emoji-upload-preview img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.emoji-fields { display: grid; align-content: start; gap: 10px; }
.emoji-list { display: grid; gap: 8px; }
.emoji-card { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.emoji-card-preview { width: 62px; height: 62px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #090c11; color: var(--accent); font-size: 26px; }
.emoji-card-preview img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.emoji-card-copy { min-width: 0; }
.emoji-card-copy strong,.emoji-card-copy code,.emoji-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emoji-card-copy code { width: fit-content; max-width: 100%; margin: 6px 0; padding: 3px 6px; border-radius: 5px; background: rgba(231,196,90,.08); color: var(--accent); font-size: 10px; }
.emoji-card-copy small { color: var(--muted); font-size: 9px; }
.emoji-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.emoji-empty { min-height: 240px; }

@media (max-width: 900px) {
  .emoji-flow,.emoji-editor-grid { grid-template-columns: 1fr; }
  .emoji-card { grid-template-columns: 52px minmax(0,1fr); }
  .emoji-card-preview { width: 52px; height: 52px; }
  .emoji-card-actions { grid-column: 1/-1; justify-content: stretch; }
  .emoji-card-actions .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
