@charset "UTF-8";
/* ============================================================
   Unified Code Editors — shared SCSS for Frontend, Backend, SQL
   ------------------------------------------------------------
   Design language: matches /design-mockups/shared/styles.css
   (the same tokens drive site.css, the marketing pages, and the
   editor chrome). All rules are scoped under .unified-editor so
   nothing leaks. The host element gets a 56px header, fluid
   editor body, and a 32px status strip — same as the mockups.
   ============================================================ */
.unified-editor {
  /* ===== DESIGN TOKENS ===== */
  /* Surfaces (mirror site.css) */
  --bg-base: #0f1418;
  --bg-surface: #161c22;
  --bg-elevated: #1e252c;
  --bg-input: #1a2027;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-active: rgba(255, 255, 255, 0.08);
  /* Borders */
  --border-default: #2a323a;
  --border-subtle: #1f262d;
  --border-strong: #3a4249;
  --border-focus: #007bc0;
  /* Text */
  --text-primary: #e6edf3;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-disabled: #475569;
  /* Brand */
  --accent: #007bc0;
  --accent-hover: #0099e6;
  --accent-soft: rgba(0, 123, 192, 0.12);
  --accent-glow: rgba(0, 123, 192, 0.35);
  --accent-light: #4da5f5;
  /* Semantic */
  --success: #47cf73;
  --success-soft: rgba(71, 207, 115, 0.12);
  --success-hover: #5ad580;
  --danger: #f34141;
  --danger-soft: rgba(243, 65, 65, 0.12);
  --warning: #f7b90c;
  --warning-soft: rgba(247, 185, 12, 0.12);
  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  /* Typography */
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 24px var(--accent-glow);
  --duration-fast: 150ms;
  --duration: 220ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: var(--duration) var(--ease-out);
  /* Layout */
  --editor-header-height: 56px;
  --editor-status-height: 32px;
  --editor-pane-head-height: 36px;
  --unified-editor-height: 100vh;
  /* Host */
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Scoped reset */
  /* Scoped scrollbars (match site.css) */
  /* ===== PAGE WRAPPER ===== */
  /* ===== TOP HEADER (mockup .ed-header) ===== */
  /* Logo (mockup .nav-logo + .nav-logo-mark) */
  /* Project title input (mockup .ed-title) */
  /* Context selects (mockup .ctx-select) — used by .mode-select / .language-select / .db-select */
  /* ===== TOOLBAR BUTTONS (.tb / .btn) ===== */
  /* Icon-only toolbar buttons (no .lbl child) — keep them square */
  /* Run button — primary / success accent (mockup .btn-success) */
  /* Avatar stack (mockup .avatar / .avatar-stack) */
  /* ===== EDITOR CONTENT AREA ===== */
  /* Frontend wrapper */
  /* ===== PANEL HEADERS (mockup .ed-pane-head) ===== */
  /* The pane label wraps an <h2> for JS-binding (#htmlLabel/#cssLabel/#jsLabel).
     site.css gives every <h2> a clamp() font-size, so we must reset it here. */
  /* Pane head ordering — match mockup "[badge] [label] [...] [gear] [chevron]".
     The partial renders [gear, label, badge, chevron]; flex `order` re-sequences
     without touching the DOM (and without breaking JS hooks on these IDs). */
  /* Language pill (mockup .badge-html / .badge-css / .badge-js / etc.) */
  /* ===== EDITOR PANELS / CONTAINERS ===== */
  /* Frontend / MVC 3-pane row */
  /* Backend / SQL flex panels */
  /* Ace containers */
  /* Frontend window labels */
  /* ===== RESIZERS ===== */
  /* ===== OUTPUT / PREVIEW / RESULTS ===== */
  /* Preview iframe (frontend) */
  /* Console drawer */
  /* SQL results table (mockup table.results) */
  /* ===== STATUS BAR (mockup .ed-status) ===== */
  /* ===== SETTINGS DRAWER (right-anchored panel) + generic modal-overlay ===== */
  /* Backdrop layer inside the settings drawer overlay (clickable to close) */
  /* The drawer panel itself — right-anchored */
  /* Generic centered-modal box (used by Packages modal, etc.) — keeps old behavior */
  /* Drawer header (sticky inside the panel) */
  /* Legacy inline <h2> inside drawer (when present without drawer-header) */
  /* Settings drawer close — sits inside the sticky <h2> header */
  /* Modal tabs */
  /* Modal body */
  /* Form controls (mockup .input/.select/.textarea) */
  /* Radio group (mockup) */
  /* Toggle switch (mockup .toggle-switch) */
  /* CDNjs search */
  /* External resources rows */
  /* Mini button + library chips (mockup .lib-chip) */
  /* Modal footer */
  /* Packages list (mockup .pkg-row) */
  /* Templates */
  /* ===== LAYOUT SWITCHER DROPDOWN (mockup .layout-options) ===== */
  /* ===== EDITOR DROPDOWN MENU (mockup .ed-dropdown) ===== */
  /* ===== LAYOUT SWITCHING ===== */
  /* layout-top: editors row top, preview bottom — DEFAULT */
  /* layout-left: editors left, preview right */
  /* layout-right: preview left, editors right */
  /* layout-grid: 2x2 */
  /* Backend single/multi-panel layouts */
  /* SQL editor content layout modes */
  /* ===== SQL body row (schema sidebar + editor/results) ===== */
  /* ===== SQL schema sidebar ===== */
  /* ===== Loading overlay ===== */
  /* ===== Legacy/compat ===== */
  /* jqconsole */
  /* Ajax notification panel */
  /* ===== Mobile responsive ===== */
  /* Touch device */
}
.unified-editor *, .unified-editor *::before, .unified-editor *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.unified-editor ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.unified-editor ::-webkit-scrollbar-track {
  background: transparent;
}
.unified-editor ::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 5px;
}
.unified-editor ::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}
.unified-editor ::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}
.unified-editor.main-container, .unified-editor.page-wrap,
.unified-editor .main-container, .unified-editor .page-wrap {
  display: flex;
  height: var(--unified-editor-height);
}
.unified-editor .editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 0;
  background: var(--bg-base);
}
.unified-editor .editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0 var(--space-md);
  height: var(--editor-header-height);
  min-height: var(--editor-header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  position: relative;
  z-index: 11;
}
.unified-editor .header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
  flex-shrink: 1;
}
.unified-editor .header-center {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.unified-editor .header-right {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
  margin-left: auto;
}
.unified-editor .header-logo, .unified-editor a.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.unified-editor .header-logo .logo-icon, .unified-editor a.logo .logo-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: white;
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.unified-editor .header-logo .logo-icon.frontend, .unified-editor a.logo .logo-icon.frontend {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
}
.unified-editor .header-logo .logo-icon.backend, .unified-editor a.logo .logo-icon.backend {
  background: linear-gradient(135deg, #47cf73, #289d50);
}
.unified-editor .header-logo .logo-icon.sql, .unified-editor a.logo .logo-icon.sql {
  background: linear-gradient(135deg, #ffd76a, #ffae33);
  color: #2a1a00;
}
.unified-editor .header-logo .logo-text, .unified-editor a.logo .logo-text {
  color: var(--text-primary);
}
.unified-editor .header-logo .logo-text .hl, .unified-editor a.logo .logo-text .hl {
  color: var(--accent-light);
}
.unified-editor .header-logo:hover, .unified-editor a.logo:hover {
  color: var(--text-primary);
}
.unified-editor .project-title, .unified-editor .pen-title-text input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  width: 220px;
  min-width: 80px;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.unified-editor .project-title:hover, .unified-editor .pen-title-text input:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
}
.unified-editor .project-title:focus, .unified-editor .pen-title-text input:focus {
  outline: none;
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.unified-editor .project-title::placeholder, .unified-editor .pen-title-text input::placeholder {
  color: var(--text-muted);
}
.unified-editor .pen-title-text {
  display: flex;
  align-items: center;
}
.unified-editor .ctx-select, .unified-editor .mode-select, .unified-editor .language-select, .unified-editor .db-select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 6px 28px 6px 12px;
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.unified-editor .ctx-select:hover, .unified-editor .mode-select:hover, .unified-editor .language-select:hover, .unified-editor .db-select:hover {
  border-color: var(--border-strong);
}
.unified-editor .ctx-select:focus, .unified-editor .mode-select:focus, .unified-editor .language-select:focus, .unified-editor .db-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.unified-editor .ctx-select option, .unified-editor .mode-select option, .unified-editor .language-select option, .unified-editor .db-select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.unified-editor .ctx-select option:disabled, .unified-editor .mode-select option:disabled, .unified-editor .language-select option:disabled, .unified-editor .db-select option:disabled {
  color: var(--text-muted);
}
.unified-editor .ctx-btn {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: var(--text-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.unified-editor .ctx-btn:hover {
  background: var(--bg-active);
  border-color: var(--border-strong);
}
.unified-editor .tb, .unified-editor .btn, .unified-editor .btn-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  height: 32px;
  min-width: 32px;
  padding: 0 6px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}
.unified-editor .tb:hover,
.unified-editor .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.tb-run):hover,
.unified-editor .btn-default:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}
.unified-editor .tb.active, .unified-editor .btn.btn-active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-light);
}
.unified-editor .tb-labeled, .unified-editor .btn.tb-labeled {
  padding: 0 12px;
}
.unified-editor .tb:not(.tb-labeled):not(.tb-run),
.unified-editor .btn-icon, .unified-editor .btn.btn-icon {
  width: 32px;
  padding: 0;
}
.unified-editor .tb i, .unified-editor .btn i {
  font-size: var(--text-sm);
  margin: 0;
}
.unified-editor .tb-divider {
  width: 1px;
  height: 20px;
  background: var(--border-default);
  margin: 0 var(--space-xs);
  flex-shrink: 0;
}
.unified-editor .tb-run, .unified-editor .btn-primary, .unified-editor .btn.btn-primary {
  background: var(--success);
  color: #0f1418;
  border: 1px solid var(--success);
  padding: 0 14px;
  height: 32px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(71, 207, 115, 0.25);
}
.unified-editor .tb-run:hover, .unified-editor .btn-primary:hover, .unified-editor .btn.btn-primary:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
  color: #0f1418;
}
.unified-editor .tb-run:focus-visible, .unified-editor .btn-primary:focus-visible, .unified-editor .btn.btn-primary:focus-visible {
  outline: 2px solid var(--success);
  outline-offset: 2px;
}
.unified-editor .avatar-stack {
  display: inline-flex;
  margin: 0 var(--space-xs);
}
.unified-editor .avatar-stack .avatar,
.unified-editor .avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4da5f5, #c280bb);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 600;
  font-size: 11px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--bg-surface);
  margin-left: -8px;
}
.unified-editor .avatar-stack .avatar:first-child,
.unified-editor .avatar:first-child {
  margin-left: 0;
}
.unified-editor .editor-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.unified-editor .code-editor {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  position: relative;
}
.unified-editor .code-editor > section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.unified-editor .code-editor .editor-group {
  flex: 1;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.unified-editor .code-editor .window {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  width: 100%;
  background: var(--bg-base);
}
.unified-editor .code-editor pre#html, .unified-editor .code-editor pre#css, .unified-editor .code-editor pre#js, .unified-editor .code-editor pre#console {
  width: 100%;
  height: 100%;
  margin: 0;
  position: absolute;
  top: 0;
  left: 0;
}
.unified-editor .code-editor #html:hover + .windowLabel,
.unified-editor .code-editor #css:hover + .windowLabel,
.unified-editor .code-editor #js:hover + .windowLabel,
.unified-editor .code-editor #console:hover + .windowLabel,
.unified-editor .code-editor #iframe:hover + .windowLabel {
  opacity: 0;
}
.unified-editor .code-editor .preview-container {
  flex: 1 1 auto;
  width: 100%;
  position: relative;
  display: block !important;
  min-height: 0;
  overflow: hidden;
}
.unified-editor .editors-panel {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  overflow: hidden;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.unified-editor .panel-header, .unified-editor .editor-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 12px;
  height: var(--editor-pane-head-height);
  min-height: var(--editor-pane-head-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  z-index: 5;
}
.unified-editor .panel-gear, .unified-editor .panel-gear-btn, .unified-editor .editor-setting-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.unified-editor .panel-gear:hover, .unified-editor .panel-gear-btn:hover, .unified-editor .editor-setting-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.unified-editor .panel-label, .unified-editor .editor-title h2, .unified-editor .editor-title span {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  letter-spacing: 0;
  text-transform: none;
  padding: 0;
  line-height: 1.2;
}
.unified-editor .panel-label h2,
.unified-editor .editor-title h2 {
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: inherit;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}
.unified-editor .panel-header .lang-badge {
  order: 1;
}
.unified-editor .panel-header .panel-label {
  order: 2;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unified-editor .panel-header .panel-gear,
.unified-editor .panel-header .editor-setting-btn {
  order: 3;
  margin-left: auto;
}
.unified-editor .panel-header .panel-dropdown,
.unified-editor .panel-header .editor-dropdown-btn {
  order: 4;
  margin-left: 0;
}
.unified-editor .lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.unified-editor .lang-badge.html {
  background: rgba(227, 76, 38, 0.15);
  color: #ff7654;
}
.unified-editor .lang-badge.css {
  background: rgba(41, 101, 241, 0.15);
  color: #6a96ff;
}
.unified-editor .lang-badge.js {
  background: rgba(247, 223, 30, 0.15);
  color: #f0d030;
}
.unified-editor .lang-badge.csharp {
  background: rgba(155, 79, 150, 0.15);
  color: #c280bb;
}
.unified-editor .lang-badge.cshtml {
  background: rgba(155, 79, 150, 0.15);
  color: #ce93d8;
}
.unified-editor .lang-badge.sql {
  background: rgba(242, 145, 17, 0.15);
  color: #ffac3c;
}
.unified-editor .panel-dropdown, .unified-editor .editor-dropdown-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 10px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.unified-editor .panel-dropdown:hover, .unified-editor .editor-dropdown-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.unified-editor .toggle-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 10px;
  transition: all var(--transition);
  margin-left: var(--space-xs);
}
.unified-editor .toggle-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent-light);
}
.unified-editor .editors-row {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  flex-direction: row;
  overflow: hidden;
}
.unified-editor .editors-container {
  display: flex;
  flex-direction: row;
  flex: 0 0 35%;
  width: 100%;
  height: 35%;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.unified-editor .editors-container > .editor,
.unified-editor .editors-container > .editor-panel {
  flex: 1 1 0;
  width: auto;
  height: 100%;
  position: relative;
  background: var(--bg-base);
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  float: none;
}
.unified-editor .editors-container > .editor:last-child,
.unified-editor .editors-container > .editor-panel:last-child {
  border-right: none;
}
.unified-editor .editors-container > .editor.is-maximized {
  flex: 1 1 100% !important;
}
.unified-editor .editors-container > .uc-resizer.is-hidden-by-max {
  display: none !important;
}
.unified-editor .editors-container > .editor.is-minimized {
  flex: 0 0 32px !important;
  min-width: 0;
  min-height: 0;
  cursor: pointer;
}
.unified-editor .editors-container > .editor.is-minimized > .window {
  display: none !important;
}
.unified-editor .editors-container > .editor.is-minimized > .panel-header {
  cursor: pointer;
}
.unified-editor .editors-container > .editor.is-minimized > .panel-header:hover {
  background: var(--bg-elevated);
}
.unified-editor .editors-container.ui-resizable > .ui-resizable-e {
  display: none !important;
}
.unified-editor .editors-container.ui-resizable > .ui-resizable-s {
  clear: both;
  width: 100%;
  height: 6px;
  position: absolute;
  bottom: -6px;
  z-index: 2;
  cursor: row-resize;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.unified-editor .editors-container.ui-resizable > .ui-resizable-s:hover {
  background: var(--accent-soft);
}
.unified-editor .editors-panel.layout-grid .editor.is-maximized {
  grid-column: 1/-1;
  grid-row: 1/-1;
}
.unified-editor .editors-panel.layout-top .editors-container > .editor.is-minimized {
  flex: 0 0 36px !important;
  width: 36px;
}
.unified-editor .editors-panel.layout-top .editors-container > .editor.is-minimized > .panel-header {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  height: 100%;
  width: 36px;
  padding: 10px 6px;
  justify-content: flex-start;
  gap: 6px;
}
.unified-editor .editors-panel.layout-top .editors-container > .editor.is-minimized > .panel-header .lang-badge {
  margin-left: 0;
}
.unified-editor .editors-panel.layout-top .editors-container > .editor.is-minimized > .panel-header .panel-gear, .unified-editor .editors-panel.layout-top .editors-container > .editor.is-minimized > .panel-header .panel-dropdown {
  writing-mode: horizontal-tb;
  padding: 4px;
}
.unified-editor .editors-panel.layout-left .editors-container > .editor.is-minimized,
.unified-editor .editors-panel.layout-right .editors-container > .editor.is-minimized {
  flex: 0 0 32px !important;
  height: 32px;
}
.unified-editor .editor-panel, .unified-editor .code-panel, .unified-editor .sql-editor-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  min-width: 0;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.unified-editor .editor-panel:last-child {
  border-right: none;
}
.unified-editor .editor-panel.collapsed, .unified-editor .editor-panel[style*="flex: 0"] {
  flex: 0 0 40px !important;
  min-width: 40px;
}
.unified-editor .editor-panel.collapsed .ace-editor {
  display: none;
}
.unified-editor .editor-panel.collapsed .panel-header,
.unified-editor .editor-panel.collapsed .editor-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  height: 100%;
  padding: 12px 8px;
  justify-content: flex-start;
}
.unified-editor .editor-panel.collapsed .toggle-btn {
  writing-mode: horizontal-tb;
  margin-top: 10px;
}
.unified-editor .ace-editor,
.unified-editor #editor-sql, .unified-editor #editor-main, .unified-editor #editor-controller, .unified-editor #editor-view, .unified-editor #editor-model {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin: 0;
  position: relative;
}
.unified-editor .windowLabel {
  position: absolute;
  top: 6px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  z-index: 30;
  transition: opacity var(--transition);
  pointer-events: none;
  opacity: 0.85;
  border: 1px solid var(--border-default);
}
.unified-editor .uc-resizer {
  flex: 0 0 6px;
  background: var(--bg-surface);
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.unified-editor .uc-resizer::after {
  content: "";
  background: var(--text-muted);
  opacity: 0.4;
  border-radius: 2px;
  transition: all var(--transition);
}
.unified-editor .uc-resizer:hover {
  background: var(--accent-soft);
}
.unified-editor .uc-resizer:hover::after {
  background: var(--accent-light);
  opacity: 1;
}
.unified-editor .uc-resizer-col {
  width: 6px;
  height: 100%;
  cursor: col-resize;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}
.unified-editor .uc-resizer-col::after {
  width: 3px;
  height: 40px;
}
.unified-editor .uc-resizer-row {
  width: 100%;
  height: 6px;
  cursor: row-resize;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.unified-editor .uc-resizer-row::after {
  width: 40px;
  height: 3px;
}
.unified-editor .resizer-h, .unified-editor .resizer, .unified-editor #resizer, .unified-editor #resizer-mvc, .unified-editor #h-resizer {
  height: 6px;
  background: var(--bg-surface);
  cursor: row-resize;
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--transition);
}
.unified-editor .resizer-h:hover, .unified-editor .resizer:hover, .unified-editor #resizer:hover, .unified-editor #resizer-mvc:hover, .unified-editor #h-resizer:hover {
  background: var(--accent-soft);
}
.unified-editor .resizer-h::after, .unified-editor .resizer::after {
  content: "";
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: var(--text-muted);
  opacity: 0.5;
  transition: all var(--transition);
}
.unified-editor .resizer-h:hover::after, .unified-editor .resizer:hover::after {
  background: var(--accent-light);
  opacity: 1;
}
.unified-editor .resizer-v, .unified-editor .panel-resizer, .unified-editor .editor-resizer, .unified-editor .ui-resizable-e {
  width: 6px;
  background: var(--bg-surface);
  cursor: col-resize;
  flex-shrink: 0;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background var(--transition);
}
.unified-editor .resizer-v:hover, .unified-editor .panel-resizer:hover, .unified-editor .editor-resizer:hover, .unified-editor .ui-resizable-e:hover {
  background: var(--accent-soft);
}
.unified-editor .resizer-v::after, .unified-editor .panel-resizer::after, .unified-editor .editor-resizer::after {
  content: "";
  width: 3px;
  height: 40px;
  border-radius: 2px;
  background: var(--text-muted);
  opacity: 0.5;
  transition: all var(--transition);
}
.unified-editor .resizer-v:hover::after, .unified-editor .panel-resizer:hover::after {
  background: var(--accent-light);
  opacity: 1;
}
.unified-editor .editor-resizer-console {
  width: 100%;
  height: 6px;
  cursor: row-resize;
  background: var(--bg-surface);
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.unified-editor .editor-resizer-console:hover {
  background: var(--accent-soft);
}
.unified-editor .output-panel, .unified-editor .preview-container, .unified-editor .results-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  flex-shrink: 1;
  position: relative;
  overflow: hidden;
}
.unified-editor .output-header, .unified-editor .results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0 12px;
  height: var(--editor-pane-head-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.unified-editor .output-title, .unified-editor .results-header .title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}
