/* The playground workbench. The interface has one light and one dark palette of its own, in the
   manner of VS Code, Sublime Text, the JetBrains IDEs and Xcode; the code theme chosen with the
   dots colors only the code (--code-* variables set by app.js). The sidebar, the editor and the
   console are separate surfaces floating on the window background. */

/* ____ Tokens */

:root {
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: Menlo, Monaco, "Courier New", monospace;
  --serif: "New York", "Iowan Old Style", "Charter", "Palatino Linotype", Georgia, serif;
  --code-size: 13px;
  --code-line: 20px;
  --island: 10px;
  --gap: 6px;
  --selection: color-mix(in srgb, var(--accent) 30%, transparent);
  --project-outline: color-mix(in srgb, var(--fg) 8%, transparent);
  --project-top-gap: 5px;
  --project-bottom-gap: 10px;
  --code-current: color-mix(in srgb, var(--code-fg) 4.5%, transparent);
}

:root[data-mode="dark"] {
  color-scheme: dark;
  --window: #101113;
  --tile: #2a2d36;                                                              /* the palette's cool grey, one step up */
  --side: #1c1d21;
  --surface: #1c1d21;
  --panel: #18191c;
  --raised: #2a2c31;
  --field: #141518;
  --fg: #e2e4e8;
  --muted: #a0a4ac;
  --faint: #6c7079;
  --border: rgba(255, 255, 255, .065);
  --border-strong: rgba(255, 255, 255, .12);
  --hover: rgba(255, 255, 255, .055);
  --press: rgba(255, 255, 255, .09);
  --accent: #0a84ff;                                                            /* the macOS and Xcode system blue */
  --on-accent: #fff;
  --accent-soft: rgba(10, 132, 255, .22);
  --accent-faint: rgba(10, 132, 255, .1);
  --folder: #5aa9f7;
  --markdown: #6cb0f5;
  --function: #c3a1f2;
  --error: #f1707b;
  --warning: #e5b567;
  --success: #6fc68f;
  --shadow: 0 18px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .08);
  --shadow-small: 0 6px 18px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .07);
}

:root[data-mode="light"] {
  color-scheme: light;
  --window: #e3e5ea;
  --tile: #d3d8e2;
  --side: #f6f7f9;
  --surface: #f6f7f9;
  --panel: #fafafb;
  --raised: #ffffff;
  --field: #ffffff;
  --fg: #1f2328;
  --muted: #5a6069;
  --faint: #8d939c;
  --border: rgba(20, 25, 35, .09);
  --border-strong: rgba(20, 25, 35, .16);
  --hover: rgba(20, 25, 35, .05);
  --press: rgba(20, 25, 35, .09);
  --accent: #007aff;
  --on-accent: #fff;
  --accent-soft: rgba(0, 122, 255, .14);
  --accent-faint: rgba(0, 122, 255, .07);
  --folder: #5aa9f7;                                                            /* icons keep the colors of dark mode */
  --markdown: #1f6feb;
  --function: #8250df;
  --error: #cf222e;
  --warning: #9a6700;
  --success: #1a7f37;
  --shadow: 0 18px 48px rgba(15, 20, 30, .18), 0 2px 8px rgba(15, 20, 30, .08), 0 0 0 1px rgba(15, 20, 30, .08);
  --shadow-small: 0 6px 18px rgba(15, 20, 30, .12), 0 0 0 1px rgba(15, 20, 30, .08);
}

/* ____ Base */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--window); color: var(--fg);
  font: 13px/1.4 var(--ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.icon { display: inline-flex; align-items: center; justify-content: center; }
.icon svg, .tool svg { display: block; }
kbd {
  font: 11px/1 var(--ui); padding: 3px 6px; border-radius: 4px; color: var(--muted);
  background: var(--hover); box-shadow: inset 0 -1px 0 var(--border);
}
mark { background: none; color: var(--accent); font-weight: 700; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--faint) 45%, transparent); border-radius: 10px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--faint) 70%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--faint) 50%, transparent) transparent; }

.app { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 46px minmax(0, 1fr) 26px; height: 100vh; }

