*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2128;
  --surface3: #21262d;
  --border: #30363d;
  --border2: #3d444d;
  --accent: #7c3aed;
  --accent2: #a78bfa;
  --accent-glow: rgba(124,58,237,0.25);
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #484f58;
  --green: #3fb950;
  --green-glow: rgba(63,185,80,0.2);
  --red: #f85149;
  --yellow: #d29922;
  --topbar-h: 48px;
  --sidebar-w: 220px;
  --mobile-nav-h: 56px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[data-lucide] { width: 14px; height: 14px; stroke-width: 1.75; flex-shrink: 0; }

/* ── TOPBAR ─────────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.2px;
  flex-shrink: 0;
}
.logo-icon { width: 16px; height: 16px; color: var(--accent2); }
.credit { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.credit-name { color: var(--text-muted); }
.topbar-right { display: flex; gap: 2px; align-items: center; flex-shrink: 0; }

.topbar-right button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.topbar-right button:hover { background: var(--surface3); color: var(--text); }
.topbar-right button.icon-only { padding: 5px 7px; }
.topbar-right button [data-lucide] { width: 14px; height: 14px; }

/* ── LAYOUT ─────────────────────────────────────────────────────────────────── */
.main-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  margin-top: var(--topbar-h);
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s, min-width 0.2s;
}
.sidebar.collapsed { width: 0; min-width: 0; }
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.sidebar-title [data-lucide] { width: 12px; height: 12px; }
.icon-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.12s, background 0.12s;
}
.icon-btn:hover { color: var(--text); background: var(--surface3); }
.icon-btn [data-lucide] { width: 13px; height: 13px; }

#file-list { list-style: none; overflow-y: auto; flex: 1; padding: 4px 0; }
#file-list::-webkit-scrollbar { width: 3px; }
#file-list::-webkit-scrollbar-thumb { background: var(--border); }
#file-list li {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 0.8rem;
  border-radius: 4px;
  margin: 1px 4px;
  gap: 6px;
  transition: background 0.1s;
  color: var(--text-muted);
}
#file-list li:hover { background: var(--surface2); color: var(--text); }
#file-list li.active { background: var(--surface3); color: var(--text); }
#file-list li .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#file-list li .del-btn {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; opacity: 0; transition: opacity 0.1s;
  display: flex; align-items: center; padding: 1px;
}
#file-list li .del-btn [data-lucide] { width: 11px; height: 11px; }
#file-list li:hover .del-btn { opacity: 1; }
#file-list li.active .del-btn { opacity: 0.5; }
#file-list li.active .del-btn:hover { opacity: 1; color: var(--red); }

/* ── EDITOR PANEL ───────────────────────────────────────────────────────────── */
.editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg);
}
.editor-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  min-height: 36px;
  flex-shrink: 0;
}
.editor-tabs::-webkit-scrollbar { height: 0; }
.tab {
  padding: 0 14px;
  height: 36px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.tab:hover { background: var(--surface2); color: var(--text); }
.tab.active {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--bg);
}
.tab.active::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent2);
}
.tab .tab-close {
  font-size: 0.6rem;
  opacity: 0;
  margin-left: 2px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: opacity 0.1s, background 0.1s;
}
.tab:hover .tab-close, .tab.active .tab-close { opacity: 0.6; }
.tab .tab-close:hover { opacity: 1 !important; background: var(--surface3); }

.editor-body { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.editor-wrap { flex: 1; overflow: hidden; min-width: 0; }

.CodeMirror {
  height: 100% !important;
  font-size: 13px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  background: var(--bg) !important;
  line-height: 1.6;
}
.CodeMirror-scroll { height: 100%; }
.CodeMirror-gutters { background: var(--bg) !important; border-right: 1px solid var(--border) !important; padding-right: 4px; }
.CodeMirror-linenumber { color: var(--text-dim) !important; font-size: 0.75rem; }
.CodeMirror-cursor { border-left-color: var(--accent2) !important; }

/* ── CHAT PANEL ─────────────────────────────────────────────────────────────── */
.chat-panel {
  width: 360px;
  min-width: 280px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 36px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chat-title [data-lucide] { width: 13px; height: 13px; color: var(--accent2); }
.chat-header-actions { display: flex; align-items: center; gap: 4px; }
.model-badge {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
#btn-clear-chat {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 4px; border-radius: 4px;
  display: flex; align-items: center; transition: color 0.12s, background 0.12s;
}
#btn-clear-chat:hover { color: var(--red); background: rgba(248,81,73,0.08); }
#btn-clear-chat [data-lucide] { width: 13px; height: 13px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.msg {
  max-width: 95%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.6;
  word-break: break-word;
}
.msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.msg.ai {
  background: var(--surface2);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border);
  max-width: 100%;
}
.msg.ai pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 0.76rem;
}
.msg.ai code { font-family: 'JetBrains Mono', 'Fira Code', monospace; color: #c9d1d9; }
.msg.loading { color: var(--text-muted); font-style: italic; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.msg .apply-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px; background: var(--green); color: #000;
  border: none; padding: 4px 10px; border-radius: 5px;
  cursor: pointer; font-size: 0.74rem; font-weight: 700;
  transition: opacity 0.12s;
}
.msg .apply-btn:hover { opacity: 0.85; }

.chat-input-area {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--surface);
}
#chat-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.82rem;
  resize: none;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s;
  line-height: 1.5;
}
#chat-input:focus { border-color: var(--accent2); }
#chat-input::placeholder { color: var(--text-dim); }
.chat-actions { display: flex; align-items: center; justify-content: space-between; }
.context-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.74rem; color: var(--text-muted); cursor: pointer;
}
.context-toggle input { accent-color: var(--accent2); }
#btn-send {
  background: var(--accent);
  color: #fff; border: none;
  padding: 6px 14px; border-radius: 6px;
  cursor: pointer; font-size: 0.8rem; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
  transition: background 0.12s;
}
#btn-send:hover { background: #6d28d9; }
#btn-send:disabled { opacity: 0.35; cursor: not-allowed; }
#btn-send [data-lucide] { width: 12px; height: 12px; }