.unified-editor .output-title i, .unified-editor .results-header .title i {
  font-size: 11px;
  color: var(--text-muted);
}
.unified-editor .execution-time {
  color: var(--success);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
}
.unified-editor .output-action {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.unified-editor .output-action:hover {
  color: var(--text-primary);
  background: var(--bg-active);
  border-color: var(--border-strong);
}
.unified-editor .output-content {
  flex: 1;
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--bg-base);
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}
.unified-editor .output-content.error {
  color: var(--danger);
}
.unified-editor .output-content.success {
  color: var(--success);
}
.unified-editor .output-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.unified-editor .preview, .unified-editor .preview.grid-col {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
}
.unified-editor #iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.unified-editor .loading-screen {
  position: absolute;
  inset: 0;
  background: var(--bg-base);
  display: none;
}
.unified-editor .loading-screen.show {
  display: block;
}
.unified-editor #iframeClose {
  display: none;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: absolute;
  width: 32px;
  height: 32px;
  line-height: 28px;
  font-size: 18px;
  top: var(--space-sm);
  right: var(--space-sm);
  text-align: center;
  z-index: 100;
}
.unified-editor .console-container {
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 200px;
  flex-shrink: 0;
}
.unified-editor .console-container.hide {
  display: none;
}
.unified-editor .console-container.show {
  display: flex;
}
.unified-editor .console-container .editor-title button {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-sm);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.unified-editor .console-container .editor-title button:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.unified-editor .console {
  width: 100%;
  flex: 1;
  overflow: auto;
  background: var(--bg-base);
  position: relative;
}
.unified-editor .results-table, .unified-editor .results-grid {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.unified-editor .results-table th, .unified-editor .results-grid th {
  background: var(--bg-elevated);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  cursor: pointer;
  transition: color var(--transition);
}
.unified-editor .results-table th:hover, .unified-editor .results-grid th:hover {
  color: var(--text-primary);
}
.unified-editor .results-table td, .unified-editor .results-grid td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.unified-editor .results-table td.num, .unified-editor .results-grid td.num {
  text-align: right;
  color: var(--accent-light);
}
.unified-editor .results-table tr:hover td, .unified-editor .results-grid tr:hover td {
  background: var(--bg-hover);
}
.unified-editor .results-grid td.null {
  color: var(--text-muted);
  font-style: italic;
}
.unified-editor .results-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow-x: auto;
}
.unified-editor .result-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}
.unified-editor .result-tab:hover {
  color: var(--text-primary);
}
.unified-editor .result-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.unified-editor .results-content {
  flex: 1;
  overflow: auto;
  background: var(--bg-base);
}
.unified-editor .results-messages {
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  white-space: pre-wrap;
}
.unified-editor .results-messages .success {
  color: var(--success);
}
.unified-editor .results-messages .error {
  color: var(--danger);
}
.unified-editor .no-results {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}
.unified-editor .no-results p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.unified-editor .status-bar, .unified-editor .demo-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0 var(--space-md);
  height: var(--editor-status-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: var(--font-sans);
}
.unified-editor .status-bar a, .unified-editor .demo-status a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition);
}
.unified-editor .status-bar a:hover, .unified-editor .demo-status a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.unified-editor .status-bar strong, .unified-editor .demo-status strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
}
.unified-editor .status-indicators {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.unified-editor .status-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.unified-editor .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}
.unified-editor .status-dot.green, .unified-editor .status-dot.connected, .unified-editor .status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.unified-editor .status-dot.yellow, .unified-editor .status-dot.syncing {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}
.unified-editor .status-dot.red, .unified-editor .status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}
.unified-editor .status-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}
.unified-editor .settings-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}
.unified-editor .settings-modal.show {
  display: block;
}
.unified-editor .settings-modal.hidden {
  display: none !important;
}
.unified-editor .modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.unified-editor .modal-overlay.hidden {
  display: none;
}
.unified-editor .modal-overlay.show {
  display: flex;
}
.unified-editor .settings-modal-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  cursor: pointer;
}
.unified-editor .drawer-right,
.unified-editor .settings-modal-content {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: clamp(360px, 28vw, 480px);
  max-width: 100vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2001;
  transform: translateX(100%);
  transition: transform var(--duration) ease;
}
.unified-editor .settings-modal.show .settings-modal-content,
.unified-editor .settings-modal.show .drawer-right {
  transform: translateX(0);
}
.unified-editor .modal-box, .unified-editor .modal {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 1;
}
.unified-editor .drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.unified-editor .drawer-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}
.unified-editor .drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-md);
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.unified-editor .drawer-close:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.unified-editor .drawer-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0;
}
.unified-editor .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}
.unified-editor .settings-modal-content > h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.unified-editor .modal-header h3 {
  font-size: var(--text-md);
  font-weight: 600;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
}
.unified-editor .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-md);
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 2;
}
.unified-editor .modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.unified-editor .settings-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-md);
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-left: auto;
}
.unified-editor .settings-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.unified-editor .settings-tabs, .unified-editor .modal-tabs {
  display: flex;
  gap: 0;
  padding: 0 var(--space-lg);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}