/* Shared small controls. */
.tool {
  width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); transition: background .12s, color .12s;
}
.tool:hover { background: var(--hover); color: var(--fg); }
.tool:active { background: var(--press); }
.tool.on { color: var(--accent); }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 16px; padding: 0 5px;
  border-radius: 8px; font-size: 10.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent);
}
.button {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px; border-radius: 7px; font-weight: 500;
  transition: background .12s, box-shadow .12s, filter .12s;
}
.button svg { width: 15px; height: 15px; }
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover { filter: brightness(1.08); }
.button.secondary { background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.button.secondary:hover { background: var(--press); }
.button.danger { background: var(--error); color: #fff; }
.button.danger:hover { filter: brightness(1.08); }
.button.danger-outline { color: var(--error); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--error) 45%, transparent); }
.button.danger-outline:hover { background: color-mix(in srgb, var(--error) 10%, transparent); }
.button:focus-visible, .tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* File badges in the tree, the tabs, the quick pick and the problems. */
.file-badge {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 16px;
  margin-right: 6px; border-radius: 4px; font: 700 8.5px/1 var(--ui); letter-spacing: .02em;
}
.file-badge svg { width: 14px; height: 14px; }
.badge-ec { color: var(--accent); background: var(--accent-soft); font-family: var(--serif); font-size: 10px; font-weight: 700; letter-spacing: 0; }
.badge-md { color: var(--markdown); background: color-mix(in srgb, var(--markdown) 15%, transparent); }
.badge-txt, .badge-other { color: var(--faint); }
.badge-svg { background: #287c92; color: #fff; }
.file-badge.file-page { width: 16px; height: 16px; border-radius: 0; background: none; }
.file-page svg { width: 16px; height: 16px; filter: drop-shadow(0 .5px .5px rgba(0, 0, 0, .18)); }
.tree-row.selected .file-badge.file-page { background: none; }
.file-flat svg { filter: none; }

/* Project artwork shares fixed icon boxes; failed images reveal their fallback. */
.project-art { display: inline-flex; width: 16px; height: 16px; flex: none; align-items: center; justify-content: center; }
.project-art-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.project-art-color { display: none; width: 100%; height: 100%; background: currentColor; -webkit-mask: var(--project-icon) center / contain no-repeat; mask: var(--project-icon) center / contain no-repeat; }
.project-art-tinted:not(.project-art-failed) > .project-art-image { display: none; }
.project-art-tinted:not(.project-art-failed) > .project-art-color { display: block; }
.project-art-fallback, .project-art-failed .project-art-image { display: none; }
.project-art-failed .project-art-fallback { display: inline-flex; }
.app-view-mark .project-art { width: 17px; height: 17px; }

/* ____ Title bar: brand, run configuration, activity pill, theme dots */

/* The title bar shares the columns below it: the logo is centered over the activity bar, so the
   run configuration starts exactly at the left edge of the sidebar. */
.titlebar { position: relative; display: flex; align-items: center; padding: 0 12px 0 0; background: var(--window); }
.brand { display: flex; align-items: center; justify-content: center; min-width: 0;
  color: var(--fg); flex: none; width: var(--brand-width, 48px); }
.brand > .brand-logo { display: block; height: 27px; width: 27px; }

.run-group { display: flex; align-items: center; gap: 4px; }

/* Run and Stop at the top right. Run is the one filled, green control of the window: the action
   the page exists for. Stop is a plain icon, enabled only while a program runs. */
.title-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.title-separator { width: 1px; height: 18px; margin: 0 4px; background: var(--border-strong); }
.run-button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 14px 0 11px; border-radius: 999px;
  font-weight: 600; color: #fff; background: linear-gradient(180deg, #34c759, #28a745);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: filter .12s, transform .06s;
}
.run-button svg { width: 13px; height: 13px; }
.run-button:hover { filter: brightness(1.07); }
.run-button:active { transform: translateY(.5px); filter: brightness(.95); }
.run-button.busy { animation: pulse 1s ease-in-out infinite; }
.run-button.warm-ready:not(.busy) { animation: compiler-ready 800ms ease-out; }
@keyframes compiler-ready {
  0%, 48%, 100% { box-shadow: 0 0 0 0 rgb(52 199 100 / 0); filter: brightness(1); }
  20%, 68% { box-shadow: 0 0 7px 2px rgb(52 199 100 / .7), 0 0 13px 2px rgb(52 199 100 / .35); filter: brightness(1.22); }
}
@media (prefers-reduced-motion: reduce) {
  .run-button.warm-ready:not(.busy) { animation: none; }
}
.stop-button {
  width: 30px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--error); transition: background .12s, opacity .12s;
}
.stop-button svg { width: 24px; height: 24px; }
.stop-button:not(:disabled):hover { background: var(--hover); }
.stop-button:disabled { color: var(--faint); opacity: .45; cursor: default; }
@keyframes pulse { 50% { opacity: .55; } }

.run-configuration {
  display: flex; align-items: center; height: 28px; border-radius: 7px;
  background: var(--hover); box-shadow: inset 0 0 0 1px var(--border);
}
.scheme { display: flex; align-items: center; height: 100%; padding: 0 8px 0 7px; border-radius: 7px 0 0 7px; font-weight: 500; white-space: nowrap; }
#scheme-icon { display: inline-flex; margin-right: 6px; }
#scheme-icon .folder-icon { margin-right: 0; }
.scheme.has-project { color: var(--folder); }
.scheme .chevron { margin-left: 4px; color: var(--faint); }
.scheme .chevron svg { width: 12px; height: 12px; }
.scheme:hover { background: var(--hover); }
.args { display: flex; align-items: center; height: 100%; border-left: 1px solid var(--border); }
.args input {
  width: 170px; height: 100%; padding: 0 10px; border: 0; outline: 0; background: transparent;
  font: 12px var(--mono); color: var(--fg); border-radius: 0 7px 7px 0;
}
.args input::placeholder { color: var(--faint); font-family: var(--ui); }
.args input:focus { background: var(--field); box-shadow: inset 0 0 0 1px var(--accent); }

