*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

a{
  text-decoration: none; 
}
:root {
  --bg:          #0a0a0a;
  --surface:     #111111;
  --panel:       #161616;
  --border:      #1e1e1e;
  --border2:     #2a2a2a;
  --accent:      #f59e0b;
  --accent-dim:  rgba(245,158,11,0.12);
  --accent-glow: rgba(245,158,11,0.2);
  --green:       #22c55e;
  --red:         #ef4444;
  --text:        #f0f0f0;
  --muted:       #555;
  --muted2:      #2a2a2a;
  --dot-color:   rgba(255,255,255,0.022);
  --nav-h:       54px;
  --toolbar-h:   40px;
  --footer-h:    22px;
  --status-h:    24px;
}

[data-theme="light"] {
  --bg:        #f4f4f5;
  --surface:   #ffffff;
  --panel:     #efefef;
  --border:    #e4e4e7;
  --border2:   #d4d4d8;
  --text:      #18181b;
  --muted:     #71717a;
  --muted2:    #d4d4d8;
  --dot-color: rgba(0,0,0,0.03);
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'JetBrains Mono', monospace; overflow: hidden; }

body::before {
  content: ''; position: fixed; inset: 0;
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 28px 28px; pointer-events: none; z-index: 0;
}

/* ══════════════════════════════
   HEADER — single row always
══════════════════════════════ */
header {
  position: relative; z-index: 200;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
}

/* Logo */
.logo {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; flex-shrink: 0;
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.88; }

.logo-icon {
  position: relative;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid rgba(245,158,11,0.25);
  display: flex; align-items: center; justify-content: center;
  overflow: visible; flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(245,158,11,0.08),
    0 0 16px rgba(245,158,11,0.12),
    0 4px 12px rgba(0,0,0,0.5);
  transition: box-shadow 0.25s, border-color 0.25s;
}
[data-theme="light"] .logo-icon {
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
  border-color: rgba(245,158,11,0.3);
  box-shadow: 0 0 0 1px rgba(245,158,11,0.1), 0 4px 12px rgba(0,0,0,0.1);
}
.logo:hover .logo-icon {
  border-color: rgba(245,158,11,0.55);
  box-shadow:
    0 0 0 1px rgba(245,158,11,0.2),
    0 0 22px rgba(245,158,11,0.22),
    0 4px 16px rgba(0,0,0,0.5);
}

/* Spinning ring on hover */
.logo-icon-ring {
  position: absolute; inset: -3px;
  border-radius: 13px;
  border: 1.5px solid transparent;
  border-top-color: var(--accent);
  border-right-color: rgba(245,158,11,0.3);
  opacity: 0;
  transition: opacity 0.2s;
  animation: logo-spin 1.8s linear infinite;
  pointer-events: none;
}
.logo:hover .logo-icon-ring { opacity: 1; }
@keyframes logo-spin { to { transform: rotate(360deg); } }

.logo-img {
  width: 22px; height: 22px; object-fit: contain;
  display: block; position: relative; z-index: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}
