:root {
  color-scheme: dark;
  --bg: #0b0d12; --surface: #10131a; --surface-2: #151922; --surface-3: #1b202b;
  --line: #262c3a; --line-soft: #1d222d; --text: #e9ecf4; --muted: #858da0; --faint: #596174;
  --accent: #a8ff60; --accent-2: #68d7ff; --purple: #c792ea; --orange: #ffb86c;
  --red: #ff6b7a; --yellow: #f7dc6f; --sidebar: 250px; --panel: 225px;
  --status-bg: #080a0f; --status-text: #e9ecf4; --status-border: #222734;
  --status-mark-bg: #e9ecf4; --status-mark-text: #080a0f;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-code: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa; --surface: #fff; --surface-2: #f1f3f7; --surface-3: #e7ebf2;
  --line: #d3d8e3; --line-soft: #e4e7ed; --text: #202532; --muted: #667085; --faint: #9299a8;
  --accent: #4b8f18; --accent-2: #087ea4; --purple: #8b3bb4; --orange: #a45700;
  --red: #cb3345; --yellow: #8a6a00;
  --status-bg: #fff; --status-text: #202532; --status-border: #d3d8e3;
  --status-mark-bg: #202532; --status-mark-text: #fff;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 13px; }
body, button, a, input, textarea, pre, code, span, div, aside, section, header, footer {
  transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease;
}
button, input { font: inherit; } button, a { color: inherit; } button { border: 0; }
.app-shell { height: 100%; display: grid; grid-template-rows: 46px minmax(0, 1fr) 24px; }
.titlebar { display: flex; align-items: center; gap: 22px; padding: 0 12px 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; min-width: max-content; color: var(--text); text-decoration: none; font-size: 12px; font-weight: 800; letter-spacing: .11em; }
.status-brand { display: inline-grid; place-items: center; background: var(--accent); color: #10140d; font-weight: 900; }
.brand-mark { width: 26px; height: 26px; display: block; filter: drop-shadow(0 5px 9px #0005); }
.version { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 9px; letter-spacing: .03em; }
.menu { display: flex; align-items: center; gap: 3px; }
.menu button, .menu a { padding: 6px 8px; background: transparent; color: var(--muted); text-decoration: none; cursor: pointer; border-radius: 5px; }
.menu button:hover, .menu a:hover { color: var(--text); background: var(--surface-3); }
.title-actions { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.icon-button, .secondary-button, .run-button { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); cursor: pointer; }
.icon-button { width: 32px; color: var(--muted); } .secondary-button { padding: 0 12px; color: var(--text); }
.run-button { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: #12160e; background: var(--accent); font-weight: 750; }
.run-button:hover { filter: brightness(1.06); } .run-button:disabled { opacity: .55; cursor: wait; }
.run-button kbd { padding-left: 8px; border-left: 1px solid #22321855; font: 10px var(--font-code); opacity: .7; } .play { font-size: 10px; }
.ide { min-height: 0; display: grid; grid-template-columns: 44px var(--sidebar) minmax(0, 1fr); }
.activitybar { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0; background: var(--surface); border-right: 1px solid var(--line); }
.activity { width: 35px; height: 35px; display: grid; place-items: center; position: relative; background: transparent; color: var(--faint); text-decoration: none; font-size: 21px; cursor: pointer; border-radius: 6px; }
.activity:hover { background: var(--surface-3); color: var(--text); } .activity.active { color: var(--text); }
.activity.active::before { content: ""; position: absolute; left: -5px; width: 2px; height: 22px; border-radius: 2px; background: var(--accent); }
.activity-spacer { flex: 1; }
.sidebar { min-width: 0; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); }
.side-view { display: none; height: 100%; overflow: auto; } .side-view.active { display: block; }
.side-heading { height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.tiny-button { padding: 3px; color: var(--muted); background: transparent; cursor: pointer; font-size: 16px; }
.project-heading, .section-heading { height: 30px; display: flex; align-items: center; gap: 5px; padding: 0 9px; font-size: 10px; font-weight: 750; letter-spacing: .04em; }
.section-heading { margin-top: 9px; color: var(--muted); border-top: 1px solid var(--line-soft); } .chevron { color: var(--muted); font-size: 14px; }
.file-row, .example-row { width: 100%; height: 29px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 20px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; }
.file-row.active { color: var(--text); background: var(--surface-3); } .example-row:hover { color: var(--text); background: var(--surface-2); }
.file-icon { color: var(--accent); font: 800 11px var(--font-code); }
.dirty, .tab-dirty { margin-left: auto; color: var(--accent); font-size: 7px; visibility: hidden; } .dirty.visible, .tab-dirty.visible { visibility: visible; }
.sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 13px 10px; }
.sidebar-actions button { padding: 7px 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 10px; }
.sidebar-actions button:hover { color: var(--text); border-color: var(--faint); }
.reference { padding: 0 10px 20px; } .ref-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 7px 6px; border-bottom: 1px solid var(--line-soft); font: 11px var(--font-code); }
.ref-row code { color: var(--accent); } .ref-row span { color: var(--muted); }
.workbench { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(140px, 1fr) 4px var(--panel); background: var(--bg); }
.editor-group { min-height: 0; position: relative; display: grid; grid-template-rows: 34px 28px minmax(0, 1fr); }
.tabs { display: flex; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); }
.editor-tab { min-width: 155px; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); border-right: 1px solid var(--line); border-top: 1px solid transparent; }
.editor-tab.active { color: var(--text); background: var(--bg); border-top-color: var(--accent); }
.tab-action { margin: auto 8px auto auto; padding: 4px 8px; border-radius: 4px; background: transparent; color: var(--faint); cursor: pointer; font-size: 10px; }
.tab-action:hover { color: var(--text); background: var(--surface-3); }
.breadcrumbs { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--faint); border-bottom: 1px solid var(--line-soft); font: 11px var(--font-code); }
.breadcrumbs b { font-weight: 400; color: var(--faint); }
.code-surface { min-height: 0; display: grid; grid-template-columns: 53px minmax(0, 1fr); background: var(--bg); }
.line-numbers { padding: 12px 12px 30px 0; overflow: hidden; border-right: 1px solid var(--line-soft); color: var(--faint); text-align: right; white-space: pre; user-select: none; font: 13px/1.65 var(--font-code); }
.code-scroll { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#editor, .highlight { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 12px 18px 40px; border: 0; overflow: auto; tab-size: 4; white-space: pre; font: 13px/1.65 var(--font-code); letter-spacing: .01em; }
.highlight { pointer-events: none; color: var(--text); background: transparent; }
#editor { resize: none; outline: 0; background: transparent; color: transparent; caret-color: var(--accent); -webkit-text-fill-color: transparent; }
#editor::selection { background: #5975a755; -webkit-text-fill-color: transparent; }
.tok-comment { color: #667c65; font-style: italic; } .tok-string { color: var(--orange); } .tok-number { color: var(--yellow); }
.tok-keyword { color: var(--purple); font-weight: 650; } .tok-builtin { color: var(--accent-2); } .tok-bool { color: var(--accent); font-weight: 650; }
.completion-popup { position: absolute; z-index: 12; width: min(430px, calc(100% - 16px)); overflow: hidden; border: 1px solid color-mix(in srgb, var(--faint) 65%, var(--line)); border-radius: 8px; background: var(--surface-2); box-shadow: 0 14px 42px #0009, 0 0 0 1px #ffffff08; font-family: var(--font-code); }
.completion-popup[hidden] { display: none; }
.completion-list { max-height: 248px; overflow: auto; padding: 4px; }
.completion-item { width: 100%; height: 31px; display: grid; grid-template-columns: 22px minmax(90px, 1fr) auto; align-items: center; gap: 7px; padding: 0 8px; border-radius: 5px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: 12px var(--font-code); }
.completion-item.selected { background: var(--surface-3); box-shadow: inset 2px 0 var(--accent); }
.completion-icon { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; color: var(--accent-2); font-weight: 800; }
.completion-icon.keyword { color: var(--purple); } .completion-icon.value { color: var(--accent); }
.completion-icon.operator { color: var(--orange); } .completion-icon.class { color: var(--yellow); }
.completion-label { min-width: 0; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.completion-label::first-letter { color: var(--accent-2); }
.completion-detail { overflow: hidden; color: var(--faint); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.completion-help { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 9px; border-top: 1px solid var(--line); color: var(--faint); background: var(--surface); font: 9px var(--font-ui); }
.completion-help kbd { padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-3); color: var(--muted); font: 9px var(--font-code); }
.find-widget { position: absolute; z-index: 6; right: 14px; top: 42px; display: flex; align-items: center; gap: 3px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); box-shadow: 0 8px 28px #0007; }
.find-widget[hidden] { display: none; } .find-widget input { width: 210px; padding: 5px 8px; border: 1px solid var(--line); outline: 0; border-radius: 4px; background: var(--bg); color: var(--text); }
.find-widget span { min-width: 42px; color: var(--muted); text-align: center; font-size: 10px; }
.find-widget button { width: 25px; height: 25px; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; } .find-widget button:hover { color: var(--text); background: var(--surface-3); }
.resize-handle { cursor: row-resize; background: var(--line); transition: background .15s; } .resize-handle:hover, .resize-handle.dragging { background: var(--accent); }
.panel { min-height: 0; display: grid; grid-template-rows: 35px minmax(0, 1fr); background: var(--surface); } .panel.collapsed { display: none; }
.panel-tabs { display: flex; align-items: center; gap: 2px; padding: 0 9px; border-bottom: 1px solid var(--line); }
.panel-tab { align-self: stretch; padding: 0 10px; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; letter-spacing: .05em; }
.panel-tab:hover { color: var(--text); } .panel-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.badge { min-width: 17px; margin-left: 4px; padding: 1px 5px; border-radius: 8px; background: var(--surface-3); color: var(--muted); }
.badge.has-errors { color: #fff; background: var(--red); } .panel-spacer { flex: 1; }
.panel-icon { width: 28px; height: 25px; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; } .panel-icon:hover { color: var(--text); background: var(--surface-3); }
.panel-content { display: none; min-height: 0; overflow: auto; } .panel-content.active { display: block; }
#output, #pythonOutput { min-height: 100%; margin: 0; padding: 11px 14px 30px; white-space: pre-wrap; word-break: break-word; font: 12px/1.6 var(--font-code); color: var(--text); }
.welcome { color: var(--faint); } .cap { color: var(--red); } .run-label { color: var(--accent); }
#diags { padding: 7px 10px 25px; } .diag { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start; padding: 7px 9px; border-radius: 5px; cursor: pointer; font: 11px/1.4 var(--font-code); }
.diag:hover { background: var(--surface-3); } .diag-icon { color: var(--red); } .diag .msg { color: var(--text); } .diag .where { color: var(--muted); }
.ok { padding: 10px; color: var(--muted); font: 11px var(--font-code); }
.statusbar { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; border-top: 1px solid var(--status-border); background: var(--status-bg); color: var(--status-text); font-size: 10px; font-weight: 700; }
.statusbar > div, .status-right { display: flex; align-items: center; gap: 12px; }
.status-brand { width: 15px; height: 15px; margin-right: -6px; background: var(--status-mark-bg); color: var(--status-mark-text); border-radius: 3px; font-size: 9px; }
.statusbar button { padding: 2px 4px; background: transparent; color: inherit; cursor: pointer; }
.toast { position: fixed; z-index: 20; right: 18px; bottom: 38px; max-width: 340px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-3); color: var(--text); box-shadow: 0 10px 32px #0008; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s; }
.toast.show { opacity: 1; transform: none; }
.command-backdrop { position: fixed; inset: 0; z-index: 30; background: #0007; padding-top: 10vh; } .command-backdrop[hidden] { display: none; }
.command-palette { width: min(570px, calc(100% - 30px)); margin: auto; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface-2); box-shadow: 0 24px 80px #000a; }
.command-palette input { width: 100%; padding: 13px 15px; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: var(--surface); color: var(--text); font-size: 14px; }
.command-item { width: 100%; display: flex; justify-content: space-between; padding: 9px 14px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.command-item:hover, .command-item.selected { color: var(--text); background: var(--surface-3); } .command-item kbd { color: var(--faint); font: 10px var(--font-code); }
@media (prefers-reduced-motion: reduce) {
  body, button, a, input, textarea, pre, code, span, div, aside, section, header, footer { transition: none; }
}
@media (max-width: 820px) { :root { --sidebar: 210px; } .menu, .secondary-button, .run-button kbd { display: none; } }
@media (max-width: 620px) {
  .app-shell { grid-template-rows: 43px minmax(0, 1fr) 24px; } .ide { grid-template-columns: 40px minmax(0, 1fr); }
  .sidebar { position: absolute; z-index: 10; left: 40px; top: 43px; bottom: 24px; width: min(270px, calc(100vw - 40px)); transform: translateX(-110%); transition: transform .18s; box-shadow: 12px 0 35px #0009; }
  .sidebar.mobile-open { transform: none; } .workbench { grid-column: 2; } .brand .version { display: none; } .title-actions { gap: 4px; }
  .line-numbers { width: 42px; padding-right: 8px; } .code-surface { grid-template-columns: 42px minmax(0, 1fr); }
  .status-right span, #cursorStatus { display: none; }
  .completion-popup { width: calc(100% - 16px); } .completion-detail { display: none; } .completion-help { justify-content: center; } .completion-help span:last-child { display: none; }
}