.unified-editor .settings-tab, .unified-editor .modal-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.unified-editor .settings-tab:hover, .unified-editor .modal-tab:hover {
  color: var(--text-primary);
}
.unified-editor .settings-tab.active, .unified-editor .modal-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.unified-editor .settings-page, .unified-editor .modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
  display: none;
}
.unified-editor .settings-page.active, .unified-editor .modal-body {
  display: block;
}
.unified-editor .settings-section, .unified-editor .settings-group {
  margin-bottom: var(--space-lg);
}
.unified-editor .settings-section:last-child, .unified-editor .settings-group:last-child {
  margin-bottom: 0;
}
.unified-editor .settings-section h4, .unified-editor .settings-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs);
}
.unified-editor .settings-section h4 label, .unified-editor .settings-label label {
  color: inherit;
  cursor: pointer;
}
.unified-editor .settings-hint {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin: 0 0 var(--space-sm);
  line-height: 1.5;
}
.unified-editor .settings-select, .unified-editor .settings-input, .unified-editor .settings-textarea,
.unified-editor .s-select, .unified-editor .s-input, .unified-editor .s-textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: var(--text-sm);
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.unified-editor .settings-select:hover, .unified-editor .settings-input:hover, .unified-editor .settings-textarea:hover,
.unified-editor .s-select:hover, .unified-editor .s-input:hover, .unified-editor .s-textarea:hover {
  border-color: var(--border-strong);
}
.unified-editor .settings-select:focus, .unified-editor .settings-input:focus, .unified-editor .settings-textarea:focus,
.unified-editor .s-select:focus, .unified-editor .s-input:focus, .unified-editor .s-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.unified-editor .settings-select::placeholder, .unified-editor .settings-input::placeholder, .unified-editor .settings-textarea::placeholder,
.unified-editor .s-select::placeholder, .unified-editor .s-input::placeholder, .unified-editor .s-textarea::placeholder {
  color: var(--text-muted);
}
.unified-editor .settings-select, .unified-editor .s-select {
  padding-right: 36px;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.unified-editor .settings-textarea, .unified-editor .s-textarea {
  resize: vertical;
  min-height: 90px;
  font-family: var(--font-mono);
  line-height: 1.5;
}
.unified-editor .settings-radio-group, .unified-editor .radio-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.unified-editor .settings-radio, .unified-editor .radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: var(--text-sm);
}
.unified-editor .settings-radio input[type=radio], .unified-editor .radio-label input[type=radio] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-default);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  margin: 0;
  flex-shrink: 0;
}
.unified-editor .settings-radio input[type=radio]:checked, .unified-editor .radio-label input[type=radio]:checked {
  border-color: var(--accent);
}
.unified-editor .settings-radio input[type=radio]:checked::after, .unified-editor .radio-label input[type=radio]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.unified-editor .settings-toggle, .unified-editor .toggle-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}
.unified-editor .settings-toggle input {
  display: none;
}
.unified-editor .toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  display: inline-block;
}
.unified-editor .toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.unified-editor .toggle-slider, .unified-editor .toggle-track {
  width: 40px;
  height: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition);
  display: inline-block;
  cursor: pointer;
  flex-shrink: 0;
}
.unified-editor .toggle-track {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  display: block;
}
.unified-editor .toggle-slider::after, .unified-editor .toggle-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all var(--transition);
}
.unified-editor .settings-toggle input:checked + .toggle-slider,
.unified-editor .toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.unified-editor .settings-toggle input:checked + .toggle-slider::after,
.unified-editor .toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: #fff;
}
.unified-editor .toggle-label, .unified-editor .toggle-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.unified-editor .cdnjs-search-container, .unified-editor .cdn-wrap {
  position: relative;
  margin-bottom: var(--space-sm);
}
.unified-editor .cdnjs-search-icon, .unified-editor .cdn-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--text-sm);
  z-index: 1;
  pointer-events: none;
}
.unified-editor .cdnjs-search-input, .unified-editor .cdn-wrap .s-input {
  padding-left: 36px;
}
.unified-editor .cdnjs-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 260px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow-md);
}
.unified-editor .cdnjs-results.show {
  display: block;
}
.unified-editor .cdnjs-result-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.unified-editor .cdnjs-result-item:hover {
  background: var(--bg-active);
}
.unified-editor .cdnjs-result-item:last-child {
  border-bottom: none;
}
.unified-editor .cdnjs-result-name {
  font-weight: 600;
  color: var(--text-primary);
}
.unified-editor .cdnjs-result-version {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 6px;
  font-family: var(--font-mono);
}
.unified-editor .cdnjs-result-desc {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 460px;
}
.unified-editor .cdnjs-result-info {
  flex: 1;
  min-width: 0;
}
.unified-editor .cdnjs-no-results, .unified-editor .cdnjs-loading {
  padding: var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.unified-editor .external-resources-list, .unified-editor .resource-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.unified-editor .external-resource-row, .unified-editor .resource-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.unified-editor .external-resource-row .settings-input, .unified-editor .external-resource-row .s-input, .unified-editor .resource-row .settings-input, .unified-editor .resource-row .s-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 8px 10px;
}
.unified-editor .external-resource-row.dragging {
  opacity: 0.5;
}
.unified-editor .resource-drag-handle, .unified-editor .resource-drag {
  color: var(--text-muted);
  cursor: grab;
  padding: 6px;
  font-size: var(--text-xs);
  transition: color var(--transition);
}
.unified-editor .resource-drag-handle:hover, .unified-editor .resource-drag:hover {
  color: var(--text-secondary);
}
.unified-editor .resource-remove-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.unified-editor .resource-remove-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}
.unified-editor .resource-remove {
  background: transparent;
  border: none;
  width: auto;
  height: auto;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.unified-editor .resource-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}