.logo-img-fallback {
  display: none; width: 100%; height: 100%;
  align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
  font-size: 17px;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-wordmark {
  display: flex; flex-direction: column; gap: 1px;
}
.logo-top {
  display: flex; align-items: center; gap: 7px; line-height: 1;
}
.logo-name {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
  font-size: 18px; letter-spacing: -0.6px;
  background: linear-gradient(135deg, var(--text) 0%, rgba(240,240,240,0.75) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .logo-name {
  background: linear-gradient(135deg, #18181b 0%, #3f3f46 100%);
  -webkit-background-clip: text; background-clip: text;
}
.logo-divider {
  width: 1px; height: 14px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.55; flex-shrink: 0;
}
.logo-name-code {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 12.5px; letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent) 0%, #fbbf24 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-tagline {
  font-family: 'JetBrains Mono', monospace; font-weight: 400;
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); opacity: 0.6; line-height: 1; margin-top: 1px;
}

/* Desktop center — lang select */
.nav-center { flex: 1; display: flex; justify-content: center; min-width: 0; padding: 0 12px; }
.lang-select-wrapper { position: relative; width: 100%; max-width: 280px; }
.lang-select {
  appearance: none; width: 100%;
  background: var(--panel); border: 1px solid var(--border2);
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 12px; padding: 7px 30px 7px 12px;
  border-radius: 8px; cursor: pointer; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lang-select:hover, .lang-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.lang-select-wrapper::after {
  content: '▾'; position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); pointer-events: none; color: var(--muted); font-size: 11px;
}
[data-theme="light"] .lang-select { background: var(--surface); }

/* Desktop right tools */
.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-mobile { display: none; align-items: center; gap: 8px; flex-shrink: 0; }

/* Status dot */
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 7px var(--green);
  animation: pulse-dot 2.5s ease-in-out infinite; flex-shrink: 0;
}
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: none;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  font-weight: 700; cursor: pointer; transition: all 0.18s;
  letter-spacing: 0.3px; white-space: nowrap; flex-shrink: 0;
}
.btn-run {
  background: var(--accent); color: #000; padding: 7px 18px;
  box-shadow: 0 0 14px var(--accent-glow), 0 3px 8px rgba(0,0,0,0.3);
}
.btn-run:hover:not(:disabled) { background: #fbbf24; transform: translateY(-1px); box-shadow: 0 0 22px rgba(245,158,11,0.4), 0 5px 14px rgba(0,0,0,0.35); }
.btn-run:active:not(:disabled) { transform: translateY(0); }
.btn-run.loading { opacity: 0.65; cursor: not-allowed; transform: none !important; }
.btn-icon { background: var(--panel); border: 1px solid var(--border2); color: var(--muted); padding: 7px 10px; }
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
[data-theme="light"] .btn-icon { background: var(--surface); }
.btn-ghost { background: transparent; border: 1px solid var(--border2); color: var(--muted); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 12px; height: 12px; border: 2px solid rgba(0,0,0,0.2); border-top-color: #000; border-radius: 50%; animation: spin 0.65s linear infinite; display: none; }
.btn-run.loading .spinner  { display: inline-block; }
.btn-run.loading .run-icon { display: none; }

/* Hamburger */
.hamburger {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; cursor: pointer; transition: all 0.18s; flex-shrink: 0;
}
.hamburger:hover { border-color: var(--accent); background: var(--accent-dim); }
.hamburger span {
  display: block; width: 16px; height: 1.5px;
  background: var(--muted); border-radius: 2px;
  transition: all 0.25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); background: var(--accent); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); background: var(--accent); }
[data-theme="light"] .hamburger { background: var(--surface); }

/* ══════════════════════════════
   DRAWER
══════════════════════════════ */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 300;
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  z-index: 400; padding: 0 16px 16px;
  transform: translateY(-110%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.drawer.open { transform: translateY(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.drawer-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 14px; color: var(--text); }
.drawer-close {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--panel); border: 1px solid var(--border2);
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.drawer-close:hover { border-color: var(--red); color: var(--red); }

.drawer-section { margin-bottom: 14px; }
.drawer-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border2);
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 12px; cursor: pointer; transition: all 0.15s;
  text-align: left;
}
.drawer-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.drawer-btn svg { flex-shrink: 0; color: var(--muted); }
.drawer-btn:hover svg { color: var(--accent); }
[data-theme="light"] .drawer-btn { background: var(--bg); }

/* ══════════════════════════════
   WORKSPACE
══════════════════════════════ */
.workspace {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: calc(100vh - var(--nav-h));
}

/* Toolbar */
.toolbar {
  height: var(--toolbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 8px; gap: 4px;
  overflow: hidden; flex-shrink: 0;
}
.tabs-scroll {
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--muted);
  border: 1px solid transparent; white-space: nowrap; transition: all 0.15s;
  background: transparent; font-family: 'JetBrains Mono', monospace; flex-shrink: 0;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab.active { color: var(--text); background: var(--panel); border-color: var(--border2); }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.tab-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.tab-close {
  width: 16px; height: 16px; border-radius: 3px; border: none;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center;
  padding: 0; transition: all 0.15s; flex-shrink: 0;
}
.tab-close:hover { background: var(--border2); color: var(--red); }
.tab-add-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border2);
  background: var(--panel); color: var(--muted); cursor: pointer;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0; font-family: 'JetBrains Mono', monospace;
}
.tab-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
[data-theme="light"] .tab.active { background: var(--bg); }
[data-theme="light"] .tab-add-btn { background: var(--surface); }