/* ── MOBILE NAV ─────────────────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
}
.mobile-nav-btn {
  flex: 1; background: none; border: none;
  color: var(--text-dim); font-size: 0.68rem;
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  transition: color 0.12s; padding: 6px 0;
}
.mobile-nav-btn [data-lucide] { width: 18px; height: 18px; }
.mobile-nav-btn.active { color: var(--accent2); }

/* ── MODALS ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  width: 100%; max-width: 420px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  animation: modalIn 0.15s ease;
}
@keyframes modalIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-title { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; }
.modal-title [data-lucide] { width: 15px; height: 15px; color: var(--accent2); }
.modal-close {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 4px; border-radius: 4px;
  display: flex; align-items: center; transition: color 0.12s, background 0.12s;
}
.modal-close:hover { color: var(--red); background: rgba(248,81,73,0.08); }
.modal-close [data-lucide] { width: 14px; height: 14px; }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.modal-body label { font-size: 0.76rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.modal-body input, .modal-body select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 8px 10px; border-radius: 6px;
  font-size: 0.84rem; outline: none; width: 100%;
  transition: border-color 0.12s;
}
.modal-body input:focus, .modal-body select:focus { border-color: var(--accent2); }
.modal-body small { color: var(--text-dim); font-size: 0.72rem; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.modal-footer button {
  background: var(--accent); color: #fff; border: none;
  padding: 7px 18px; border-radius: 6px; cursor: pointer;
  font-weight: 600; font-size: 0.82rem;
  display: flex; align-items: center; gap: 5px;
  transition: background 0.12s;
}
.modal-footer button:hover { background: #6d28d9; }
.modal-footer button [data-lucide] { width: 13px; height: 13px; }

/* ── SETTINGS TOGGLES ───────────────────────────────────────────────────────── */
.settings-divider { height: 1px; background: var(--border); margin: 12px 0 8px; }
.settings-section-title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 4px;
}
.settings-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; margin-top: 5px;
  transition: border-color 0.12s;
}
.settings-toggle:hover { border-color: var(--border2); }
.settings-toggle input[type="checkbox"] { display: none; }
.toggle-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.toggle-label { font-size: 0.8rem; color: var(--text); font-weight: 500; }
.toggle-desc { font-size: 0.71rem; color: var(--text-muted); line-height: 1.4; }
.toggle-switch {
  width: 32px; height: 18px;
  background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 18px; flex-shrink: 0; position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-switch::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--text-dim); border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.settings-toggle input:checked ~ .toggle-switch { background: var(--accent); border-color: var(--accent); }