.unified-editor .settings-mini-btn, .unified-editor .mini-btn {
  background: transparent;
  border: 1px dashed var(--border-default);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  cursor: pointer;
  margin-top: var(--space-sm);
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.unified-editor .settings-mini-btn:hover, .unified-editor .mini-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  border-style: solid;
}
.unified-editor .settings-popular-resources {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}
.unified-editor .settings-popular-resources p {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  margin: 0 0 var(--space-sm);
}
.unified-editor .chip-row .label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  margin: 0 0 var(--space-sm);
}
.unified-editor .popular-lib-chips, .unified-editor .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.unified-editor .chip-row {
  margin-top: var(--space-sm);
}
.unified-editor .chip-row .label {
  width: 100%;
  margin-bottom: 1px;
}
.unified-editor .lib-chip, .unified-editor .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.unified-editor .lib-chip:hover, .unified-editor .chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-light);
}
.unified-editor .lib-chip.added, .unified-editor .chip.added {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
.unified-editor .settings-footer, .unified-editor .modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-default);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.unified-editor .modal-footer {
  justify-content: space-between;
}
.unified-editor .settings-btn {
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.unified-editor .settings-btn-secondary, .unified-editor .btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.unified-editor .settings-btn-secondary:hover, .unified-editor .btn-secondary:hover {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.unified-editor .settings-btn-primary, .unified-editor .btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.unified-editor .settings-btn-primary:hover, .unified-editor .btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.unified-editor .selected-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.unified-editor .packages-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.unified-editor .package-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}
.unified-editor .package-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-active);
}
.unified-editor .package-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.unified-editor .package-item input[type=checkbox] {
  margin-right: var(--space-sm);
  accent-color: var(--accent);
}
.unified-editor .package-info {
  flex: 1;
  min-width: 0;
}
.unified-editor .package-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.unified-editor .package-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}
.unified-editor .package-version {
  font-size: var(--text-xs);
  color: var(--success);
  font-family: var(--font-mono);
}
.unified-editor .package-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  transition: all var(--transition);
}
.unified-editor .package-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.unified-editor .package-search::placeholder {
  color: var(--text-muted);
}
.unified-editor .templates-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
}
.unified-editor .template-item {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}
.unified-editor .template-item:hover {
  border-color: var(--accent);
  background: var(--bg-active);
}
.unified-editor .template-item .name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  font-size: var(--text-sm);
}
.unified-editor .template-item .desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.unified-editor .layout-dropdown {
  display: none;
  position: absolute;
  z-index: 10000;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  top: calc(var(--editor-header-height) + 4px);
  right: var(--space-md);
  min-width: 220px;
}
.unified-editor .layout-dropdown.show {
  display: block;
}
.unified-editor .layout-dropdown h4 {
  margin: 0 0 var(--space-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.unified-editor .layout-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}
.unified-editor .layout-option {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.unified-editor .layout-option:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}
.unified-editor .layout-option.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-light);
}
.unified-editor .layout-option svg {
  display: block;
}
.unified-editor .editor-dropdown-menu {
  display: none;
  position: absolute;
  z-index: 10000;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  min-width: 210px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.unified-editor .editor-dropdown-menu.show {
  display: block;
}
.unified-editor .editor-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  color: var(--text-secondary);
}
.unified-editor .editor-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.unified-editor .editor-dropdown-item.css-only, .unified-editor .editor-dropdown-item.mvc-only {
  display: none;
}
.unified-editor .editor-dropdown-item kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-base);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}
.unified-editor .editor-dropdown-divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-xs) 8px;
}
.unified-editor .editors-panel.layout-top {
  flex-direction: column !important;
}
.unified-editor .editors-panel.layout-top .editors-container {
  flex-direction: row !important;
  flex: 0 0 35%;
  width: 100%;
  height: 35%;
}
.unified-editor .editors-panel.layout-top .editors-container .editor {
  flex: 1 1 0;
  width: auto;
  height: 100%;
  border-right: 1px solid var(--border-subtle);
  border-bottom: none;
}
.unified-editor .editors-panel.layout-top .editors-container .editor:last-child {
  border-right: none;
}
.unified-editor .editors-panel.layout-top .preview-container {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
}
.unified-editor .editors-panel.layout-left {
  flex-direction: row !important;
}
.unified-editor .editors-panel.layout-left .editors-container {
  flex-direction: column !important;
  flex: 0 0 40%;
  width: 40%;
  height: 100%;
}
.unified-editor .editors-panel.layout-left .editors-container .editor {
  flex: 1 1 0;
  width: 100%;
  height: auto;
  border-right: none;
  border-bottom: 1px solid var(--border-subtle);
}
.unified-editor .editors-panel.layout-left .editors-container .editor:last-child {
  border-bottom: none;
}
.unified-editor .editors-panel.layout-left .preview-container {
  flex: 1 1 auto;
  width: auto;
  height: 100%;
}
.unified-editor .editors-panel.layout-right {
  flex-direction: row-reverse !important;
}
.unified-editor .editors-panel.layout-right .editors-container {
  flex-direction: column !important;
  flex: 0 0 40%;
  width: 40%;
  height: 100%;
}
.unified-editor .editors-panel.layout-right .editors-container .editor {
  flex: 1 1 0;
  width: 100%;
  height: auto;
  border-right: none;
  border-bottom: 1px solid var(--border-subtle);
}
.unified-editor .editors-panel.layout-right .editors-container .editor:last-child {
  border-bottom: none;
}
.unified-editor .editors-panel.layout-right .preview-container {
  flex: 1 1 auto;
  width: auto;
  height: 100%;
}
.unified-editor .editors-panel.layout-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  flex-direction: initial !important;
  gap: 0;
}
.unified-editor .editors-panel.layout-grid .editors-container {
  display: contents !important;
}
.unified-editor .editors-panel.layout-grid .editor, .unified-editor .editors-panel.layout-grid .editor-panel {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-right: none;
  border-bottom: none;
}
.unified-editor .editors-panel.layout-grid .editor.html, .unified-editor .editors-panel.layout-grid #panel-controller, .unified-editor .editors-panel.layout-grid [data-panel=controller] {
  grid-column: 1;
  grid-row: 1;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.unified-editor .editors-panel.layout-grid .editor.css, .unified-editor .editors-panel.layout-grid #panel-view, .unified-editor .editors-panel.layout-grid [data-panel=view] {
  grid-column: 2;
  grid-row: 1;
  border-bottom: 1px solid var(--border-subtle);
}
.unified-editor .editors-panel.layout-grid .editor.js, .unified-editor .editors-panel.layout-grid #panel-model, .unified-editor .editors-panel.layout-grid [data-panel=model] {
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid var(--border-subtle);
}
.unified-editor .editors-panel.layout-grid .preview-container, .unified-editor .editors-panel.layout-grid .output-panel {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  height: 100%;
}
.unified-editor .single-panel, .unified-editor .multi-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.unified-editor .single-panel.layout-left, .unified-editor .multi-panel.layout-left {
  flex-direction: row;
}
.unified-editor .single-panel.layout-left .code-panel, .unified-editor .single-panel.layout-left .output-panel, .unified-editor .multi-panel.layout-left .code-panel, .unified-editor .multi-panel.layout-left .output-panel {
  width: 50% !important;
  height: 100% !important;
}
.unified-editor .single-panel.layout-right, .unified-editor .multi-panel.layout-right {
  flex-direction: row-reverse;
}
.unified-editor .single-panel.layout-right .code-panel, .unified-editor .single-panel.layout-right .output-panel, .unified-editor .multi-panel.layout-right .code-panel, .unified-editor .multi-panel.layout-right .output-panel {
  width: 50% !important;
  height: 100% !important;
}
.unified-editor .editor-content.layout-left {
  flex-direction: row;
}
.unified-editor .editor-content.layout-left .sql-editor-wrapper, .unified-editor .editor-content.layout-left .results-panel {
  width: 50% !important;
  height: 100% !important;
}
.unified-editor .editor-content.layout-right {
  flex-direction: row-reverse;
}
.unified-editor .editor-content.layout-right .sql-editor-wrapper, .unified-editor .editor-content.layout-right .results-panel {
  width: 50% !important;
  height: 100% !important;
}
.unified-editor .sql-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.unified-editor .sql-body > .editor-content {
  flex: 1;
  min-width: 0;
}
.unified-editor .sql-schema, .unified-editor .schema {
  flex-shrink: 0;
  width: clamp(220px, 18vw, 280px);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.unified-editor .schema-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}