.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.font-ctrl { display: flex; align-items: center; gap: 4px; }
.font-btn {
  width: 26px; height: 26px; border-radius: 5px;
  border: 1px solid var(--border2); background: var(--panel);
  color: var(--muted); cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-family: 'JetBrains Mono', monospace;
}
.font-btn:hover { color: var(--text); border-color: var(--accent); }
[data-theme="light"] .font-btn { background: var(--surface); }
.font-size-label { font-size: 11px; color: var(--muted); min-width: 24px; text-align: center; }

/* Panes */
.panes { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-editor { flex: 1; }

.resizer {
  width: 4px; background: var(--border); cursor: col-resize;
  flex-shrink: 0; transition: background 0.15s; position: relative;
}
.resizer:hover, .resizer.dragging { background: var(--accent); }
.resizer::after { content: ''; position: absolute; inset: 0; width: 14px; left: -5px; }

.pane-output { width: 42%; min-width: 220px; max-width: 72%; }

.pane-header {
  height: 36px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 14px; gap: 10px; flex-shrink: 0;
}
.pane-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
.pane-title span { color: var(--accent); }
.pane-actions { margin-left: auto; display: flex; gap: 6px; }
#editor-container { flex: 1; min-height: 0; }

/* Output */
.output-wrap { flex: 1; min-height: 0; position: relative; overflow: hidden; background: var(--bg); }
#preview-frame { width: 100%; height: 100%; border: none; background: white; display: none; }
#output-console {
  width: 100%; height: 100%; overflow-y: auto; padding: 16px;
  font-size: 13px; line-height: 1.75; scrollbar-width: thin; scrollbar-color: var(--border2) transparent;
}
#output-console::-webkit-scrollbar { width: 4px; }
#output-console::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.output-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 10px; user-select: none; }
.idle-icon { width: 36px; height: 36px; opacity: 0.14; color: var(--muted); }
.output-idle p { font-size: 12px; color: var(--muted); }
.idle-hint { font-size: 10px !important; opacity: 0.5; margin-top: 2px; }

.out-line { margin-bottom: 2px; word-break: break-all; }
.out-stdout { color: #bbf7d0; }
.out-stderr { color: #fca5a5; }
.out-info   { color: var(--muted); font-style: italic; }
[data-theme="light"] .out-stdout { color: #166534; }
[data-theme="light"] .out-stderr { color: #991b1b; }

.exec-meta {
  margin-top: 14px; padding: 12px 16px; background: var(--panel);
  border: 1px solid var(--border2); border-left: 3px solid var(--accent);
  border-radius: 8px; display: flex; flex-wrap: wrap; gap: 20px;
  font-size: 11px; color: var(--muted);
}
[data-theme="light"] .exec-meta { background: var(--panel); }
.exec-meta .meta-item { display: flex; flex-direction: column; gap: 3px; }
.exec-meta .meta-val { color: var(--text); font-weight: 700; font-size: 13px; }
.exec-meta .meta-val.ok  { color: var(--green); }
.exec-meta .meta-val.err { color: var(--red); }

/* Footer strip */
.footer-strip {
  height: 22px; background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; flex-shrink: 0;
}
.footer-powered {
  font-size: 9px; color: var(--muted); letter-spacing: 0.4px;
}
.footer-powered a {
  color: var(--accent); text-decoration: none; font-weight: 700;
}
.footer-powered a:hover { text-decoration: underline; }
.footer-links {
  display: flex; align-items: center; gap: 10px;
}
.footer-links a {
  display: flex; align-items: center; gap: 4px;
  font-size: 9px; color: var(--muted); text-decoration: none;
  letter-spacing: 0.3px; transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }
.footer-sep { color: var(--border2); font-size: 10px; }

/* Status bar */
.statusbar {
  height: var(--status-h); background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 14px; gap: 16px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px; color: var(--muted); flex-shrink: 0;
}
.statusbar-item { display: flex; align-items: center; gap: 5px; }
.statusbar-item svg { width: 11px; height: 11px; }
#status-lang-badge { margin-left: auto; background: var(--accent); color: #000; font-weight: 700; padding: 1px 8px; border-radius: 3px; font-size: 10px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--panel); border: 1px solid var(--border2); border-top: 2px solid var(--accent);
  border-radius: 14px; padding: 24px; width: min(480px, 92vw);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7); transform: translateY(14px); transition: transform 0.22s;
}
[data-theme="light"] .modal { background: var(--surface); }
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; margin-bottom: 8px; color: var(--text); }
.modal textarea {
  width: 100%; height: 120px; background: var(--bg); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 12px; padding: 10px; resize: vertical; outline: none;
}
[data-theme="light"] .modal textarea { background: var(--bg); color: var(--text); }
.modal textarea:focus { border-color: var(--accent); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* New tab modal input */
.modal-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 13px; padding: 10px 12px; outline: none; transition: border-color 0.2s;
}
.modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
[data-theme="light"] .modal-input { background: var(--bg); }
.newtab-lang-row {
  margin-top: 10px; padding: 8px 12px; border-radius: 7px;
  background: var(--accent-dim); border: 1px solid rgba(245,158,11,0.2);
}
.newtab-lang-label { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: 0.3px; }

/* Plain text editor */
#plain-editor {
  display: none;
  flex: 1; width: 100%; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  line-height: 1.75; padding: 16px;
  border: none; outline: none; resize: none;
  scrollbar-width: thin; scrollbar-color: var(--border2) transparent;
}
#plain-editor::-webkit-scrollbar { width: 4px; }
#plain-editor::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.plain-mode #editor-container { display: none; }
.plain-mode #plain-editor { display: block; }