.settings-toggle input:checked ~ .toggle-switch::after { transform: translateX(14px); background: #fff; }

/* ── TOAST ──────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 68px; left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); padding: 7px 16px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 500; z-index: 300;
  opacity: 0; transition: opacity 0.18s, transform 0.18s;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── USAGE BADGE ────────────────────────────────────────────────────────────── */
.usage-badge {
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}
.usage-badge.premium { background: rgba(124,58,237,0.15); color: var(--accent2); border: 1px solid rgba(124,58,237,0.3); }
.usage-badge.free { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.usage-badge.free.low { background: rgba(248,81,73,0.08); color: var(--red); border-color: rgba(248,81,73,0.25); }

/* ── PREVIEW PANEL ──────────────────────────────────────────────────────────── */
.preview-panel {
  width: 50%; min-width: 260px;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: #fff; overflow: hidden;
}
.preview-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px; height: 36px;
  background: var(--surface2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.preview-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.preview-title [data-lucide] { width: 12px; height: 12px; color: var(--accent2); }
.preview-actions { display: flex; gap: 2px; }
.preview-actions button {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 4px 5px; border-radius: 4px;
  display: flex; align-items: center; transition: color 0.12s, background 0.12s;
}
.preview-actions button:hover { color: var(--text); background: var(--surface3); }
.preview-actions button [data-lucide] { width: 12px; height: 12px; }
#preview-frame { flex: 1; width: 100%; border: none; background: #fff; }

/* ── DRAG & DROP ────────────────────────────────────────────────────────────── */
.drag-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(13,17,23,0.88); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; pointer-events: none;
}
.drag-overlay.active { display: flex; pointer-events: all; }
.drag-overlay-inner {
  border: 1.5px dashed var(--accent2); border-radius: 12px;
  padding: 48px 72px; display: flex; flex-direction: column;
  align-items: center; gap: 12px; color: var(--accent2);
}
.drag-overlay-inner [data-lucide] { width: 40px; height: 40px; stroke-width: 1.2; }
.drag-overlay-inner p { font-size: 1.1rem; font-weight: 600; }

.drop-zone {
  margin: 8px; border: 1px dashed var(--border);
  border-radius: 6px; padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; color: var(--text-dim); font-size: 0.7rem;
  transition: border-color 0.15s, color 0.15s; cursor: pointer;
}
.drop-zone:hover { border-color: var(--accent2); color: var(--accent2); }
.drop-zone [data-lucide] { width: 14px; height: 14px; }

/* ── FILE ICONS ─────────────────────────────────────────────────────────────── */
.ficon { width: 16px; height: 16px; border-radius: 2px; flex-shrink: 0; display: block; }
.file-icon { display: flex; align-items: center; flex-shrink: 0; }
.tab-icon { display: flex; align-items: center; flex-shrink: 0; }
.tab-icon .ficon { width: 13px; height: 13px; }
.tab-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── STREAMING ──────────────────────────────────────────────────────────────── */
.msg.streaming { opacity: 0.9; }
.stream-cursor {
  display: inline-block; color: var(--accent2);
  animation: blink 0.7s step-end infinite; margin-left: 1px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.dot-pulse {
  display: inline-block; width: 7px; height: 7px;
  background: var(--accent2); border-radius: 50%;
  animation: dotpulse 1.2s ease-in-out infinite;
}
@keyframes dotpulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(0.4);opacity:0.3} }

/* ── APPLY BUTTONS ──────────────────────────────────────────────────────────── */
.apply-btn-group { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.apply-btn-new {
  background: var(--surface3) !important; color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
}
.apply-btn-new:hover { color: var(--text) !important; border-color: var(--border2) !important; }
.patch-btn {
  background: #0f766e !important; color: #fff !important;
  margin-top: 8px; display: block; width: 100%; text-align: center;
}
.patch-btn:hover { background: #0d9488 !important; }
.auto-applied-badge {
  display: inline-block; margin-top: 5px;
  background: rgba(63,185,80,0.1); border: 1px solid rgba(63,185,80,0.3);
  color: var(--green); padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 600;
}

/* ── SCROLLBARS ─────────────────────────────────────────────────────────────── */
.CodeMirror-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.CodeMirror-scroll::-webkit-scrollbar-track { background: var(--bg); }
.CodeMirror-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.CodeMirror-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
.CodeMirror-vscrollbar::-webkit-scrollbar, .CodeMirror-hscrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.CodeMirror-vscrollbar::-webkit-scrollbar-track, .CodeMirror-hscrollbar::-webkit-scrollbar-track { background: var(--bg); }
.CodeMirror-vscrollbar::-webkit-scrollbar-thumb, .CodeMirror-hscrollbar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --topbar-h: 46px; }
  .mobile-nav { display: flex; }
  .main-layout { height: calc(100vh - var(--topbar-h) - var(--mobile-nav-h)); }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0;
    bottom: var(--mobile-nav-h); z-index: 50;
    width: 260px; min-width: 260px;
    transform: translateX(-100%); transition: transform 0.22s;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .editor-panel { width: 100%; display: none; }
  .editor-panel.mobile-active { display: flex; }
  .chat-panel { width: 100%; min-width: unset; border-left: none; display: none; }
  .chat-panel.mobile-active { display: flex; }
  .topbar-right button span { display: none; }
  .topbar-right button { padding: 5px 7px; }
  .credit { display: none; }
  .editor-body { flex-direction: column; }
  .preview-panel { width: 100%; min-width: unset; border-left: none; border-top: 1px solid var(--border); height: 50%; }
  .editor-wrap { height: 50%; }
}
@media (min-width: 769px) {
  .editor-panel { display: flex !important; }
  .chat-panel { display: flex !important; }
  .sidebar { transform: none !important; position: relative; top: auto; }
  .mobile-nav { display: none !important; }
  .main-layout { height: calc(100vh - var(--topbar-h)); }
}