.unified-editor .schema-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.unified-editor .schema-search-row {
  gap: 6px;
}
.unified-editor .schema-search-icon {
  color: var(--text-muted);
  font-size: 11px;
}
.unified-editor .schema-search {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  width: 100%;
  font-family: var(--font-sans);
}
.unified-editor .schema-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.unified-editor .schema-search::placeholder {
  color: var(--text-muted);
}
.unified-editor .schema-body {
  flex: 1;
  padding: 8px;
  overflow: auto;
  min-height: 0;
  font-size: var(--text-xs);
}
.unified-editor .schema-section + .schema-section {
  margin-top: var(--space-md);
}
.unified-editor .schema-section h6 {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 8px 6px 4px;
}
.unified-editor .tbl-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.unified-editor .tbl-row:hover {
  background: var(--bg-hover);
}
.unified-editor .tbl-row.expanded {
  color: var(--accent-light);
}
.unified-editor .tbl-row i.fa {
  font-size: 11px;
}
.unified-editor .tbl-row .tbl-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.unified-editor .tbl-row .count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}
.unified-editor .col-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 28px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
}
.unified-editor .col-row .colname {
  color: var(--text-primary);
}
.unified-editor .col-row .ctype {
  color: var(--text-muted);
  margin-left: auto;
}
.unified-editor .col-row.pk .colname::after {
  content: "🔑";
  margin-left: 4px;
  font-size: 9px;
}
.unified-editor .col-row.fk .colname::after {
  content: "🔗";
  margin-left: 4px;
  font-size: 9px;
}
.unified-editor .schema-key-icon {
  color: var(--warning);
}
.unified-editor .schema-bookmark-icon {
  color: var(--accent-light);
}
.unified-editor .loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 24, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.unified-editor .loading-overlay.hidden {
  display: none;
}
.unified-editor .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: unified-editor-spin 1s linear infinite;
}
.unified-editor .options-panels, .unified-editor .help-info, .unified-editor .settings-panel, .unified-editor input#projectTitle {
  display: none;
}
.unified-editor .options-panels.show, .unified-editor .settings-panel.show {
  display: block;
}
.unified-editor .hidden:not(.settings-modal):not(.modal-overlay) {
  display: none !important;
}
.unified-editor .hide:not(.console-container):not(.show) {
  display: none !important;
}
.unified-editor .show:not(.console-container):not(.settings-modal):not(.modal-overlay) {
  display: block;
}
.unified-editor .jqconsole {
  color: var(--text-primary);
  padding: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.6;
}
.unified-editor .jqconsole-prompt {
  color: var(--success);
}
.unified-editor .jqconsole-input {
  color: var(--warning);
}
.unified-editor .jqconsole-cursor {
  color: var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
}
.unified-editor .jqconsole-blurred .jqconsole-cursor {
  border: none;
}
.unified-editor .jqconsole-header {
  color: var(--text-muted);
  word-wrap: break-word;
}
.unified-editor .ajax-panel {
  overflow: hidden;
  max-width: 30%;
  min-height: 30px;
  margin: 0 auto;
  position: fixed;
  top: -100px;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: top var(--transition);
  z-index: 20000;
}
.unified-editor .ajax-panel.active {
  top: 0;
}
.unified-editor .ajax-panel p {
  padding: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
@media (max-width: 900px) {
  .unified-editor .editor-header {
    height: auto;
    min-height: 48px;
    padding: 6px var(--space-sm);
    gap: 6px;
    flex-wrap: wrap;
  }
  .unified-editor .header-left {
    flex: 1 1 auto;
    min-width: 0;
  }
  .unified-editor .header-logo {
    font-size: var(--text-sm);
  }
  .unified-editor .header-logo .logo-icon {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .unified-editor .project-title {
    width: 140px;
    font-size: var(--text-xs);
    padding: 5px 8px;
  }
  .unified-editor .header-center {
    gap: 4px;
    flex-wrap: wrap;
  }
  .unified-editor .ctx-select, .unified-editor .mode-select, .unified-editor .language-select, .unified-editor .db-select {
    font-size: 11px;
    padding: 5px 22px 5px 10px;
  }
  .unified-editor .ctx-btn {
    font-size: 11px;
    padding: 4px 10px;
  }
  .unified-editor .tb, .unified-editor .btn, .unified-editor .btn-default {
    height: 30px;
    min-width: 30px;
    font-size: var(--text-xs);
  }
  .unified-editor .tb-divider {
    margin: 0 2px;
  }
}
@media (max-width: 768px) {
  .unified-editor {
    /* SQL schema collapses below editor on narrow viewports */
  }
  .unified-editor .tb-labeled span.lbl, .unified-editor .btn .lbl {
    display: none;
  }
  .unified-editor .tb-labeled, .unified-editor .btn.tb-labeled {
    width: 30px;
    padding: 0;
  }
  .unified-editor .sql-body {
    flex-direction: column;
  }
  .unified-editor .sql-schema, .unified-editor .schema {
    width: 100%;
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .unified-editor .code-editor .editors-container {
    height: auto !important;
  }
  .unified-editor .code-editor .editor {
    float: none;
    width: 100% !important;
    height: 33.333% !important;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .unified-editor .code-editor .editors-container.ui-resizable > .ui-resizable-s,
  .unified-editor .code-editor .ui-resizable-e,
  .unified-editor .code-editor .editor-resizer {
    display: none !important;
  }
  .unified-editor .multi-panel .editors-row {
    flex-direction: column;
  }
  .unified-editor .multi-panel .editor-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    min-height: 150px;
  }
  .unified-editor .panel-resizer, .unified-editor .resizer-v {
    display: none;
  }
  .unified-editor .output-panel {
    min-height: 150px;
  }
  .unified-editor .panel-header, .unified-editor .editor-title {
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
  }
  .unified-editor .panel-label, .unified-editor .editor-title h2 {
    font-size: 11px;
  }
  .unified-editor .lang-badge {
    font-size: 9px;
    padding: 2px 6px;
  }
  .unified-editor .editor-setting-btn, .unified-editor .editor-dropdown-btn, .unified-editor .panel-gear, .unified-editor .panel-gear-btn, .unified-editor .panel-dropdown {
    padding: 3px 5px;
  }
  .unified-editor .status-bar, .unified-editor .demo-status {
    height: 28px;
    font-size: 11px;
    padding: 0 var(--space-sm);
  }
  .unified-editor .status-indicators {
    gap: var(--space-sm);
  }
  .unified-editor .modal-box, .unified-editor .modal {
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-lg);
    margin: var(--space-sm);
  }
  .unified-editor .settings-modal-content, .unified-editor .drawer-right {
    width: 100vw;
    max-width: 100vw;
  }
  .unified-editor .settings-modal-content > h2 {
    padding: var(--space-md);
    font-size: var(--text-md);
  }
  .unified-editor .drawer-header {
    padding: var(--space-sm) var(--space-md);
  }
  .unified-editor .settings-tabs, .unified-editor .modal-tabs {
    padding: 0 var(--space-md);
  }
  .unified-editor .settings-tab, .unified-editor .modal-tab {
    padding: 8px 12px;
    font-size: var(--text-xs);
  }
  .unified-editor .settings-page, .unified-editor .modal-body {
    padding: var(--space-md);
  }
  .unified-editor .settings-footer, .unified-editor .modal-footer {
    padding: var(--space-md);
  }
  .unified-editor .settings-label, .unified-editor .settings-section h4 {
    font-size: var(--text-xs);
  }
  .unified-editor .settings-hint {
    font-size: 11px;
  }
  .unified-editor .layout-dropdown {
    right: var(--space-sm);
    top: 50px;
    padding: var(--space-sm);
  }
  .unified-editor .editors-panel.layout-left, .unified-editor .editors-panel.layout-right {
    flex-direction: column !important;
  }
  .unified-editor .editors-panel.layout-left .editors-container,
  .unified-editor .editors-panel.layout-right .editors-container,
  .unified-editor .editors-panel.layout-left .preview-container,
  .unified-editor .editors-panel.layout-right .preview-container {
    float: none !important;
    width: 100% !important;
  }
  .unified-editor .editors-panel.layout-left .editors-container,
  .unified-editor .editors-panel.layout-right .editors-container {
    height: 35% !important;
  }
  .unified-editor .editors-panel.layout-left .preview-container,
  .unified-editor .editors-panel.layout-right .preview-container {
    height: 65% !important;
  }
}
@media (max-width: 480px) {
  .unified-editor .header-logo .logo-text {
    display: none;
  }
  .unified-editor .project-title {
    width: 100px;
    font-size: 11px;
  }
  .unified-editor .header-center .ctx-btn span,
  .unified-editor .header-center button span {
    display: none;
  }
  .unified-editor .tb-run {
    font-size: 11px;
    padding: 0 10px;
  }
  .unified-editor .tb-run .fa {
    margin-right: 0;
  }
  .unified-editor .header-right .tb-divider {
    display: none;
  }
  .unified-editor .editor-setting-btn, .unified-editor .panel-gear, .unified-editor .panel-gear-btn {
    display: none;
  }
}
@media (hover: none) and (pointer: coarse) {
  .unified-editor .tb, .unified-editor .btn, .unified-editor .btn-default {
    min-width: 36px;
    min-height: 36px;
  }
  .unified-editor .tb-run, .unified-editor .btn-primary {
    min-height: 36px;
  }
  .unified-editor .settings-close-btn, .unified-editor .modal-close {
    min-width: 36px;
    min-height: 36px;
  }
}

/* ===== Preview-maximize mode =====
   <html class="modal-open"> is toggled by cloudEdit.js when the user clicks
   the eye icon to fullscreen the preview iframe. */
html.modal-open {
  overflow: hidden;
  height: 100%;
}
html.modal-open body, html.modal-open section {
  overflow: hidden;
  height: 100%;
}
html.modal-open .unified-editor #iframeClose {
  display: inline-block;
}
html.modal-open .unified-editor #iframeLabel {
  display: none;
}
html.modal-open .unified-editor .preview {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 99999;
  position: fixed;
  width: 97%;
  height: 97%;
  top: 1%;
  left: 0%;
  margin: 1%;
  background: white;
  overflow: visible;
}