/* Plain editor toggle */
.plain-toggle {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  padding: 10px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border2);
  transition: border-color 0.15s;
}
.plain-toggle:hover { border-color: var(--accent); }
.plain-toggle input { display: none; }
.plain-toggle-track {
  width: 36px; height: 20px; border-radius: 10px;
  background: var(--border2); position: relative;
  flex-shrink: 0; transition: background 0.2s;
}
.plain-toggle input:checked ~ .plain-toggle-track { background: var(--accent); }
.plain-toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.plain-toggle input:checked ~ .plain-toggle-track .plain-toggle-thumb { transform: translateX(16px); }
.plain-toggle-label { font-size: 12px; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.plain-toggle-hint { font-size: 10px; color: var(--muted); }
[data-theme="light"] .plain-toggle { background: var(--bg); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 20px; background: var(--panel);
  border: 1px solid var(--border2); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 18px; font-size: 12px; color: var(--text);
  z-index: 999; box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  transform: translateY(12px); opacity: 0; transition: all 0.22s;
  max-width: calc(100vw - 40px); pointer-events: none;
}
[data-theme="light"] .toast { background: var(--surface); }
.toast.show { transform: translateY(0); opacity: 1; }

@keyframes border-glow {
  0%   { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}
.pane-output.running { animation: border-glow 1s ease-out; }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
  .pane-output { width: 44%; }
  .lang-select-wrapper { max-width: 220px; }
}

/* Mobile — show hamburger, hide desktop nav items */
@media (max-width: 768px) {
  :root { --nav-h: 52px; }

  .nav-center { display: none; }
  .nav-right  { display: none; }
  .nav-mobile { display: flex; margin-left: auto; }

  /* Panes stack vertically */
  .panes { flex-direction: column; }
  .pane-editor { flex: none; height: 50%; }
  .resizer { width: 100%; height: 5px; cursor: row-resize; }
  .resizer::after { width: 100%; height: 16px; left: 0; top: -6px; }
  .pane-output { width: 100%; max-width: 100%; flex: 1; min-width: unset; }

  .toolbar-right .font-ctrl { display: none; }
  .tab-name { max-width: 70px; }
  .statusbar { display: none; }

  /* Drawer lang select full width */
  .drawer .lang-select-wrapper { max-width: none; }
}

/* Small mobile */
@media (max-width: 480px) {
  :root { --nav-h: 50px; }
  header { padding: 0 12px; gap: 10px; }
  .logo-icon { width: 30px; height: 30px; border-radius: 8px; }
  .logo-img  { width: 18px; height: 18px; }
  .logo-name { font-size: 14px; }
  .logo-name-code { font-size: 11px; }
  .logo-tagline { display: none; }
  .btn-run-mobile { padding: 6px 14px; font-size: 11px; }
  .drawer-actions { grid-template-columns: 1fr; }
}