.activity-pill {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; width: min(440px, 32vw); height: 28px; padding: 0 12px;
  border-radius: 999px; background: var(--side); box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted); font-size: 12px; transition: box-shadow .15s;
}
.activity-pill:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.pill-project { font-weight: 600; color: var(--fg); white-space: nowrap; }
.pill-separator { width: 1px; height: 14px; background: var(--border-strong); }
.pill-status { display: flex; align-items: center; gap: 7px; min-width: 0; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-state { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--faint); }
.pill-state.busy { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.pill-state.success { background: var(--success); }
.pill-state.error { background: var(--error); }

/* The code theme dots sit at the bottom right of the editor, as on the code boxes of the manual:
   faint until hovered, ringed in the color of the surface they float on. */
.dots { display: flex; align-items: center; gap: 8px; }
.editor-dots {
  position: absolute; right: 24px; bottom: 16px; z-index: 6; --ring: var(--code-bg);
  opacity: .8; transition: opacity .15s;
}
.editor-dots:hover { opacity: 1; }
.editor-group.showing-page .editor-dots { --ring: var(--panel); }
.dot {
  width: 14px; height: 14px; padding: 0; border-radius: 50%; background: var(--dot); flex: none;
  box-shadow: inset 0 0 0 3px var(--dot-bg), 0 0 0 1px var(--border-strong);
  transition: transform .12s, box-shadow .12s;
}
.dot:hover { transform: scale(1.25); }
.dot.on { box-shadow: inset 0 0 0 3px var(--dot-bg), 0 0 0 2px var(--ring, var(--window)), 0 0 0 3.5px var(--muted); }
.dot.static { display: inline-block; cursor: default; }
.mode-toggle {
  width: 24px; height: 24px; border-radius: 6px; font-size: 15px; line-height: 1; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.mode-toggle:hover { background: var(--hover); color: var(--fg); }

/* ____ Workbench: activity bar, islands, sashes */

.workbench { display: flex; min-width: 0; min-height: 0; padding: 0 var(--gap) 0 0; }
.activitybar { flex: none; width: 48px; display: flex; flex-direction: column; align-items: center; padding: 2px 0 6px; }
.activity {
  position: relative; width: 36px; height: 36px; margin-bottom: 4px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--faint); cursor: pointer; transition: color .12s, background .12s;
}
.activity svg { width: 20px; height: 20px; stroke-width: 1.2; }
.activity:hover { color: var(--fg); background: var(--hover); }
.activity.active { color: var(--accent); background: var(--tile); }           /* blue icon on a cool grey tile */
.activity-spacer { flex: 1; }

/* Every surface is an island: rounded, bordered, separated from the next by the window color. */
.sidebar, .editor-group, .panel {
  border-radius: var(--island); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, .06); overflow: hidden;
}
.sidebar { flex: none; display: flex; flex-direction: column; min-width: 0; background: var(--side); }
.view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.view-header { display: flex; align-items: center; height: 40px; padding: 0 8px 0 16px; flex: none; }
.view-title { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.view-actions { display: flex; gap: 1px; margin-left: auto; opacity: 0; transition: opacity .15s; }
.sidebar:hover .view-actions, .view-actions:focus-within { opacity: 1; }
.view-actions .tool svg { width: 15px; height: 15px; }

/* Sashes are the gaps between islands; a line appears on hover. */
.sash { flex: none; position: relative; z-index: 20; }
.sash::after { content: ""; position: absolute; border-radius: 2px; transition: background .15s .1s; }
.sash.vertical { width: var(--gap); cursor: col-resize; }
.sash.vertical::after { top: 30%; bottom: 30%; left: calc(50% - 1px); width: 2px; }
#panel-sash { height: var(--gap); cursor: row-resize; }
#panel-sash::after { left: 30%; right: 30%; top: calc(50% - 1px); height: 2px; }
.main.panel-right > #panel-sash { width: var(--gap); height: auto; cursor: col-resize; }
.main.panel-right > #panel-sash::after { left: calc(50% - 1px); right: auto; width: 2px; top: 30%; bottom: 30%; height: auto; }
.sash:hover::after, .sash.active::after { background: var(--accent); }
body.resizing-x { cursor: col-resize; }
body.resizing-y { cursor: row-resize; }
body.resizing * { pointer-events: none; }

/* ____ Explorer */

.tree { flex: 1; overflow: auto; padding: 0 0 12px; outline: none; }
.tree.drop-root { background: var(--accent-faint); }
.tree-row {
  position: relative; display: flex; align-items: center; height: 24px; margin: 0 8px; border-radius: 6px;
  padding-left: calc(6px + var(--depth) * 14px); padding-right: 8px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tree-row:hover { background: var(--hover); color: var(--fg); }
.tree-row.active { color: var(--fg); }
/* Joined left edges form a bracket without changing the flat tree geometry. */
.tree-row.in-project::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px;
  box-sizing: border-box; pointer-events: none;
  border: solid var(--project-outline); border-width: 0 0 0 1px;
}
.tree-row.current-project::before {
  top: calc(0px - var(--project-top-gap)); border-top-width: 1px; border-radius: 6px 0 0 0;
}
.tree-row.project-end::before {
  bottom: calc(0px - var(--project-bottom-gap)); border-bottom-width: 1px;
  border-bottom-left-radius: 6px;
}
.tree-row.current-project { margin-top: var(--project-top-gap); }
.tree-row.project-end { margin-bottom: var(--project-bottom-gap); }
.tree-row.current-project > .twistie { color: var(--folder); }
/* The selected row is solid system blue with white content, as in the Xcode navigator. */
.tree-row.selected, .tree-row.selected:hover { background: var(--accent); color: #fff; border-radius: 6px; }
.tree-row.selected > .tree-name { color: #fff; }
.tree-row.selected .twistie, .tree-row.selected .folder-icon, .tree-row.selected .row-action { color: #fff; }
.tree-row.selected .file-badge { color: #fff; background: rgba(255, 255, 255, .22); }
.tree-row.selected .tree-tag { color: #fff; background: rgba(255, 255, 255, .22); }
.tree-row.selected .row-action:hover { background: rgba(255, 255, 255, .2); }
.tree-row.project > .tree-name { font-weight: 600; color: var(--fg); }
.tree-row.current-project > .tree-name {
  font-weight: 700; color: var(--folder);
}
.tree-row.current-project.selected, .tree-row.current-project.selected:hover { background: var(--hover); color: var(--folder); }
.tree-row.current-project.selected > .tree-name,
.tree-row.current-project.selected > .folder-icon,
.tree-row.current-project.selected > .twistie { color: var(--folder); }
.tree-row.current-project.selected > .tree-tag { color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent); }
.tree-row.dragging { opacity: .45; }
.tree-row.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.indent-guides {
  position: absolute; left: 13px; top: 0; bottom: 0; width: calc(var(--depth) * 14px); pointer-events: none;
  background: repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px 14px);
}
.twistie { flex: none; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); }
.twistie svg { width: 12px; height: 12px; stroke-width: 1.6; }
.folder-icon { flex: none; display: inline-flex; margin-right: 6px; color: var(--folder); }
.folder-icon svg { width: 16px; height: 16px; }
/* Siblings share the arrow slot and icon column, including file badge styles. */
.tree-row > .file-badge { width: 16px; }
.tree-name { overflow: hidden; text-overflow: ellipsis; }
.tree-tag {
  margin-left: auto; padding: 1px 6px; border-radius: 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent);
}
.row-actions { display: none; gap: 1px; margin-left: auto; }
.tree-tag + .row-actions { margin-left: 6px; }
.tree-row:hover .row-actions { display: flex; }
.tree-row:hover .tree-tag { display: none; }
.tree-row:hover .tree-tag + .row-actions { margin-left: auto; }
.row-action { width: 20px; height: 20px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.row-action:hover { background: var(--press); color: var(--fg); }
.row-action svg { width: 14px; height: 14px; }
.tree-row.editing { background: var(--hover); cursor: default; }
.tree-input {
  flex: 1; min-width: 0; height: 20px; padding: 0 5px; border: 0; border-radius: 4px; outline: 0;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--accent); font-size: 13px; user-select: text;
}
.tree-row.invalid .tree-input { box-shadow: inset 0 0 0 1px var(--error); }
.tree-error {
  position: absolute; left: calc(40px + var(--depth) * 14px); right: 4px; top: 25px; z-index: 5; padding: 6px 8px; border-radius: 6px;
  font-size: 12px; white-space: normal; color: var(--fg); background: color-mix(in srgb, var(--error) 20%, var(--raised)); box-shadow: var(--shadow-small);
}
.tree-empty { padding: 16px 22px; color: var(--muted); line-height: 1.6; }
.link { color: var(--accent); display: block; margin-top: 4px; }
.link:hover { text-decoration: underline; }

/* ____ Settings view */

.settings { flex: 1; overflow: auto; padding: 0 16px 24px; }
.setting { padding: 12px 0 16px; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting-title { font-weight: 600; margin-bottom: 8px; }
.setting-note { margin: -4px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.segmented { display: inline-flex; max-width: 100%; align-items: stretch; padding: 2px; border-radius: 7px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.segmented button { flex: 1 1 auto; min-width: 0; min-height: 24px; padding: 3px 12px; border-radius: 5px; color: var(--muted); font-weight: 500; line-height: 18px; }
.segmented button.on { background: var(--raised); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 0 0 1px var(--border); }
.theme-options { display: grid; grid-template-columns: 1fr; gap: 2px; }
.theme-option { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: 6px; text-align: left; color: var(--muted); }
.theme-option:hover { background: var(--hover); color: var(--fg); }
.theme-option.on { background: var(--accent-soft); color: var(--fg); }
.theme-swatch {
  display: inline-flex; align-items: center; gap: 3px; width: 44px; height: 20px; padding: 0 6px; border-radius: 4px;
  background: var(--theme-bg); box-shadow: inset 0 0 0 1px var(--border-strong);
}
.theme-swatch i { width: 5px; height: 5px; border-radius: 50%; background: var(--dot); }
.theme-swatch i:nth-child(2) { width: 12px; border-radius: 3px; background: var(--theme-fg); opacity: .7; }
.theme-swatch i:nth-child(3) { width: 6px; border-radius: 3px; background: var(--theme-fg); opacity: .35; }
.stepper { display: inline-flex; align-items: center; border-radius: 7px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.stepper button { width: 30px; height: 26px; font-size: 15px; color: var(--muted); border-radius: 7px; }
.stepper button:hover { color: var(--fg); background: var(--hover); }
.stepper span { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.setting-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ____ Editor island: tabs, breadcrumbs, editors, viewers, welcome */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main.panel-right { flex-direction: row; }
.editor-group { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--code-bg); }
.main.panel-maximized .editor-group, .main.panel-maximized #panel-sash { display: none; }
.main.panel-maximized .panel { flex: 1; height: auto !important; width: auto !important; }
.main.panel-hidden .panel, .main.panel-hidden #panel-sash { display: none; }

.tabs-bar { --tab-height: 30px; display: flex; min-width: 0; height: var(--tab-height); flex: none; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: flex; align-items: center; flex: none; height: var(--tab-height); max-width: 240px; padding: 0 6px 0 12px;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab + .tab::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--border); }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); background: var(--code-bg); box-shadow: 1px 0 0 var(--border), -1px 0 0 var(--border); z-index: 1; }
.tab.active::before, .tab.active + .tab::before { display: none; }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.tab.active { color: var(--code-fg); }
.tab.active .tab-detail { color: color-mix(in srgb, var(--code-fg) 50%, var(--code-bg)); }
.tab-name { overflow: hidden; text-overflow: ellipsis; }
.tab.has-problems .tab-name { color: var(--error); }
.tab-detail { margin-left: 6px; font-size: 11.5px; color: var(--faint); }
.tab-close {
  width: 20px; height: 20px; margin-left: 6px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center;
  color: inherit; opacity: 0;
}
.tab-close svg { width: 12px; height: 12px; stroke-width: 1.5; }
.tab:hover .tab-close, .tab.active .tab-close { opacity: .7; }
.tab-close:hover { opacity: 1 !important; background: color-mix(in srgb, currentColor 14%, transparent); }
.tab-actions { display: flex; align-items: center; gap: 2px; padding: 0 8px; flex: none; }
.tab-actions .tool svg { width: 15px; height: 15px; }

.breadcrumbs {
  display: flex; align-items: center; gap: 1px; height: 28px; padding: 0 14px; flex: none; overflow: hidden; white-space: nowrap;
  font-size: 12px; color: color-mix(in srgb, var(--code-fg) 55%, var(--code-bg)); background: var(--code-bg);
}
.crumb { display: inline-flex; align-items: center; padding: 1px 3px; border-radius: 4px; }
.crumb.file { color: var(--code-fg); }
.crumb .file-badge { transform: scale(.88); margin-right: 4px; }
.crumb-separator { display: inline-flex; opacity: .6; }
.crumb-separator svg { width: 11px; height: 11px; }
.symbol-kind {
  display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-right: 5px; border-radius: 3px;
  font: italic 600 10px/1 var(--serif); color: var(--function); background: color-mix(in srgb, var(--function) 16%, transparent);
}
.symbol-kind.struct, .symbol-kind.union, .symbol-kind.type { color: var(--folder); background: color-mix(in srgb, var(--folder) 16%, transparent); font-style: normal; }

/* A Markdown preview or the welcome page is a page of the interface, not code: the active tab and
   the breadcrumbs take the page color so that they continue into it. */
.editor-group.showing-page { background: var(--panel); }
.editor-group.showing-page .tab.active { background: var(--panel); color: var(--fg); }
.editor-group.showing-page .tab.active .tab-detail { color: var(--faint); }
.editor-group.showing-page .breadcrumbs { background: var(--panel); color: var(--muted); }
.editor-group.showing-page .crumb.file { color: var(--fg); }

.editor-host { position: relative; flex: 1; min-height: 0; }
.tab-view { position: absolute; inset: 0; }
.tab-view.previewing .code-editor { display: none; }
.tab-view:not(.previewing) .markdown-view { display: none; }
.tab-view:not(.previewing) .svg-view { display: none; }
.svg-view { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--panel); }
.svg-view-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.svg-view-toolbar > span { margin-right: 8px; color: var(--muted); font-size: 12px; }
.svg-view-toolbar button { padding: 5px 10px; border-radius: 5px; color: var(--muted); }
.svg-view-toolbar button:hover { background: var(--hover); color: var(--fg); }
.svg-view-toolbar button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.svg-view-stage { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 32px; background: repeating-conic-gradient(#24262b 0 25%, #2d3036 0 50%) 0 0 / 24px 24px; }
.svg-view-stage[data-background="dark"] { background: #111316; }
.svg-view-stage[data-background="light"] { background: #f0f1f4; }
.svg-view-image { width: min(360px, 80%); height: 360px; max-height: 80%; object-fit: contain; }
.svg-view-message { max-width: 420px; padding: 14px 18px; border-radius: 8px; background: var(--panel); color: var(--fg); text-align: center; }
.svg-view [hidden] { display: none; }

/* The code editor: colored by the code theme only. */
.code-editor { position: absolute; inset: 0; background: var(--code-bg); color: var(--code-fg); }
.code-scroller { position: absolute; inset: 0 0 7px; overflow: auto; scroll-padding-bottom: 8px; }
.code-scroller::-webkit-scrollbar-thumb { background-color: color-mix(in srgb, var(--code-fg) 18%, transparent); }
.code-sizer { display: flex; min-width: 100%; width: max-content; padding-top: 2px; }
.code-gutter {
  position: sticky; left: 0; z-index: 4; flex: none; padding: 0 18px 0 14px; text-align: right;
  min-width: calc(var(--digits, 3) * 1ch + 32px + 10px);
  font: 400 var(--code-size)/var(--code-line) var(--mono); color: var(--code-number); background: var(--code-bg);
  font-variant-numeric: tabular-nums; cursor: default;
}
.code-editor.scrolled-x .code-gutter { box-shadow: 6px 0 8px -6px rgba(0, 0, 0, .35); }
.line-number { position: relative; height: var(--code-line); }
.line-number.active { color: var(--code-fg); }
.line-number.has-error::before, .line-number.has-warning::before {
  content: ""; position: absolute; left: -6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--error);
}
.line-number.has-warning::before { background: var(--warning); }
.code-content {
  position: relative; flex: 1; min-width: 0;
  font: 500 var(--code-size)/var(--code-line) var(--mono); font-variant-ligatures: none; font-kerning: none; tab-size: 4;
  letter-spacing: 0; word-spacing: 0;
}
.code-probe { position: absolute; visibility: hidden; white-space: pre; }
.code-caret-probe { left: 0; top: 0; width: max-content; }
.code-caret { position: absolute; z-index: 3; width: 2px; pointer-events: none; background: var(--code-caret); }
.code-caret:not(.hidden) { animation: caret-blink 1.1s step-end infinite; }
@keyframes caret-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .code-caret:not(.hidden) { animation: none; } }
.code-layer { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.code-current { background: var(--code-current); left: -1px; }
.code-editor:not(:focus-within) .code-current { background: transparent; }
.code-guides > div {
  width: 0; height: var(--code-line); max-width: 100%;
  background: repeating-linear-gradient(to right, color-mix(in srgb, var(--code-guide) 55%, transparent) 0 1px, transparent 1px 4ch);
}
.code-rulers { bottom: 0; }
.ruler { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--code-fg) 3%, transparent); }
.ruler-limit { background: color-mix(in srgb, var(--code-fg) 5%, transparent); }
:root.no-rulers .code-rulers { display: none; }
.match { position: absolute; height: var(--code-line); border-radius: 2px; background: color-mix(in srgb, var(--warning) 22%, transparent); }
.match.current { background: color-mix(in srgb, var(--warning) 42%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 70%, transparent); }
.code-text { position: relative; z-index: 1; margin: 0; padding: 0 80px 0 0; font: inherit; white-space: pre; color: var(--code-fg); pointer-events: none; }
.code-diagnostics { z-index: 1; }
.squiggle {
  position: absolute; height: var(--code-line); white-space: pre; color: transparent;
  text-decoration: underline wavy var(--error); text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-skip-ink: none;
}
.squiggle.warning { text-decoration-color: var(--warning); }
.code-input {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; outline: 0; resize: none;
  background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent;
  font: inherit; letter-spacing: inherit; white-space: pre; overflow: hidden; tab-size: 4; user-select: text; -webkit-user-select: text;
  font-kerning: none; font-variant-ligatures: none; word-spacing: 0; text-indent: 0;
}
.code-editor.composing .code-input { caret-color: var(--code-caret); }
.code-editor:not(:has(.code-input:focus)) .code-completion { display: none; }
.code-input::selection { background: color-mix(in srgb, var(--code-caret) 26%, transparent); color: transparent; -webkit-text-fill-color: transparent; }

.find-widget {
  position: absolute; top: 6px; right: 22px; z-index: 10; display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 4px 0 6px;
  border-radius: 8px; background: var(--raised); color: var(--fg); box-shadow: var(--shadow-small);
}
.find-input {
  width: 220px; height: 24px; padding: 0 8px; border: 0; border-radius: 5px; outline: 0; user-select: text;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--border-strong); font-size: 12.5px;
}
.find-input:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.find-widget.no-results .find-input { box-shadow: inset 0 0 0 1px var(--error); }
.find-count { min-width: 74px; padding: 0 6px; font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.find-widget.no-results .find-count { color: var(--error); }
.find-previous svg { transform: rotate(-90deg); }
.find-next svg { transform: rotate(90deg); }
.find-widget .tool { width: 24px; height: 24px; }
.find-widget .tool svg { width: 14px; height: 14px; }

.code-hover {
  position: absolute; z-index: 12; max-width: 520px; padding: 8px 10px; border-radius: 7px; pointer-events: none;
  background: var(--raised); color: var(--fg); box-shadow: var(--shadow-small); font-size: 12.5px; line-height: 1.45;
}
.hover-message { display: flex; gap: 7px; align-items: flex-start; }
.hover-message .icon { flex: none; margin-top: 1px; }
.hover-code { margin-top: 3px; padding-left: 23px; font: 11.5px var(--mono); color: var(--faint); }
.icon.error { color: var(--error); }
.icon.warning { color: var(--warning); }

/* The Markdown viewer: a page in the type of the documentation; code blocks take the code theme. */
.markdown-view { position: absolute; inset: 0; overflow: auto; background: var(--panel); color: var(--fg); user-select: text; -webkit-user-select: text; }
.markdown-body { max-width: 780px; margin: 0 auto; padding: 34px 48px 80px; font: 16px/1.7 var(--serif); }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.markdown-body h1 { font-size: 2.05em; margin: .2em 0 .7em; }
.markdown-body h2 { font-size: 1.45em; margin: 1.7em 0 .6em; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 1.18em; margin: 1.5em 0 .5em; }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin: 0 0 1em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; }
.markdown-body li { margin: .25em 0; }
.markdown-body a { color: var(--accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; text-underline-offset: 3px; }
.markdown-body code { font: 500 .82em var(--mono); padding: .12em .38em; border-radius: 4px; background: var(--hover); }
.markdown-body pre.md-code {
  position: relative; margin: 1.1em 0 1.4em; padding: 14px 18px; border-radius: 9px; overflow: auto;
  background: var(--code-bg); color: var(--code-fg); box-shadow: inset 0 0 0 1px var(--border);
  font: 500 13px/1.45 var(--mono);
}
.markdown-body pre.md-code code { font: inherit; padding: 0; background: none; }
.markdown-body pre.md-code::after {
  content: attr(data-language); position: absolute; top: 8px; right: 12px; font: 600 10px var(--ui); text-transform: uppercase; letter-spacing: .06em;
  color: color-mix(in srgb, var(--code-fg) 45%, var(--code-bg));
}
.markdown-body blockquote { margin: 0 0 1em; padding: .2em 1em; border-left: 3px solid var(--accent-soft); color: var(--muted); }
.markdown-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.md-table { overflow-x: auto; margin: 0 0 1.3em; }
.markdown-body table { border-collapse: collapse; width: 100%; font: 14px/1.5 var(--ui); }
.markdown-body th { text-align: left; font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--border-strong); }
.markdown-body td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.markdown-body img { max-width: 100%; }

/* Empty editor; welcome.md is a separate document tab. */
.welcome { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; background: var(--panel); color: var(--muted); }

/* ____ Panel island: console and problems */

.panel { flex: none; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); }
.panel-header { display: flex; align-items: center; height: 36px; padding: 0 8px 0 10px; flex: none; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.panel-tabs { display: flex; gap: 4px; height: 100%; }
.panel-tab {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 10.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--faint);
}
.panel-tab:hover { color: var(--fg); }
.panel-tab.active { color: var(--fg); }
.panel-tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.panel-tab .badge { letter-spacing: 0; }
.panel-actions { display: flex; gap: 1px; margin-left: auto; }
.panel-actions .tool svg { width: 15px; height: 15px; }
.panel-body { flex: 1; min-height: 0; display: flex; }
.main.panel-right .panel-body { flex-direction: column; }
.console-output {
  flex: 1; min-width: 0; overflow: auto; padding: 6px 16px 12px; outline: none;
  font: 400 calc(var(--code-size) - .5px)/1.55 var(--mono); user-select: text; -webkit-user-select: text;
}
.console-line { white-space: pre-wrap; word-break: break-word; min-height: 1.55em; }
.console-line.meta, .console-line.command-line { color: var(--muted); }
.console-line.error { color: var(--error); }
.console-line.warning { color: var(--warning); }
.console-line a[data-goto],.console-line a[data-result-file] { cursor: pointer; color: inherit; border-radius: 3px; padding: 1px 3px; margin: -1px -3px; transition: background .12s; }
.console-line a[data-goto]:hover,.console-line a[data-result-file]:hover { background: var(--hover); text-decoration: underline; text-underline-offset: 3px; }
.console-line a[data-goto]:focus-visible,.console-line a[data-result-file]:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.console-line.command-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; font-family: var(--ui); font-size: 12px; }
.prompt { display: inline-flex; color: var(--success); }
.prompt svg { width: 12px; height: 12px; }
.command { font-weight: 600; color: var(--fg); }
.command-args { font-family: var(--mono); padding: 1px 7px; border-radius: 4px; background: var(--hover); color: var(--fg); }
.command-note { color: var(--faint); }
.console-line.status { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-strong); font-family: var(--ui); font-size: 12px; color: var(--muted); }
.console-line.status.error { color: var(--error); }
.console-line.timing-end { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--border-strong); }
.exit { display: inline-flex; }
.exit svg { width: 14px; height: 14px; }
.exit.ok { color: var(--success); }
.exit.failed { color: var(--error); }
.console-line.diagnostic { color: var(--fg); }
.diagnostic-severity { font-weight: 700; }
.diagnostic-severity.error { color: var(--error); }
.diagnostic-severity.warning { color: var(--warning); }
.diagnostic-code { color: var(--faint); }
.console-link { color: var(--accent); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.console-line.notice { font-family: var(--ui); font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 2px 0; }
.console-empty { display: flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--faint); font: 12.5px var(--ui); }
.console-empty span { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--hover); }
.console-input { flex: none; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--side); }
.console-input-header {
  display: flex; align-items: baseline; gap: 8px; height: 28px; line-height: 28px; padding: 0 12px; flex: none; overflow: hidden; white-space: nowrap;
  font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.console-input-header .hint { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.console-input textarea {
  flex: 1; min-height: 0; margin: 0; padding: 4px 12px 10px; border: 0; outline: 0; resize: none; background: transparent;
  font: 400 calc(var(--code-size) - .5px)/1.55 var(--mono); color: var(--fg); user-select: text; -webkit-user-select: text;
}
.console-input textarea::placeholder { color: var(--faint); font-family: var(--ui); }
.console-sash { flex: none; width: 1px; cursor: col-resize; background: var(--border); position: relative; }
.console-sash::after { content: ""; position: absolute; top: 0; bottom: 0; left: -3px; right: -3px; }
.console-sash:hover, .console-sash.active { background: var(--accent); }
.main.panel-right .console-sash { width: auto; height: 1px; cursor: row-resize; }
.main.panel-right .console-sash::after { left: 0; right: 0; top: -3px; bottom: -3px; }

.problems { flex: 1; overflow: auto; padding: 4px 0 12px; }
.problems .console-empty { padding: 10px 16px; }
.problem-file { display: flex; align-items: center; height: 24px; padding: 0 12px 0 14px; gap: 2px; font-weight: 500; }
.problem-file svg { width: 12px; height: 12px; color: var(--faint); margin-right: 4px; }
.problem-name { color: var(--fg); }
.problem-folder { margin-left: 6px; color: var(--faint); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.problem-file .badge { margin-left: auto; }
.problem { display: flex; align-items: center; gap: 8px; height: 24px; margin: 0 8px; padding: 0 8px 0 34px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.problem:hover { background: var(--hover); }
.problem .icon svg { width: 14px; height: 14px; }
.problem-message { overflow: hidden; text-overflow: ellipsis; }
.problem-code { color: var(--faint); font: 11.5px var(--mono); }
.problem-position { color: var(--faint); font-size: 12px; }

/* ____ Status bar */

.statusbar { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; font-size: 12px; color: var(--muted); background: var(--window); }
.status-left, .status-right { display: flex; align-items: center; gap: 2px; height: 100%; min-width: 0; }
.status-item { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; white-space: nowrap; }
button.status-item:hover { background: var(--hover); color: var(--fg); }
.status-item svg { width: 13px; height: 13px; }
.status-item .icon + span { margin-right: 4px; }
#status-problems.has-errors { color: var(--error); }
#status-console.on { color: var(--fg); }
#console-toggle svg { width: 15px; height: 15px; }
#console-toggle.on { color: var(--accent); }
.status-mode { margin-right: 4px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); }
.status-message { color: var(--faint); }

/* ____ Floating surfaces: quick pick, menus, dialogs, toasts */

.quick-pick { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding-top: 52px; pointer-events: none; }
.quick-pick-box { width: min(620px, 92vw); border-radius: 11px; overflow: hidden; pointer-events: auto; background: var(--raised); box-shadow: var(--shadow); animation: drop .12s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.quick-pick-input {
  display: block; width: 100%; height: 44px; padding: 0 16px; border: 0; outline: 0; background: transparent;
  font-size: 14.5px; border-bottom: 1px solid var(--border); user-select: text;
}
.quick-pick-input::placeholder { color: var(--faint); }
.quick-pick-list { max-height: min(440px, 56vh); overflow: auto; padding: 6px; }
.quick-pick-item { display: flex; align-items: center; gap: 2px; height: 30px; padding: 0 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.quick-pick-item.separated { margin-top: 7px; position: relative; }
.quick-pick-item.separated::before { content: ""; position: absolute; left: 8px; right: 8px; top: -4px; border-top: 1px solid var(--border); }
.quick-pick-item.focused { background: var(--accent-soft); }
.quick-pick-icon { display: inline-flex; align-items: center; margin-right: 8px; }
.quick-pick-icon .file-badge, .quick-pick-icon .folder-icon { margin-right: 0; }
.quick-pick-icon .dot.static { margin: 0 4px; }
.quick-pick-detail { margin-left: 10px; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.quick-pick-group { margin-left: auto; padding-left: 12px; color: var(--faint); font-size: 11.5px; }
.quick-pick-key { margin-left: auto; padding-left: 12px; color: var(--faint); font-size: 12px; letter-spacing: .04em; }
.quick-pick-group + .quick-pick-key { margin-left: 10px; }
.quick-pick-empty { padding: 12px; color: var(--muted); }

.context-menu { position: fixed; z-index: 120; min-width: 210px; padding: 5px; border-radius: 9px; background: var(--raised); box-shadow: var(--shadow); animation: drop .08s ease-out; }
.menu-item { display: flex; align-items: center; width: 100%; height: 26px; padding: 0 10px; border-radius: 5px; text-align: left; }
.menu-item { outline: 0; }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--on-accent); }
.menu-item:hover .menu-key, .menu-item:focus-visible .menu-key { color: inherit; opacity: .75; }
.menu-item.danger { color: var(--error); }
.menu-item.danger:hover, .menu-item.danger:focus-visible { background: var(--error); color: #fff; }
.menu-key { margin-left: auto; padding-left: 24px; color: var(--faint); font-size: 12px; }
.menu-separator { height: 1px; margin: 5px 8px; background: var(--border); }

.dialog-overlay {
  position: fixed; inset: 0; z-index: 140; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .28); backdrop-filter: blur(3px); opacity: 0; transition: opacity .15s;
}
.dialog-overlay.shown { opacity: 1; }
.dialog { width: min(420px, 90vw); padding: 22px 22px 18px; border-radius: 13px; background: var(--raised); box-shadow: var(--shadow); transform: scale(.97); transition: transform .15s; }
.dialog-overlay.shown .dialog { transform: none; }
.dialog-title { font-size: 15px; font-weight: 600; }
.dialog-message { margin-top: 8px; color: var(--muted); line-height: 1.55; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

.toasts { position: fixed; right: 16px; bottom: 38px; z-index: 130; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 9px; max-width: 420px; padding: 10px 14px; border-radius: 9px;
  background: var(--raised); box-shadow: var(--shadow-small); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.shown { opacity: 1; transform: none; }
.toast .icon svg { width: 15px; height: 15px; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--error); }
.toast.info .icon { color: var(--accent); }

@media (max-width: 1100px) { .activity-pill { display: none; } }
@media (max-width: 760px) { .dots { display: none; } .args input { width: 110px; } }
@media (max-width: 640px) {
  /* The sidebar overlays the editor on small screens instead of squeezing it. */
  .workbench { position: relative; }
  .sidebar { position: absolute; z-index: 20; left: 50px; top: 0; bottom: 0; box-shadow: 8px 0 24px #0004; }
  #sidebar-sash { display: none; }
  .app { grid-template-rows: 80px minmax(0, 1fr) 26px; }
  .titlebar { flex-wrap: wrap; align-content: center; row-gap: 4px; }
  .run-group { flex: 1; min-width: 0; }
  .run-configuration { min-width: 0; width: 100%; }
  .scheme { min-width: 0; max-width: 65%; }
  #scheme-name { overflow: hidden; text-overflow: ellipsis; }
  .args { flex: 1; min-width: 0; }
  .args input { width: 100%; min-width: 0; }
  .title-actions { margin-left: auto; flex-basis: 100%; justify-content: flex-end; }
}