@keyframes unified-editor-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes unified-editor-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
/* ============================================================
   MOCKUP CHROME ADDITIONS — bring the partial DOM closer to
   /design-mockups/editor/* without breaking legacy hooks.
   ============================================================ */
.unified-editor {
  /* Header logo mark (mockup .nav-logo-mark) */
  /* Header kind badge (FRONTEND / .NET / SQL pill next to title) */
  /* Mockup colour-coded language badges */
  /* Avatar stack inside the header */
  /* Pane head extras (mockup .ed-pane-head meta + ghost icon buttons) */
  /* When ed-pane-meta is present push the gear/chevron to the right of meta */
  /* Ghost icon button for pane head buttons (mockup .btn-ghost) */
  /* Small btn variant alignment (mockup uses btn-sm everywhere in the new chrome) */
  /* Run button (mockup .btn-success) */
  /* Status bar mockup polish */
  /* Ed-pane head integration: when both .panel-header and .ed-pane-head are
     on the same element, mockup styling takes priority for spacing. */
  /* Mockup helpers used by ported markup */
}
.unified-editor .nav-logo-mark {
  width: 24px;
  height: 24px;
  font-size: 12px;
}
.unified-editor .header-kind-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.unified-editor .header-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: var(--space-xs);
}
.unified-editor .lang-badge.badge-html, .unified-editor .badge-html {
  background: rgba(241, 101, 41, 0.15);
  color: #ff8856;
}
.unified-editor .lang-badge.badge-css, .unified-editor .badge-css {
  background: rgba(38, 77, 228, 0.18);
  color: #6a8eff;
}
.unified-editor .lang-badge.badge-js, .unified-editor .badge-js {
  background: rgba(247, 185, 12, 0.18);
  color: #f7b90c;
}
.unified-editor .lang-badge.badge-csharp, .unified-editor .badge-csharp {
  background: rgba(127, 84, 175, 0.18);
  color: #c280bb;
}
.unified-editor .lang-badge.badge-sql, .unified-editor .badge-sql {
  background: rgba(255, 174, 51, 0.18);
  color: #ffae33;
}
.unified-editor .lang-badge.frontend {
  background: rgba(241, 101, 41, 0.15);
  color: #ff8856;
}
.unified-editor .lang-badge.backend {
  background: rgba(71, 207, 115, 0.15);
  color: var(--success);
}
.unified-editor .avatar-stack {
  display: inline-flex;
  align-items: center;
}
.unified-editor .avatar-stack .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  border: 2px solid var(--bg-surface);
  margin-left: -8px;
  flex-shrink: 0;
}
.unified-editor .avatar-stack .avatar:first-child {
  margin-left: 0;
}
.unified-editor .header-right .avatar-stack {
  margin: 0 4px;
}
.unified-editor .ed-pane-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.unified-editor .ed-pane-head .ed-pane-meta {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 400;
}
.unified-editor .ed-pane-head .panel-label.lbl {
  font-weight: 600;
  color: var(--text-primary);
}
.unified-editor .ed-pane-head .panel-label.lbl h2 {
  font-weight: 600;
  font-size: var(--text-xs);
  margin: 0;
}
.unified-editor .ed-pane-head .ed-pane-meta + .panel-gear,
.unified-editor .ed-pane-head .ed-pane-meta ~ .panel-dropdown,
.unified-editor .ed-pane-head .ed-pane-meta ~ .toggle-btn {
  margin-left: 0;
}
.unified-editor .btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.unified-editor .btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.unified-editor .btn-sm {
  height: 28px;
  min-width: 28px;
  font-size: var(--text-xs);
  padding: 0 10px;
}
.unified-editor .btn-icon.btn-sm, .unified-editor .btn-sm.btn-icon {
  padding: 0;
  min-width: 28px;
}
.unified-editor .tb-labeled.btn-sm {
  padding: 0 10px;
}
.unified-editor .btn-success, .unified-editor .tb-run.btn-success {
  background: var(--success);
  color: #0a1f10;
  border-color: var(--success);
  font-weight: 600;
}
.unified-editor .btn-success:hover, .unified-editor .tb-run.btn-success:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
  color: #0a1f10;
}
.unified-editor .status-bar.ed-status .status-room-label {
  color: var(--text-muted);
}
.unified-editor .status-bar.ed-status .status-room-label strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-left: 4px;
}
.unified-editor .status-bar.ed-status .status-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.unified-editor .status-bar.ed-status .status-right a {
  color: var(--accent-light);
  text-decoration: none;
}
.unified-editor .status-bar.ed-status .status-right a:hover {
  text-decoration: underline;
}
.unified-editor .status-bar.ed-status .status-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.unified-editor .status-bar.ed-status #webrtc-peer-count {
  margin-left: 4px;
}
.unified-editor .panel-header.ed-pane-head, .unified-editor .ed-pane-head {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.unified-editor .muted {
  color: var(--text-muted);
}
.unified-editor .text-xs {
  font-size: var(--text-xs);
}

/* =============================================================
   WebRTC drawer — v2 unified panel (Cams · Chat · Files · Settings).
   Replaces the old .webrtc-screen / .webrtc-sidebar / .webrtc-footer /
   .webrtc-dock chrome from webboard. Visual rules ported verbatim
   from design-mockups/editor/editor-{frontend,backend,sql}-v2.html.
   ============================================================= */
.unified-editor.editor-shell {
  /* Editor shell becomes a 3-row grid: 56px header / 1fr body / 32px status.
     The body row uses minmax(0, 1fr) — without the explicit 0-min, grid
     items inside whose min-content exceeds 1fr force the row to grow,
     pushing the status bar (and any sticky composer in the drawer) below
     the viewport. */
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) 32px;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  /* Body grid: editor area + drawer column. SQL overrides to 4-col below. */
  /* Drawer must constrain to its grid cell; without an explicit
     max-height the column grows to its content. */
}
.unified-editor.editor-shell .ed-body,
.unified-editor.editor-shell .main-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.unified-editor.editor-shell[data-editor-kind=backend] .ed-body {
  grid-template-columns: minmax(0, 1fr) 380px;
}
.unified-editor.editor-shell[data-editor-kind=sql] .ed-body {
  grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr) 360px;
}
.unified-editor.editor-shell .ed-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.unified-editor.editor-shell .webrtc-drawer {
  max-height: 100%;
  min-height: 0;
}

/* Header pill: live-call status (right side of header) */
.unified-editor {
  /* peer-color avatar gradient tokens — used in mockups + header avatars */
}
.unified-editor .call-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--success-soft);
  border: 1px solid rgba(71, 207, 115, 0.35);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  color: var(--success);
  white-space: nowrap;
}
.unified-editor .call-pill .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: cl-pulse 1.5s ease-in-out infinite;
}
.unified-editor .leave-call {
  background: var(--danger-soft);
  border: 1px solid rgba(243, 65, 65, 0.4);
  color: var(--danger);
}
.unified-editor .leave-call:hover {
  background: rgba(243, 65, 65, 0.2);
}
.unified-editor .hidden {
  display: none !important;
}
.unified-editor .grad-marko {
  background: linear-gradient(135deg, #4da5f5, #007bc0);
}
.unified-editor .grad-anya {
  background: linear-gradient(135deg, #c280bb, #9b4f96);
}
.unified-editor .grad-sam {
  background: linear-gradient(135deg, #47cf73, #289d50);
}
.unified-editor .grad-leo {
  background: linear-gradient(135deg, #ffd76a, #e09000);
}
.unified-editor .mono {
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

@keyframes cl-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}
@keyframes cl-talk-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(71, 207, 115, 0.35), 0 0 16px rgba(71, 207, 115, 0.25);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(71, 207, 115, 0.6), 0 0 24px rgba(71, 207, 115, 0.45);
  }
}
/* =============================================================
   Drawer (right column) — unified Cams / Chat / Files / Settings

   Hidden by default. Toggled by adding `.collab-active` to the
   `.unified-editor` shell (header "Collab" button). When inactive
   the drawer is `display:none` and the editor body grid drops the
   trailing 360px column so the editor fills the row.
   ============================================================= */
.unified-editor:not(.collab-active) .webrtc-drawer.drawer {
  display: none;
}

/* Body grid — collapse last column when drawer is hidden. The grid
   templates are otherwise set per-editor (frontend/backend = 1fr 360px,
   sql = 220px 1fr 1fr 360px). The selector reads `data-editor-kind` from
   the .unified-editor wrapper, not the body. */
.unified-editor[data-editor-kind=frontend]:not(.collab-active) .ed-body,
.unified-editor[data-editor-kind=backend]:not(.collab-active) .ed-body {
  grid-template-columns: 1fr !important;
}

.unified-editor[data-editor-kind=sql]:not(.collab-active) .ed-body {
  grid-template-columns: 220px 1fr 1fr !important;
}

.webrtc-drawer.drawer {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  color: var(--text-primary);
  /* Single visible pane at a time. Each pane fills the drawer body. */
  /* Chat pane — message list scrolls, composer is sticky at the bottom
     so it never falls off-screen on shorter viewports. */
  /* Files pane — dropzone + list scroll, share button + footnote stick to
     the bottom so the upload affordance stays visible. */
  /* ---- Cams pane ----------------------------------------- */
  /* Pre-call CTA */
  /* Hide the CTA once the local stream goes live */
  /* Cam controls (sticky bottom) */
  /* ---- Chat pane ----------------------------------------- */
  /* ---- Files pane ---------------------------------------- */
  /* ---- Settings pane ------------------------------------- */
}
.webrtc-drawer.drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.webrtc-drawer.drawer .drawer-room-title {
  font-size: var(--text-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.webrtc-drawer.drawer .drawer-head-icon {
  color: var(--accent-light);
}
.webrtc-drawer.drawer .room-name {
  font-weight: 400;
}
.webrtc-drawer.drawer .drawer-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow-x: auto;
}
.webrtc-drawer.drawer .drawer-tab {
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration), border-color var(--duration);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.webrtc-drawer.drawer .drawer-tab:hover {
  color: var(--text-primary);
}
.webrtc-drawer.drawer .drawer-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.webrtc-drawer.drawer .drawer-tab .count {
  background: var(--accent);
  color: white;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}
.webrtc-drawer.drawer .drawer-tab .dot-unread {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
}
.webrtc-drawer.drawer .drawer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.webrtc-drawer.drawer .drawer-pane {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.webrtc-drawer.drawer .drawer-pane.active {
  display: flex;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=chat] .chat-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-md);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=chat] .chat-form {
  flex: 0 0 auto;
  padding: 8px var(--space-md);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=chat] .chat-form .input-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=chat] .chat-form .chat-message {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font: inherit;
  font-size: var(--text-sm);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=chat] .chat-form .chat-message:focus {
  outline: none;
  border-color: var(--accent);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=chat] .panel-status {
  flex: 0 0 auto;
  padding: 0 var(--space-md);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-form {
  display: flex;
  flex: 1;
  min-height: 0;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: var(--space-md);
  gap: var(--space-sm);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-dropzone {
  flex: 0 0 auto;
  display: block;
  position: relative;
  border: 1.5px dashed var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  padding: var(--space-md);
  cursor: pointer;
  transition: border-color var(--duration), background var(--duration);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-dropzone .cont-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-dropzone .cont-inner .fa {
  font-size: 22px;
  color: var(--accent-light);
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-dropzone .cont-inner .browse {
  color: var(--accent-light);
  font-weight: 600;
  cursor: pointer;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-dropzone .files-reset-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-dropzone input[type=file] {
  display: none;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .progress-bar-wrapper {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  gap: 8px;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .progress-bar-wrapper.active {
  display: flex;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .progress-bar-wrapper progress {
  flex: 1;
  height: 6px;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding-top: 6px;
}
.webrtc-drawer.drawer .drawer-pane[data-pane=files] .files-footnote {
  flex: 0 0 auto;
}
.webrtc-drawer.drawer .cams-wrap {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.webrtc-drawer.drawer .cam-self,
.webrtc-drawer.drawer .local-stream-container {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1a2c4a, #0f1418);
  border: 2px solid var(--accent);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(0, 123, 192, 0.25);
}
.webrtc-drawer.drawer .cam-self > video,
.webrtc-drawer.drawer .cam-self .video-container,
.webrtc-drawer.drawer .local-stream-container > video,
.webrtc-drawer.drawer .local-stream-container .video-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.webrtc-drawer.drawer .cam-self .self-overlay,
.webrtc-drawer.drawer .cam-self .local-placeholder,
.webrtc-drawer.drawer .local-stream-container .self-overlay,
.webrtc-drawer.drawer .local-stream-container .local-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.webrtc-drawer.drawer .cam-self .self-initial,
.webrtc-drawer.drawer .cam-self .local-placeholder img.avatar,
.webrtc-drawer.drawer .local-stream-container .self-initial,
.webrtc-drawer.drawer .local-stream-container .local-placeholder img.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #4da5f5, #007bc0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.webrtc-drawer.drawer .cam-self .self-meta,
.webrtc-drawer.drawer .cam-self .tile-meta,
.webrtc-drawer.drawer .local-stream-container .self-meta,
.webrtc-drawer.drawer .local-stream-container .tile-meta {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 11px;
  color: white;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.webrtc-drawer.drawer .cam-self .self-meta .badge-you,
.webrtc-drawer.drawer .cam-self .tile-meta .badge-you,
.webrtc-drawer.drawer .local-stream-container .self-meta .badge-you,
.webrtc-drawer.drawer .local-stream-container .tile-meta .badge-you {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent);
  color: white;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.webrtc-drawer.drawer .cam-self .local-toggles,
.webrtc-drawer.drawer .local-stream-container .local-toggles {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.webrtc-drawer.drawer .cam-self .local-toggle-btn,
.webrtc-drawer.drawer .local-stream-container .local-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(15, 20, 24, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.webrtc-drawer.drawer .cam-self .local-toggle-btn.off,
.webrtc-drawer.drawer .local-stream-container .local-toggle-btn.off {
  color: var(--danger);
}
.webrtc-drawer.drawer .cam-self .local-toggle-btn.on,
.webrtc-drawer.drawer .local-stream-container .local-toggle-btn.on {
  color: var(--success);
}
.webrtc-drawer.drawer .cam-grid,
.webrtc-drawer.drawer #remotes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 0;
}
.webrtc-drawer.drawer .cam-grid .webrtc-info-text,
.webrtc-drawer.drawer #remotes .webrtc-info-text {
  grid-column: 1/-1;
  text-align: center;
  padding: var(--space-md);
  border: 1.5px dashed var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}
.webrtc-drawer.drawer .cam-grid .peerContainer,
.webrtc-drawer.drawer #remotes .peerContainer {
  aspect-ratio: 1/1;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
}
.webrtc-drawer.drawer .cam-grid .peerContainer video,
.webrtc-drawer.drawer #remotes .peerContainer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.webrtc-drawer.drawer .reactions-bar {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.webrtc-drawer.drawer .reactions-bar .reaction-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.webrtc-drawer.drawer .reactions-bar .reaction-btn:hover {
  background: var(--bg-active);
}
.webrtc-drawer.drawer .conn-row,
.webrtc-drawer.drawer .cam-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 4px;
  flex-shrink: 0;
}
.webrtc-drawer.drawer .conn-row .dot,
.webrtc-drawer.drawer .conn-row .status-dot,
.webrtc-drawer.drawer .cam-meta .dot,
.webrtc-drawer.drawer .cam-meta .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 4px var(--success);
}
.webrtc-drawer.drawer .conn-row .sep,
.webrtc-drawer.drawer .cam-meta .sep {
  color: var(--border-default);
}
.webrtc-drawer.drawer .webrtc-prejoin {
  text-align: center;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.webrtc-drawer.drawer .webrtc-prejoin .webrtc-join-btn,
.webrtc-drawer.drawer .webrtc-prejoin #codelabs-join-call {
  width: 100%;
  background: var(--accent);
  border: 0;
  color: #fff;
}
.webrtc-drawer.drawer .webrtc-prejoin .webrtc-join-btn:hover,
.webrtc-drawer.drawer .webrtc-prejoin #codelabs-join-call:hover {
  filter: brightness(1.05);
}
.webrtc-drawer.drawer .webrtc-prejoin .webrtc-join-btn:disabled,
.webrtc-drawer.drawer .webrtc-prejoin #codelabs-join-call:disabled {
  opacity: 0.6;
  cursor: progress;
}
.webrtc-drawer.drawer .webrtc-prejoin .webrtc-prejoin-hint {
  margin-top: 6px;
}
.webrtc-drawer.drawer .local-stream-container:not(.no-video) ~ .webrtc-prejoin,
.webrtc-drawer.drawer .local-stream-container.streaming + .webrtc-prejoin {
  display: none;
}
.webrtc-drawer.drawer .cam-controls {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 12px var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}
.webrtc-drawer.drawer .ctrl,
.webrtc-drawer.drawer .ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background var(--duration), color var(--duration);
}
.webrtc-drawer.drawer .ctrl:hover,
.webrtc-drawer.drawer .ctrl-btn:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}
.webrtc-drawer.drawer .ctrl.on,
.webrtc-drawer.drawer .ctrl-btn.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-light);
}
.webrtc-drawer.drawer .ctrl.off,
.webrtc-drawer.drawer .ctrl-btn.off {
  background: rgba(243, 65, 65, 0.1);
  border-color: rgba(243, 65, 65, 0.4);
  color: var(--danger);
}
.webrtc-drawer.drawer .ctrl.active,
.webrtc-drawer.drawer .ctrl-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-light);
}
.webrtc-drawer.drawer .ctrl-btn-danger,
.webrtc-drawer.drawer .ctrl.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}
.webrtc-drawer.drawer .ctrl-btn-danger:hover,
.webrtc-drawer.drawer .ctrl.danger:hover {
  background: #e02b2b;
  color: white;
}
.webrtc-drawer.drawer .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.webrtc-drawer.drawer .chat-content,
.webrtc-drawer.drawer .chat-list {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.webrtc-drawer.drawer .chat-form,
.webrtc-drawer.drawer .composer {
  padding: 10px var(--space-md);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.webrtc-drawer.drawer .chat-form .input-wrap,
.webrtc-drawer.drawer .composer .input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-input, var(--bg-surface));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}
.webrtc-drawer.drawer .chat-form .input-wrap:focus-within,
.webrtc-drawer.drawer .composer .input-wrap:focus-within {
  border-color: var(--accent);
}
.webrtc-drawer.drawer .chat-form input.chat-message,
.webrtc-drawer.drawer .composer input.chat-message {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 12.5px;
  padding: 4px;
  outline: none;
}
.webrtc-drawer.drawer .chat-form .send,
.webrtc-drawer.drawer .composer .send {
  background: var(--accent);
  color: white;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.webrtc-drawer.drawer .chat-form .send:hover,
.webrtc-drawer.drawer .composer .send:hover {
  filter: brightness(1.05);
  color: white;
}
.webrtc-drawer.drawer .files-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.webrtc-drawer.drawer .files-wrap {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.webrtc-drawer.drawer .dropzone,
.webrtc-drawer.drawer .files-dropzone {
  border: 1.5px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: var(--bg-elevated);
  transition: border-color var(--duration), background var(--duration);
  cursor: pointer;
  position: relative;
}
.webrtc-drawer.drawer .dropzone:hover, .webrtc-drawer.drawer .dropzone.dragover,
.webrtc-drawer.drawer .files-dropzone:hover,
.webrtc-drawer.drawer .files-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.webrtc-drawer.drawer .dropzone i,
.webrtc-drawer.drawer .files-dropzone i {
  font-size: 28px;
  color: var(--accent-light);
}
.webrtc-drawer.drawer .dropzone .t1,
.webrtc-drawer.drawer .files-dropzone .t1 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.webrtc-drawer.drawer .dropzone .t2,
.webrtc-drawer.drawer .files-dropzone .t2 {
  font-size: 11px;
  color: var(--text-muted);
}
.webrtc-drawer.drawer .dropzone .browse,
.webrtc-drawer.drawer .files-dropzone .browse {
  color: var(--accent-light);
  cursor: pointer;
}
.webrtc-drawer.drawer .dropzone input[type=file],
.webrtc-drawer.drawer .files-dropzone input[type=file] {
  display: none;
}
.webrtc-drawer.drawer .dropzone .files-reset-btn,
.webrtc-drawer.drawer .files-dropzone .files-reset-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}
.webrtc-drawer.drawer .files-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.webrtc-drawer.drawer .files-actions {
  display: flex;
  gap: 6px;
}
.webrtc-drawer.drawer .files-footnote {
  text-align: center;
  padding-top: 6px;
}
.webrtc-drawer.drawer [data-pane=settings] {
  overflow: auto;
  padding: 0;
}
.webrtc-drawer.drawer [data-pane=settings] .settings-tabs {
  display: flex;
  gap: 0;
  padding: 0 var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}
.webrtc-drawer.drawer [data-pane=settings] .settings-tabs .settings-tab {
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}
.webrtc-drawer.drawer [data-pane=settings] .settings-tabs .settings-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.webrtc-drawer.drawer [data-pane=settings] .settings-page {
  display: none;
  padding: var(--space-md);
}
.webrtc-drawer.drawer [data-pane=settings] .settings-page.active {
  display: block;
}
.webrtc-drawer.drawer [data-pane=settings] .settings-section + .settings-section {
  padding-top: var(--space-md);
}
.webrtc-drawer.drawer [data-pane=settings] .settings-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
}

/* Compatibility shells — webboard-era ids preserved as hooks for
   board-webrtc.js / classroom-simplewebrtc.js. They render hidden. */
.webrtc-drawer .webrtc-compat-shell {
  display: none !important;
}

.unified-editor #settings-modal {
  display: none !important;
}

.unified-editor #webrtc-dock,
.unified-editor #webrtc-footer,
.unified-editor #webrtc-fullscreen {
  display: none !important;
}

/* Force the legacy options-panels container off-screen */
.unified-editor .options-panels {
  display: none !important;
}

/* =====================================================================
   Drawer chat + file-share tile styling
   ---------------------------------------------------------------------
   The webboard-era webrtc-chat.css / webrtc-file-shares.css are NOT
   imported (they were sized for webboard's drawer dimensions and
   collapsed our cam-tile rules). This block carries just the bits we
   need for the editor drawer's Chat + Files panes.
   ===================================================================== */
.webrtc-drawer {
  /* ---- Chat ----
     Bubble layout mirrors webboard's webrtc-chat.css:
       - .msg-peer (others): left-aligned bubble, top-left corner squared
       - .msg-user (you):    right-aligned bubble, top-right corner squared
     Container uses 85% width, with the chosen side margin pushing the
     opposite direction so peers and locals don't overlap visually. The
     avatar floats inside the bubble's header (not outside it) so the
     text re-flows alongside it. */
  /* ---- File shares ---- */
}
.webrtc-drawer #footer-message-list,
.webrtc-drawer #sidebar-message-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.webrtc-drawer .chat-msg {
  width: 85%;
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.webrtc-drawer .msg-peer {
  align-self: flex-start;
  border-top-left-radius: 2px;
  background: rgba(77, 165, 245, 0.08);
  border: 1px solid rgba(77, 165, 245, 0.18);
}
.webrtc-drawer .msg-user {
  align-self: flex-end;
  border-top-right-radius: 2px;
  background: linear-gradient(135deg, rgba(77, 165, 245, 0.22), rgba(0, 123, 192, 0.22));
  border: 1px solid rgba(77, 165, 245, 0.35);
}
.webrtc-drawer .msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}
.webrtc-drawer .msg-avatar {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
}
.webrtc-drawer .msg-avatar.avatar-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4da5f5, #007bc0);
  text-transform: uppercase;
}
.webrtc-drawer .msg-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.webrtc-drawer .msg-from {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
.webrtc-drawer .msg-time {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  flex: 0 0 auto;
}
.webrtc-drawer .msg-content {
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.webrtc-drawer .msg-content p {
  margin: 0;
}
.webrtc-drawer .msg-content a {
  color: var(--accent, #4da5f5);
}
.webrtc-drawer .file-share {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.webrtc-drawer .file-share:last-child {
  border-bottom: 0;
}
.webrtc-drawer .file-info {
  flex: 1 1 auto;
  min-width: 0;
}
.webrtc-drawer .file-info a.shared-file {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.webrtc-drawer .file-info a.shared-file:hover .file-name {
  text-decoration: underline;
}
.webrtc-drawer .file-share-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--accent, #4da5f5);
  font-size: 16px;
}
.webrtc-drawer .file-share-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.webrtc-drawer .file-name {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.webrtc-drawer .file-sub {
  font-size: 11px;
  color: var(--muted);
}
.webrtc-drawer .file-share-remove {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}
.webrtc-drawer .file-share-remove:hover {
  background: rgba(255, 0, 0, 0.08);
  border-color: rgba(255, 0, 0, 0.25);
  color: #f55;
}

/* =====================================================================
   Editor-partial helper classes — extracted from inline style="..."
   attributes in CodeEditor.cshtml / BackendEditor.cshtml / SqlEditor.cshtml
   per the hard rule "All CSS as SCSS. Never inline <style>, never inline
   style=." DRY-violation patterns first; one-off decorations next.
   ===================================================================== */
.unified-editor {
  /* Header right-side cluster pushes itself to the end of the toolbar. */
  /* Copy-invite link in the status bar — same auto-margin idiom. */
  /* Status-bar close button on the output pane. */
  /* Subtle accent for inline FA icons in panel headers (terminal/globe/table). */
  /* Inline placeholder text inside the console / preview blocks. */
  /* Tiny database glyph inside the SQL logo. */
  /* Razor / .cshtml language badge. */
  /* Centered loading screen inside the preview pane. */
  /* Large dimmed icon for empty-state panels (e.g. results table empty). */
  /* Initially-hidden until JS swaps state. Equivalent to the HTML `hidden`
     attribute but a class so callers can flip via classList.toggle. */
}
.unified-editor .ed-header .header-right {
  margin-left: auto;
}
.unified-editor #copy-link {
  margin-left: auto;
}
.unified-editor .output-action.close-btn {
  margin-left: auto;
}
.unified-editor .icon-tint-accent {
  color: var(--accent-light, var(--accent, #4da5f5));
}
.unified-editor .placeholder-comment {
  color: #888;
}
.unified-editor .icon-glyph-xs {
  font-size: 10px;
}
.unified-editor .lang-badge.cshtml {
  background: rgba(187, 87, 50, 0.15);
  color: #ff8856;
}
.unified-editor .loading-screen-inner {
  text-align: center;
  padding-top: 50px;
}
.unified-editor .empty-state-icon {
  font-size: 40px;
  opacity: 0.3;
  margin-bottom: 10px;
}
.unified-editor .is-hidden {
  display: none;
}

/* ===========================================================================
   Pen share modal — compiled from weboard-share-form.scss.
   Do not edit by hand; edit the .scss source and recompile via Web Compiler.
   =========================================================================== */

#pen-share-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
#pen-share-modal.is-open {
    display: flex;
}
#pen-share-modal .pen-share-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 18, 0.62);
    backdrop-filter: blur(2px);
}
#pen-share-modal .pen-share-panel {
    position: relative;
    width: min(540px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.pen-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}
.pen-share-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}
.pen-share-close-btn {
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 6px;
}
.pen-share-close-btn:hover {
    color: var(--text-primary);
}

.pen-share-form {
    overflow-y: auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.pen-share-info { margin: 0; }

.pen-share-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.pen-share-section h4 { margin: 0; font-size: var(--text-md); }
.pen-share-section p { margin: 0; }

.pen-share-radio-row {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.pen-share-radio {
    flex: 1 1 220px;
    cursor: pointer;
    display: block;
}
.pen-share-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.pen-share-radio > span {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: border-color 120ms ease, background 120ms ease;
}
.pen-share-radio > span > i {
    margin-top: 2px;
    color: var(--accent-light);
}
.pen-share-radio > span > strong {
    display: block;
    font-size: var(--text-sm);
}
.pen-share-radio > span > small {
    display: block;
    font-size: var(--text-xs);
    margin-top: 2px;
}
.pen-share-radio input[type="radio"]:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.pen-share-permissions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs) var(--space-md);
}
.pen-share-permissions li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}
.pen-share-permissions li label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
}
.pen-share-permissions li label i {
    color: var(--text-muted);
    width: 16px;
}
.pen-share-permissions li input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.pen-share-tab {
    display: none;
    padding-top: var(--space-sm);
}
.pen-share-tab.is-active {
    display: block;
}
.pen-share-tab .pen-share-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: 6px;
}
.pen-share-tab .url-link-input {
    width: 100%;
    min-height: 70px;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    padding: var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    resize: vertical;
}
.pen-share-tab .participant-emails {
    width: 100%;
    padding: var(--space-sm);
    font-size: var(--text-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.pen-share-warning {
    margin: var(--space-xs) 0 0;
    color: var(--warning, #d97706);
}
.pen-share-warning.warning-coming-soon {
    font-style: italic;
}

.pen-share-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}
.pen-share-footer .pen-share-stop {
    margin-right: auto;
}
.pen-share-footer .hidden {
    display: none;
}

/* ===========================================================================
   Editor Settings modal — same backdrop+panel pattern as the share modal.
   =========================================================================== */
.editor-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.editor-settings-modal.is-open {
    display: flex;
}
.editor-settings-modal .editor-settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 18, 0.62);
    backdrop-filter: blur(2px);
}
.editor-settings-modal .editor-settings-panel {
    position: relative;
    width: min(820px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.editor-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}
.editor-settings-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}
.editor-settings-close-btn {
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 6px;
}
.editor-settings-close-btn:hover {
    color: var(--text-primary);
}

.editor-settings-body {
    overflow-y: auto;
    padding: var(--space-md) var(--space-lg);
    flex: 1;
}
.editor-settings-body .settings-tabs {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-md);
}
.editor-settings-body .settings-page {
    display: none;
}
.editor-settings-body .settings-page.active {
    display: block;
}
.editor-settings-body .settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}
