:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --command-height: 38px;
  --status-height: 24px;
  --sidebar-width: 264px;
  --panel-height: 190px;
  /* The core palette and its contrast-safe supporting tones. */
  --fern: #596f3f;
  --thistle: #dccde8;
  --midnight-violet: #23001e;
  --ebony: #45503b;
  --cherry-rose: #b6244f;
  --canvas: #12010f;
  --bg: #180414;
  --editor: #1b0718;
  --sidebar: #160512;
  --activity: #1d0819;
  --raised: #260b21;
  --raised-strong: #301129;
  --input: #130410;
  --hover: #35142e;
  --active: #442039;
  --border: #3c2235;
  --border-strong: #5a3a51;
  --text: #d8cae2;
  --muted: #a894ac;
  --bright: #f4ebf7;
  --accent: var(--fern);
  --accent-hover: #5d7041;
  --accent-soft: #29321f;
  --accent-muted: #a6be82;
  --focus: #b2c98d;
  --success: #9aad87;
  --success-surface: #263225;
  --warning: #d0b06e;
  --danger: #e36388;
  --danger-surface: #4b172a;
  --shadow: #080006b3;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select, textarea { color: inherit; font: inherit; }
button { border: 0; background: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 1px solid var(--focus); outline-offset: -1px; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.mobile-header, .mobile-target-view, .mobile-nav, .mobile-flash-view { display: none; }
.mobile-flash-view[hidden], .mobile-editor-actions[hidden] { display: none !important; }

.ide {
  position: relative;
  display: grid;
  width: 100vw;
  height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--command-height) minmax(0, 1fr) var(--status-height);
  background: var(--editor);
}

.command-bar {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 40px minmax(110px, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--raised);
  min-width: 0;
  user-select: none;
}

#deployment-progress {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  border: 0;
  accent-color: var(--success);
}
#deployment-progress[hidden] { display: none; }

.brand { display: grid; width: 40px; height: 100%; place-items: center; color: var(--accent-muted); cursor: pointer; }
.brand:hover { background: var(--hover); color: var(--bright); }
.brand svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.project-title { min-width: 0; overflow: hidden; padding: 0 10px 0 7px; white-space: nowrap; }
.project-title strong { overflow: hidden; color: var(--bright); font-size: 13px; font-weight: 650; letter-spacing: .01em; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.command-actions { display: flex; min-width: 0; height: 100%; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 7px; border-left: 1px solid var(--border); background: var(--raised); }
.target-control { min-width: 0; }
.target-destination { display: flex; min-width: 0; align-items: stretch; }
.target-picker { position: relative; height: 24px; min-width: 166px; }
#target-button { display: grid; width: 100%; height: 24px; grid-template-columns: minmax(0, 1fr) 15px; align-items: center; gap: 4px; padding: 0 5px 0 7px; border: 1px solid var(--border-strong); border-radius: 2px; background: var(--input); color: var(--text); cursor: pointer; text-align: left; font-size: 11px; }
#target-button:hover, .target-picker.open #target-button { border-color: var(--accent-muted); background: var(--hover); color: var(--bright); }
#target-button:focus-visible { border-color: var(--focus); outline: 0; }
#target-button:disabled { color: var(--muted); cursor: default; }
#target-button span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#target-button svg { width: 13px; transition: transform 90ms ease; }
.target-picker.open #target-button svg { transform: rotate(180deg); }
.target-menu { position: absolute; z-index: 50; top: 27px; right: 0; display: grid; width: 286px; max-height: min(460px, calc(100vh - 46px)); grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--raised-strong); box-shadow: 0 8px 24px var(--shadow); color: var(--text); }
.target-menu[hidden] { display: none; }
.target-search { display: grid; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--raised-strong); }
.target-search span, .mobile-target-search span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.target-search input, .mobile-target-search input { width: 100%; height: 29px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 2px; outline: 0; background: var(--input); color: var(--bright); font-size: 11px; }
.target-search input:focus, .mobile-target-search input:focus { border-color: var(--focus); }
.target-options { min-height: 0; overflow: auto; padding: 4px; }
.target-group { padding: 6px 7px 3px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.target-option { display: grid; width: 100%; height: 25px; grid-template-columns: 15px minmax(0, 1fr); align-items: center; gap: 5px; padding: 0 6px; color: var(--text); cursor: pointer; text-align: left; font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.target-option::before { color: transparent; content: "✓"; font-family: "Segoe UI Symbol", sans-serif; }
.target-option[aria-selected="true"]::before { color: var(--accent-muted); }
.target-option:hover, .target-option.focused { background: var(--accent-soft); color: var(--bright); }
.primary-action { display: flex; height: 24px; align-items: center; gap: 4px; padding: 0 9px; border-radius: 2px; background: var(--accent); color: var(--bright); cursor: pointer; font-size: 11px; font-weight: 550; }
.primary-action:hover:not(:disabled) { background: var(--accent-hover); }
.primary-action:disabled { color: var(--muted); background: var(--active); cursor: default; }
.primary-action svg { width: 14px; }
.secondary-action { display: flex; height: 24px; flex: none; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--border-strong); background: var(--raised-strong); color: var(--text); cursor: pointer; font-size: 11px; white-space: nowrap; }
.secondary-action:hover:not(:disabled) { background: var(--hover); }
.secondary-action:disabled { color: var(--muted); cursor: default; }
.secondary-action svg { width: 12px; }
.run-actions { display: flex; height: 24px; align-items: stretch; gap: 3px; }
#flash-transport { max-width: 84px; height: 24px; margin-left: -1px; padding: 0 17px 0 5px; border: 1px solid var(--border-strong); border-radius: 0 2px 2px 0; outline: 0; background: var(--raised); color: var(--text); cursor: pointer; font-size: 10px; }
.target-control:has(#flash-transport:not([hidden])) #target-button { border-radius: 2px 0 0 2px; }
#flash-transport:hover { border-color: var(--accent-muted); background: var(--hover); color: var(--bright); }
#flash-transport:disabled { color: var(--muted); cursor: default; }
#flash-transport[hidden] { display: none; }

.sidebar { position: relative; grid-column: 1; grid-row: 2; display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--border); background: var(--sidebar); user-select: none; }
.workspace-resizer { z-index: 45; touch-action: none; }
.workspace-resizer::after { position: absolute; background: transparent; content: ""; transition: background 80ms ease; }
.workspace-resizer:hover::after, .workspace-resizer.dragging::after { background: var(--focus); }
.sidebar-resizer { position: fixed; top: var(--command-height); bottom: var(--status-height); left: calc(var(--sidebar-width) - 3px); width: 6px; cursor: ew-resize; }
.sidebar-resizer::after { top: 0; bottom: 0; left: 2px; width: 2px; }
.ide.sidebar-hidden .sidebar-resizer { display: none; }
body.resizing-sidebar, body.resizing-sidebar * { cursor: ew-resize !important; user-select: none !important; }
body.resizing-panel, body.resizing-panel * { cursor: ns-resize !important; user-select: none !important; }
.ide.sidebar-hidden { --sidebar-width: 0px; }
.ide.sidebar-hidden .sidebar { display: none; }
.sidebar-header { display: flex; min-height: 57px; flex-direction: column; justify-content: center; gap: 3px; padding: 8px 13px; border-bottom: 1px solid var(--border); }
.sidebar-header span { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-header strong { overflow: hidden; color: var(--bright); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.project-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) 30px; gap: 5px; padding: 8px 9px; border-bottom: 1px solid var(--border); }
.project-toolbar button { display: flex; min-width: 0; height: 30px; align-items: center; justify-content: center; gap: 4px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--raised); color: var(--text); cursor: pointer; font-size: 11px; white-space: nowrap; }
.project-toolbar button:hover { border-color: var(--accent-muted); background: var(--hover); color: var(--bright); }
.project-toolbar .project-primary { border-color: var(--accent); background: var(--accent-soft); color: var(--bright); }
.project-toolbar .project-primary:hover { background: var(--accent); }
.project-toolbar button span { font-size: 14px; line-height: 1; }
.section-title { display: flex; height: 23px; align-items: center; gap: 2px; padding: 0 7px; background: var(--raised); color: var(--text); font-size: 11px; font-weight: 600; }
.section-title.collapsed { border-top: 1px solid var(--border); background: transparent; }
.utility-heading { flex: none; cursor: pointer; }
.utility-heading:hover { background: var(--hover); color: var(--bright); }
.utility-heading .utility-meta { margin-left: auto; padding-right: 4px; color: var(--muted); font: 9px/1 ui-monospace, monospace; }
.project-heading { justify-content: space-between; padding: 0 11px; color: var(--muted); font-size: 9px; letter-spacing: .06em; }
.section-count { display: grid; min-width: 18px; height: 17px; place-items: center; border-radius: 9px; background: var(--active); color: var(--muted); font-size: 9px; letter-spacing: 0; }
.project-action-menu, .file-action-menu { z-index: 80; min-width: 190px; padding: 4px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--raised-strong); box-shadow: 0 8px 24px var(--shadow); color: var(--text); }
.project-action-menu[hidden], .file-action-menu[hidden] { display: none; }
.project-action-menu { position: absolute; top: 98px; right: 8px; }
.file-action-menu { position: fixed; }
.project-action-menu button, .file-action-menu button { display: grid; width: 100%; min-height: 28px; align-items: center; padding: 0 8px; border-radius: 2px; color: var(--text); cursor: pointer; text-align: left; font-size: 11px; }
.project-action-menu button { grid-template-columns: 20px minmax(0, 1fr); gap: 3px; }
.project-action-menu button:hover, .project-action-menu button:focus-visible, .file-action-menu button:hover, .file-action-menu button:focus-visible { outline: 0; background: var(--accent-soft); color: var(--bright); }
.project-action-menu button.danger, .file-action-menu button.danger { color: var(--danger); }
.project-action-menu button.danger:hover, .file-action-menu button.danger:hover { background: var(--danger-surface); color: var(--bright); }
.menu-separator { height: 1px; margin: 4px 5px; background: var(--border-strong); }
.chevron { width: 12px; color: var(--muted); font-size: 15px; line-height: 1; }
.file-tree { min-height: 90px; flex: 1; overflow: auto; padding: 3px 0 7px; }
.file-row, .folder-row { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) 29px; align-items: center; }
.file, .folder { display: grid; width: 100%; height: 27px; align-items: center; padding: 0 3px 0 calc(13px + var(--tree-depth, 0) * 14px); color: var(--text); cursor: default; text-align: left; font-size: 12px; }
.file { grid-template-columns: 24px minmax(0, 1fr) 12px; }
.folder { grid-template-columns: 14px 20px minmax(0, 1fr); }
.folder-chevron { color: var(--muted); font-size: 14px; }
.folder-icon { color: var(--accent-muted); font-size: 13px; }
.folder > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row:hover, .file-row:focus-within, .folder-row:hover, .folder-row:focus-within { background: var(--hover); }
.file:hover { color: var(--bright); }
.file.active { background: var(--active); color: var(--bright); }
.file-row:has(.file.active) { background: var(--active); }
.file-more { width: 25px; height: 23px; border-radius: 3px; color: transparent; cursor: pointer; font-size: 10px; }
.file-row:hover .file-more, .file-row:focus-within .file-more, .folder-row:hover .file-more, .folder-row:focus-within .file-more, .file.active + .file-more { color: var(--muted); }
.file-more:hover { background: var(--active); color: var(--bright) !important; }
.go-icon, .mod-icon, .c-icon, .rtg-icon, .bin-icon { font: 600 10px/1 "Segoe UI", sans-serif; }
.go-icon { color: var(--accent-muted); }
.mod-icon { color: var(--warning); }
.c-icon { color: var(--success); }
.rtg-icon { color: var(--danger); font-size: 8px; }
.bin-icon { color: var(--warning); font-size: 8px; }
.file.generated { color: var(--muted); }
.file.generated:hover { color: var(--bright); }
.dirty { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.file.modified .dirty { display: block; }
.sidebar-fill { flex: 1; }
.stdlib-tree { max-height: 48%; min-height: 120px; flex: 0 1 48%; overflow: auto; padding: 2px 0 7px; border-bottom: 1px solid var(--border); }
.stdlib-tree[hidden] { display: none; }
.sidebar-examples, .help-tree { max-height: 250px; flex: none; overflow: auto; padding: 4px 0 7px; border-bottom: 1px solid var(--border); }
.sidebar-examples[hidden], .help-tree[hidden] { display: none; }
.sidebar-example { border-top: 1px solid var(--border); }
.sidebar-example:first-child { border-top: 0; }
.sidebar-example-folder { display: grid; min-height: 38px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 3px 7px 3px 8px; }
.sidebar-example-folder:hover { background: var(--hover); }
.sidebar-example-toggle { display: grid; min-width: 0; height: 100%; grid-template-columns: 15px minmax(0, 1fr); align-items: center; color: var(--text); cursor: pointer; text-align: left; }
.sidebar-example-toggle > div { min-width: 0; }
.sidebar-example-chevron { color: var(--muted); font-size: 14px; }
.sidebar-example strong, .sidebar-example small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-example strong { color: var(--text); font-size: 11px; font-weight: 550; }
.sidebar-example small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.sidebar-example-use, .sidebar-browser-action { min-height: 25px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 2px; background: var(--accent-soft); color: var(--accent-muted); cursor: pointer; font-size: 9px; }
.sidebar-example-use:hover, .sidebar-browser-action:hover { background: var(--accent); color: var(--bright); }
.sidebar-example-files { padding: 1px 0 4px; background: var(--input); }
.sidebar-example-files[hidden] { display: none; }
.sidebar-example-file { display: grid; width: 100%; height: 23px; grid-template-columns: 29px minmax(0, 1fr); align-items: center; overflow: hidden; padding: 0 8px 0 24px; color: var(--text); cursor: pointer; text-align: left; font-size: 10px; }
.sidebar-example-file:hover { background: var(--hover); color: var(--bright); }
.sidebar-example-file.active { background: var(--active); color: var(--bright); }
.sidebar-example-file span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-browser-action { display: block; width: calc(100% - 16px); margin: 7px 8px 2px; }
.help-search { position: sticky; z-index: 1; top: -4px; padding: 6px 8px; background: var(--sidebar); }
.help-search input { width: 100%; height: 27px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: 2px; outline: 0; background: var(--input); color: var(--bright); font-size: 10px; }
.help-search input:focus { border-color: var(--focus); }
.help-package { display: grid; width: 100%; min-height: 25px; grid-template-columns: 18px minmax(0, 1fr); align-items: center; padding: 0 9px; color: var(--text); cursor: pointer; text-align: left; font-size: 11px; }
.help-package::before { color: var(--accent-muted); content: "?"; font-size: 9px; font-weight: 700; }
.help-package:hover { background: var(--hover); color: var(--bright); }
.tree-loading { display: block; padding: 5px 13px; color: var(--muted); font-size: 11px; }
.library-group { padding: 6px 11px 2px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.library-subgroup { padding: 7px 11px 2px; color: var(--text); font-size: 10px; font-weight: 600; }
.stdlib-package, .stdlib-file { display: grid; width: 100%; height: 22px; align-items: center; color: var(--text); cursor: pointer; text-align: left; font-size: 11px; }
.stdlib-package { grid-template-columns: 15px minmax(0, 1fr); padding: 0 7px 0 11px; }
.library-board-package .stdlib-package { padding-left: 20px; }
.stdlib-package::before { color: var(--muted); content: "›"; font-size: 14px; }
.stdlib-package.open::before { content: "⌄"; }
.stdlib-package.build-root { color: var(--accent-muted); }
.stdlib-file { grid-template-columns: 24px minmax(0, 1fr); padding: 0 7px 0 25px; }
.stdlib-package:hover, .stdlib-file:hover { background: var(--hover); }
.stdlib-file.active { background: var(--active); color: var(--bright); }
.stdlib-files[hidden] { display: none; }
.advanced-build { display: flex; max-height: 52%; overflow: auto; flex-direction: column; gap: 8px; padding: 9px 10px 11px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.advanced-build[hidden] { display: none; }
.advanced-build p { margin: 0 0 2px; color: var(--muted); line-height: 1.4; }
.advanced-build label { display: flex; min-height: 24px; align-items: center; justify-content: flex-start; gap: 7px; }
.advanced-build label:has(select), .advanced-build label:has(input:not([type="checkbox"])), .advanced-build label:has(textarea) { justify-content: space-between; }
.advanced-build input[type="checkbox"] { margin: 0; accent-color: var(--accent); }
.advanced-build input:not([type="checkbox"]), .advanced-build select { width: 126px; height: 26px; padding: 0 5px; border: 1px solid var(--border-strong); background: var(--input); color: var(--text); font: 10px ui-monospace, monospace; }
.advanced-build textarea { width: 126px; min-height: 58px; resize: vertical; padding: 5px; border: 1px solid var(--border-strong); outline: 0; background: var(--input); color: var(--text); font: 10px/1.4 ui-monospace, monospace; }
.advanced-build textarea:focus { border-color: var(--focus); }
.advanced-build button { min-height: 28px; margin-top: 2px; border: 1px solid var(--border-strong); background: var(--raised); color: var(--text); cursor: pointer; font-size: 10px; }
.advanced-build button:hover { background: var(--hover); color: var(--bright); }
.outline-tree { max-height: 180px; overflow: auto; padding: 3px 0 6px; border-bottom: 1px solid var(--border); }
.outline-tree[hidden] { display: none; }
.outline-item { display: grid; width: 100%; min-height: 22px; grid-template-columns: 29px minmax(0, 1fr); align-items: center; overflow: hidden; padding: 1px 8px 1px 12px; color: var(--text); cursor: pointer; text-align: left; white-space: nowrap; font: 10px/18px ui-monospace, monospace; }
.outline-kind { color: var(--accent-muted); font-size: 8px; text-transform: uppercase; }
.outline-name { overflow: hidden; text-overflow: ellipsis; }
.outline-item:hover { background: var(--hover); }

.ide-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--raised-strong); box-shadow: 0 18px 64px var(--shadow); color: var(--text); }
.quick-open { position: fixed; z-index: 120; inset: 0; display: grid; place-items: start center; padding: 52px 16px 16px; background: #12010f42; }
.quick-open[hidden] { display: none; }
.quick-open-surface { width: min(690px, 100%); overflow: hidden; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--raised-strong); box-shadow: 0 18px 64px var(--shadow); color: var(--text); }
.quick-open-field { display: grid; min-height: 48px; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 6px; margin: 6px; border: 1px solid var(--focus); border-radius: 3px; background: var(--input); box-shadow: 0 0 0 1px #b2c98d22; }
.quick-open-field > span { color: var(--accent-muted); font: 17px/1 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; }
#quick-open-input { width: 100%; min-width: 0; height: 46px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--bright); font: 14px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.quick-open-field kbd { margin-right: 9px; padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--raised); color: var(--muted); font: 9px/1 system-ui, sans-serif; }
.quick-open-hint { padding: 3px 13px 8px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.quick-open-results { max-height: min(440px, calc(100vh - 150px)); overflow: auto; padding: 5px; }
.quick-open-empty { padding: 23px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.quick-open-item { display: grid; width: 100%; min-height: 46px; grid-template-columns: 24px minmax(0, 1fr) minmax(90px, auto); align-items: center; gap: 8px; padding: 5px 9px; border-radius: 3px; color: var(--text); text-align: left; }
.quick-open-item[aria-selected="true"] { background: var(--accent-soft); color: var(--bright); }
.quick-open-item-icon { color: var(--accent-muted); font: 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; }
.quick-open-item-main { min-width: 0; overflow: hidden; font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.quick-open-item-main strong { color: var(--bright); font-weight: 500; }
.quick-open-item-main small { display: block; overflow: hidden; color: var(--muted); font: 9px/1.3 system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.quick-open-item-detail { overflow: hidden; color: var(--muted); font: 9px/1.2 system-ui, sans-serif; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.ide-dialog::backdrop { background: #12010fcc; backdrop-filter: blur(1px); }
.ide-dialog form, .ide-dialog .dialog-body { margin: 0; padding: 0; }
.ide-dialog header { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-strong); }
.ide-dialog h2 { margin: 0; color: var(--bright); font-size: 14px; font-weight: 500; }
.ide-dialog header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.dialog-kicker { display: block; margin-bottom: 4px; color: var(--accent-muted); font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.ide-dialog header > button { width: 28px; height: 28px; color: var(--muted); cursor: pointer; font-size: 20px; }
.ide-dialog header > button:hover { background: var(--hover); color: var(--bright); }
.text-dialog form > label { display: grid; gap: 6px; padding: 16px 16px 5px; color: var(--muted); font-size: 11px; }
.ide-dialog input { height: 30px; padding: 0 8px; border: 1px solid var(--border-strong); background: var(--input); color: var(--bright); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.dialog-error { min-height: 17px; margin: 2px 16px 0; color: var(--danger); font-size: 11px; }
.ide-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 15px; }
.dialog-primary, .dialog-secondary, .dialog-danger { min-height: 29px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 2px; cursor: pointer; font-size: 11px; }
.dialog-primary { border-color: var(--accent); background: var(--accent); color: var(--bright); }
.dialog-primary:hover { background: var(--accent-hover); }
.dialog-secondary { background: var(--raised); color: var(--text); }
.dialog-secondary:hover { background: var(--hover); }
.dialog-danger { border-color: var(--cherry-rose); background: var(--cherry-rose); color: var(--bright); }
.dialog-danger:hover { background: var(--danger); }
.confirm-dialog form > p { margin: 0; padding: 18px 16px 8px; color: var(--text); font-size: 12px; line-height: 1.5; }
.snapshot-dialog { width: min(880px, calc(100vw - 40px)); }
.snapshot-header { min-height: 88px !important; padding: 17px 20px !important; background: linear-gradient(118deg, var(--accent-soft), var(--midnight-violet) 72%); }
.snapshot-header h2 { font-size: 20px; font-weight: 650; }
.snapshot-kicker { display: block; margin-bottom: 5px; color: var(--accent-muted); font-size: 8px; font-weight: 750; letter-spacing: .15em; }
.snapshot-layout { display: grid; min-height: 340px; grid-template-columns: 290px minmax(0, 1fr); }
.snapshot-create-card { padding: 24px 22px; border-right: 1px solid var(--border); background: var(--sidebar); }
.snapshot-card-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--accent); border-radius: 50%; background: var(--accent-soft); color: var(--accent-muted); font-size: 20px; }
.snapshot-create-card h3 { margin: 17px 0 6px; color: var(--bright); font-size: 15px; font-weight: 620; }
.snapshot-create-card > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.snapshot-create { display: grid; gap: 7px; margin-top: 20px; }
.snapshot-create label { color: var(--muted); font-size: 10px; }
.snapshot-create input { width: 100%; }
.snapshot-create button { min-height: 32px; margin-top: 3px; }
.snapshot-history { min-width: 0; background: var(--raised); }
.snapshot-history-heading { display: flex; min-height: 46px; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--border); }
.snapshot-history-heading strong { color: var(--bright); font-size: 11px; font-weight: 620; }
.snapshot-history-heading span { color: var(--muted); font-size: 9px; }
.snapshot-list { max-height: min(430px, 55vh); overflow: auto; padding: 8px; }
.snapshot-empty { display: grid; min-height: 260px; place-content: center; justify-items: center; padding: 24px; color: var(--muted); text-align: center; }
.snapshot-empty > span { color: var(--accent-muted); font-size: 28px; }
.snapshot-empty strong { margin-top: 10px; color: var(--bright); font-size: 12px; }
.snapshot-empty p { max-width: 220px; margin: 5px 0 0; font-size: 10px; line-height: 1.45; }
.snapshot-item { display: grid; min-height: 67px; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid transparent; border-radius: 4px; }
.snapshot-item:hover { border-color: var(--border); background: var(--hover); }
.snapshot-item-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-muted); }
.snapshot-item strong, .snapshot-item small, .snapshot-metadata { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snapshot-item strong { color: var(--bright); font-size: 11px; font-weight: 600; }
.snapshot-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.snapshot-metadata { margin-top: 4px; color: var(--accent-muted); font: 8px/1.2 ui-monospace, monospace; }
.snapshot-actions { display: flex; align-items: center; gap: 5px; }
.snapshot-item button { min-height: 28px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 2px; background: var(--raised); color: var(--text); cursor: pointer; font-size: 10px; }
.snapshot-item button:hover { background: var(--active); color: var(--bright); }
.snapshot-item button.danger { width: 28px; padding: 0; color: var(--danger); font-size: 15px; }
.example-dialog { width: min(1180px, calc(100vw - 48px)); font-family: Inter, Aptos, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.example-dialog .dialog-body { display: flex; height: min(760px, calc(100vh - 56px)); flex-direction: column; overflow: hidden; }
.example-dialog header { min-height: 104px; padding: 20px 28px; background: linear-gradient(125deg, var(--accent-soft) 0%, var(--midnight-violet) 56%, var(--ebony) 150%); }
.example-dialog header > div { max-width: 680px; }
.example-dialog h2 { font-size: 25px; font-weight: 670; letter-spacing: -.025em; }
.example-dialog header p { margin-top: 6px; font-size: 13px; line-height: 1.45; }
.example-dialog .dialog-kicker { margin-bottom: 6px; font-size: 9px; letter-spacing: .16em; }
.mobile-setup { display: none; }
.example-browser-layout { display: grid; min-height: 0; flex: 1; grid-template-columns: 272px minmax(0, 1fr); }
.example-board-pane { min-width: 0; overflow-y: auto; padding: 22px 16px 28px; border-right: 1px solid var(--border); background: var(--sidebar); }
.example-pane-heading { display: grid; gap: 5px; padding: 0 6px 15px; }
.example-pane-heading > span { color: var(--accent-muted); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.example-pane-heading > strong { color: var(--bright); font-size: 15px; font-weight: 600; }
.example-board-list { display: grid; gap: 8px; }
.example-machine-group { padding: 12px 7px 2px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.example-board-all + .example-machine-group { padding-top: 5px; }
.example-board-row { position: relative; }
.example-board-choice { display: grid; width: 100%; min-width: 0; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 9px; border: 1px solid transparent; border-radius: 10px; color: var(--text); cursor: pointer; text-align: left; }
.example-board-choice:hover { border-color: var(--border-strong); background: var(--hover); }
.example-board-choice.selected { border-color: var(--accent-muted); background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.example-board-choice > span:last-child { display: grid; min-width: 0; gap: 3px; }
.example-board-choice strong { overflow: hidden; color: var(--bright); font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.example-board-choice small { color: var(--muted); font-size: 10px; }
.example-board-all { grid-template-columns: 46px minmax(0, 1fr); }
.example-board-all-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--raised); color: var(--text); font-size: 10px; font-weight: 700; }
.example-board-docs { display: inline-block; margin: -5px 10px 5px 96px; color: var(--accent-muted); font-size: 9px; text-decoration: none; }
.example-board-docs::after { content: "  ↗"; }
.example-board-docs:hover { color: var(--bright); text-decoration: underline; }
.board-artwork { width: 76px; height: 52px; overflow: visible; filter: drop-shadow(0 5px 6px var(--shadow)); }
.board-shell { fill: var(--ebony); stroke: var(--success); stroke-width: 2; }
.board-face { fill: var(--raised); stroke: var(--border-strong); stroke-width: 1.5; }
.board-metal { fill: var(--text); stroke: var(--bright); stroke-width: 1; }
.board-chip { fill: var(--canvas); stroke: var(--muted); stroke-width: 1.5; fill-rule: evenodd; }
.board-led { fill: var(--cherry-rose); stroke: var(--danger); stroke-width: 1.5; }
.board-button { fill: var(--input); stroke: var(--muted); stroke-width: 1.5; }
.board-port { fill: var(--warning); }
.board-pin { fill: none; stroke: var(--warning); stroke-width: 3; stroke-linecap: round; }
.board-screen { fill: var(--accent-soft); stroke: var(--accent-muted); stroke-width: 1.5; }
.board-graph { fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.board-camera { fill: var(--canvas); stroke: var(--muted); stroke-width: 1; }
.board-keys { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.example-project-pane { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--raised); }
.example-filters { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, .38fr); gap: 12px; padding: 20px 24px 16px; }
.example-filters label { display: grid; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.example-filters input, .example-filters select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--input); color: var(--bright); font: 12px/1.2 Inter, Aptos, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-transform: none; }
.example-filters input:focus, .example-filters select:focus { border-color: var(--focus); outline: 1px solid var(--focus); }
.example-summary { display: flex; justify-content: space-between; gap: 16px; padding: 0 24px 14px; color: var(--muted); font-size: 11px; }
.example-summary span:first-child { color: var(--text); font-weight: 600; }
.example-results { display: grid; min-height: 180px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 12px; overflow: auto; padding: 0 24px 28px; }
.example-card { display: grid; min-width: 0; align-content: start; gap: 15px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--raised-strong); box-shadow: 0 1px 0 var(--shadow); }
.example-card:hover { border-color: var(--accent-muted); background: var(--hover); }
.example-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.example-card-actions { display: flex; flex: none; gap: 6px; }
.example-card-title { display: grid; min-width: 0; gap: 6px; }
.example-card-heading strong { overflow: hidden; color: var(--bright); font-size: 16px; font-weight: 650; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.example-card-heading button { min-width: 60px; flex: none; }
.example-category { width: fit-content; padding: 3px 7px; border-radius: 4px; background: var(--active); color: var(--text); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.example-category.sensor { background: var(--success-surface); color: var(--success); }
.example-category.interface { background: var(--active); color: var(--thistle); }
.example-category.console { background: var(--accent-soft); color: var(--accent-muted); }
.example-category.light { background: var(--danger-surface); color: var(--warning); }
.example-hardware { display: flex; min-height: 37px; flex-wrap: wrap; align-content: flex-start; gap: 4px 8px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; }
.example-hardware > span { width: 100%; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.example-hardware strong { color: var(--text); font-weight: 500; }
.example-hardware a { color: var(--accent-muted); text-decoration: none; }
.example-hardware a::after { content: " ↗"; }
.example-hardware a:hover { color: var(--bright); text-decoration: underline; }
.example-metadata { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.example-metadata > span { padding: 4px 7px; border-radius: 9px; background: var(--active); }
.example-metadata .example-language { background: var(--accent-soft); color: var(--accent-muted); }
.example-metadata .example-compatible { overflow: hidden; min-width: 0; flex: 1; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.example-empty { display: flex; min-height: 180px; align-items: center; justify-content: center; flex-direction: column; gap: 6px; color: var(--muted); text-align: center; font-size: 12px; }
.example-empty strong { color: var(--text); font-size: 14px; font-weight: 600; }
.device-permission-dialog { width: min(560px, calc(100vw - 32px)); }
.device-permission-dialog header { background: linear-gradient(120deg, var(--success-surface), var(--midnight-violet) 68%); }
.device-permission-dialog h2 { font-size: 18px; font-weight: 620; }
.device-permission-body { padding: 16px; }
.device-permission-steps { display: grid; gap: 12px; }
.device-permission-steps > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; }
.device-permission-steps > div > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-muted); font-size: 11px; font-weight: 650; }
.device-permission-steps p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.device-permission-steps strong { display: block; margin-bottom: 2px; color: var(--bright); font-size: 12px; font-weight: 550; }
.device-capabilities { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 17px; }
.device-capabilities > div { display: grid; min-width: 0; grid-template-columns: 10px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--input); }
.capability-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.device-capabilities .available .capability-dot { background: var(--success); box-shadow: 0 0 0 3px #9aad8729; }
.device-capabilities .unavailable .capability-dot { background: var(--muted); }
.device-capabilities p, .device-capabilities strong, .device-capabilities small { display: block; min-width: 0; margin: 0; }
.device-capabilities strong { color: var(--bright); font-size: 11px; font-weight: 550; }
.device-capabilities small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.device-permission-note { margin: 14px 0 0; padding: 10px 11px; border-left: 2px solid var(--accent); background: var(--accent-soft); color: var(--text); font-size: 10px; line-height: 1.45; }
.pico-monitor-installer { display: grid; gap: 12px; margin-top: 14px; padding: 13px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--raised); }
.pico-monitor-installer[hidden] { display: none; }
.pico-monitor-heading { display: grid; gap: 3px; }
.pico-monitor-heading span { color: var(--accent-muted); font-size: 9px; font-weight: 700; letter-spacing: .09em; }
.pico-monitor-heading strong { color: var(--bright); font-size: 13px; font-weight: 620; }
.pico-monitor-installer ol { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.pico-monitor-installer li { display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: start; gap: 8px; }
.pico-monitor-installer li > span { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: var(--active); color: var(--accent-muted); font-size: 9px; font-weight: 700; }
.pico-monitor-installer li p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.pico-monitor-installer li strong { display: block; color: var(--text); font-size: 11px; font-weight: 580; }
.pico-monitor-installer code { color: var(--bright); }
.pico-monitor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pico-monitor-actions a { color: var(--accent-muted); font-size: 10px; }
.pico-monitor-installer [role="status"] { min-height: 14px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.device-permission-dialog footer { border-top: 1px solid var(--border); }
.device-permission-dialog .dialog-primary:disabled { border-color: var(--border); background: var(--active); color: var(--muted); cursor: default; }
.new-file-body { display: grid; gap: 13px; padding: 16px 16px 5px; }
.new-file-body label { display: grid; grid-template-columns: 94px minmax(0, 1fr); align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.new-file-body select { height: 31px; padding: 0 8px; border: 1px solid var(--border-strong); background: var(--input); color: var(--bright); font-size: 12px; }
.new-file-body input { width: 100%; }
.new-file-help { min-height: 32px; margin: 0 0 0 104px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.new-file-body .dialog-error { margin: 0 0 0 104px; }
.project-kind-options { display: grid; gap: 8px; margin: 0; padding: 16px; border: 0; }
.project-kind-options label { display: grid; min-height: 62px; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--raised); cursor: pointer; }
.project-kind-options label:hover, .project-kind-options label:has(input:checked) { border-color: var(--focus); background: var(--accent-soft); }
.project-kind-options input { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
.project-kind-options strong, .project-kind-options small { display: block; }
.project-kind-options strong { color: var(--bright); font-size: 12px; font-weight: 550; }
.project-kind-options small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.new-project-warning { margin: 0; padding: 0 16px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.workbench { grid-column: 2; grid-row: 2; display: grid; min-width: 0; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: 38px minmax(0, 1fr) var(--panel-height); background: var(--editor); }
.workbench.preview-open { grid-template-columns: minmax(0, 1fr) minmax(340px, 42vw); }
.workbench.panel-hidden { grid-template-rows: 38px minmax(0, 1fr) 0; }
.workbench.plotter-expanded { grid-template-rows: 38px 0 minmax(0, 1fr); }
.workbench.plotter-expanded .editor-host { visibility: hidden; }
.editor-tabs { display: flex; min-width: 0; grid-column: 1; grid-row: 1; border-bottom: 1px solid var(--border); background: var(--bg); }
.start-screen { z-index: 20; display: grid; min-width: 0; min-height: 0; grid-column: 1 / -1; grid-row: 1 / 4; place-items: center; overflow: auto; padding: 32px; background: radial-gradient(circle at 50% 10%, #29321f99, transparent 37%), linear-gradient(145deg, var(--editor), var(--canvas)); }
.start-screen[hidden] { display: none; }
.start-card { width: min(780px, 100%); }
.start-mark { display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--accent-muted); box-shadow: 0 16px 48px var(--shadow); }
.start-mark svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.start-kicker { margin: 20px 0 7px; color: var(--accent-muted); font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.start-card h1 { margin: 0; color: var(--bright); font-size: clamp(29px, 4vw, 44px); font-weight: 680; letter-spacing: -.035em; }
.start-copy { max-width: 550px; margin: 10px 0 23px; color: var(--text); font-size: 13px; line-height: 1.55; }
.start-primary-actions { display: flex; gap: 8px; }
.start-primary-actions button { min-height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--raised); color: var(--bright); cursor: pointer; font-size: 11px; }
.start-primary-actions button:hover { background: var(--hover); }
.start-primary-actions .start-primary { border-color: var(--accent); background: var(--accent); }
.start-primary-actions .start-primary:hover { background: var(--accent-hover); }
.start-primary-actions span { color: var(--thistle); }
.start-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 24px; }
.start-grid button { display: grid; min-height: 76px; align-content: center; gap: 5px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 4px; background: #260b21b8; color: var(--text); cursor: pointer; text-align: left; }
.start-grid button:hover { border-color: var(--accent-muted); background: var(--hover); }
.start-grid strong { color: var(--bright); font-size: 12px; font-weight: 620; }
.start-grid span { color: var(--muted); font-size: 10px; }
.open-editor-tabs { display: flex; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.editor-tab { display: flex; width: 150px; height: 37px; align-items: center; gap: 7px; padding: 0 9px; border-right: 1px solid var(--border); background: var(--editor); color: var(--bright); cursor: default; font-size: 12px; }
.editor-tab:not(.active) { background: var(--bg); color: var(--muted); }
.editor-tab > span:nth-child(2) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-tab .tab-close { display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; border-radius: 3px; color: var(--muted); font-size: 14px; }
.editor-tab .tab-close:hover { background: var(--active); color: var(--bright); }
.editor-toolbar { display: flex; flex: 1; justify-content: flex-end; align-items: center; padding-right: 4px; }
.editor-toolbar button { display: grid; width: 28px; height: 28px; place-items: center; color: var(--muted); cursor: pointer; }
.editor-toolbar button:hover { color: var(--bright); background: var(--hover); }
.editor-toolbar button:disabled { color: var(--muted); cursor: default; }
.editor-toolbar button:disabled:hover { background: transparent; }
.editor-toolbar .editor-text-action { width: auto; padding: 0 9px; font-size: 11px; }
.editor-toolbar button[hidden] { display: none; }
#format-file, #search-project { width: auto; padding: 0 8px; font-size: 11px; }
#copy-to-playground { width: auto; padding: 0 8px; font-size: 11px; }
#copy-to-playground[hidden] { display: none; }
.editor-host { position: relative; grid-column: 1; grid-row: 2; min-width: 0; min-height: 0; overflow: hidden; background: var(--editor); }
.editor-host[hidden] { display: none; }
.editor-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; }
.spinner { width: 13px; height: 13px; border: 1px solid var(--border-strong); border-top-color: var(--thistle); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.help-view { grid-column: 1; grid-row: 2; min-width: 0; min-height: 0; overflow: auto; padding: 30px clamp(24px, 5vw, 76px) 64px; background: var(--editor); color: var(--text); }
.help-view[hidden] { display: none; }
.help-breadcrumb { margin-bottom: 17px; color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.help-breadcrumb button { padding: 0; color: var(--accent-muted); cursor: pointer; }
.help-breadcrumb button:hover { color: var(--bright); text-decoration: underline; }
.help-package-title { margin: 0; color: var(--bright); font: 650 clamp(25px, 3vw, 35px)/1.15 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.025em; }
.help-import-path { margin: 7px 0 24px; color: var(--muted); font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.help-overview { max-width: 860px; margin: 0 0 30px; color: var(--text); font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.help-view h2 { margin: 34px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--border); color: var(--bright); font-size: 18px; font-weight: 620; }
.help-index { display: grid; width: min(860px, 100%); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 22px; margin: 0; padding: 13px 17px; border: 1px solid var(--border); border-radius: 5px; background: var(--raised); list-style: none; }
.help-index a { display: block; overflow: hidden; padding: 3px 0; color: var(--accent-muted); text-overflow: ellipsis; white-space: nowrap; font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-decoration: none; }
.help-index a:hover { color: var(--bright); text-decoration: underline; }
.help-declaration { max-width: 920px; padding: 16px 0 8px; scroll-margin-top: 14px; }
.help-declaration + .help-declaration { border-top: 1px solid var(--border); }
.help-declaration-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.help-declaration h3 { margin: 0; color: var(--thistle); font-size: 14px; font-weight: 620; }
.help-source-link { flex: none; padding: 2px 0; color: var(--accent-muted); cursor: pointer; font: 10px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; }
.help-source-link::before { content: "View source · "; }
.help-source-link:hover { color: var(--bright); text-decoration: underline; }
.help-signature { overflow-x: auto; margin: 0 0 11px; padding: 11px 13px; border-left: 3px solid var(--ebony); border-radius: 2px; background: var(--canvas); color: var(--success); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.help-doc { margin: 0; color: var(--text); font-size: 13px; line-height: 1.62; white-space: pre-wrap; }
.help-methods { margin: 13px 0 0 18px; }
.help-methods .help-declaration { padding-top: 12px; }
.help-empty-doc { color: var(--muted); font-style: italic; }
.help-examples { display: grid; max-width: 920px; gap: 13px; margin-top: 15px; }
.help-example { overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: var(--raised); }
.help-example h4 { margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--bright); font-size: 11px; font-weight: 620; }
.help-example-doc { margin: 0; padding: 10px 12px 0; color: var(--text); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.help-example-code, .help-example-output { overflow-x: auto; margin: 0; padding: 12px; background: var(--canvas); color: var(--success); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.help-example-output-label { display: block; padding: 7px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.help-example-output { color: var(--text); }
.hex-view { display: grid; min-width: 0; min-height: 0; grid-column: 1; grid-row: 2; grid-template-rows: 42px 27px minmax(0, 1fr); overflow: hidden; background: var(--canvas); color: var(--text); }
.hex-view[hidden] { display: none; }
.hex-view > header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 0 13px; border-bottom: 1px solid var(--border); background: var(--raised); }
.hex-view > header > div:first-child { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.hex-view > header strong { overflow: hidden; color: var(--bright); font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.hex-view > header span { color: var(--muted); font-size: 9px; }
.hex-actions { display: flex; align-items: center; gap: 4px; }
.hex-actions button { height: 26px; min-width: 28px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: 2px; background: var(--raised-strong); color: var(--text); cursor: pointer; font-size: 10px; }
.hex-actions button:hover:not(:disabled) { border-color: var(--focus); color: var(--bright); }
.hex-actions button:disabled { color: var(--muted); opacity: .45; }
.hex-heading { overflow: hidden; padding: 7px 13px 5px; border-bottom: 1px solid var(--border); color: var(--accent-muted); font: 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
#hex-output { min-width: max-content; min-height: 0; margin: 0; overflow: auto; padding: 8px 13px 24px; color: var(--text); font: 11px/17px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.panel-resizer { position: relative; grid-column: 1; grid-row: 3; align-self: start; width: 100%; height: 7px; transform: translateY(-3px); cursor: ns-resize; }
.panel-resizer::after { top: 2px; right: 0; left: 0; height: 2px; }
.panel { grid-column: 1; grid-row: 3; min-height: 0; overflow: hidden; border-top: 1px solid var(--border); background: var(--editor); }
.workbench.panel-hidden .panel { display: none; }
.workbench.panel-hidden .panel-resizer, .workbench.plotter-expanded .panel-resizer { display: none; }
.panel-tabs { display: flex; height: 34px; align-items: stretch; overflow-x: auto; padding-left: 8px; border-bottom: 1px solid var(--border); }
.panel-tab { position: relative; padding: 0 9px; color: var(--muted); cursor: pointer; font-size: 11px; }
.panel-tab:hover, .panel-tab.active { color: var(--bright); }
.panel-tab.active::after { position: absolute; right: 9px; bottom: 2px; left: 9px; height: 1px; background: var(--focus); content: ""; }
.panel-tab span { margin-left: 3px; }
.panel-actions { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 2px; padding-right: 5px; }
.panel-actions button { height: 23px; min-width: 26px; padding: 0 5px; color: var(--muted); cursor: pointer; font-size: 11px; }
.panel-actions button:hover { color: var(--bright); background: var(--hover); }
.panel-actions button[hidden] { display: none; }
.panel-content { height: calc(100% - 34px); min-height: 0; }
.panel-view { display: none; width: 100%; height: 100%; margin: 0; overflow: auto; }
.panel-view.active { display: block; }
pre.panel-view { padding: 3px 12px 10px; color: var(--text); background: transparent; font: 12px/19px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.empty-state { padding: 8px 12px; color: var(--muted); font-size: 12px; }
.problem-row { display: grid; min-height: 24px; align-items: center; padding: 3px 12px; border-top: 1px solid var(--border); font-size: 12px; }
.problem-row { grid-template-columns: 16px minmax(0, 1fr) auto; gap: 5px; }
.problem-row svg { color: var(--danger); }
.problem-location { color: var(--muted); font: 11px ui-monospace, monospace; }
.search-results.active { display: block; }
.search-form { position: sticky; z-index: 2; top: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 7px 9px; border-bottom: 1px solid var(--border); background: var(--editor); }
.search-form input { height: 27px; padding: 0 7px; border: 1px solid var(--border-strong); background: var(--input); color: var(--bright); font: 11px ui-monospace, monospace; }
.search-form button { min-width: 62px; border: 1px solid var(--accent); background: var(--accent); color: var(--bright); cursor: pointer; font-size: 11px; }
.search-form button:hover { background: var(--accent-hover); }
.search-row { display: grid; width: 100%; min-height: 26px; grid-template-columns: minmax(150px, .35fr) minmax(0, 1fr); gap: 12px; padding: 4px 12px; border-top: 1px solid var(--border); color: var(--text); cursor: pointer; text-align: left; font-size: 11px; }
.search-row:hover { background: var(--hover); }
.search-row span:first-child { color: var(--accent-muted); font: 10px ui-monospace, monospace; }
.search-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-pane { display: grid; min-width: 0; min-height: 0; grid-column: 2; grid-row: 1 / 4; grid-template-rows: 42px minmax(0, 1fr); border-left: 1px solid var(--border-strong); background: var(--canvas); }
.preview-pane[hidden] { display: none; }
.preview-pane > header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--border); background: var(--raised); }
.preview-pane > header > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.preview-pane > header strong { color: var(--bright); font-size: 11px; font-weight: 620; }
.preview-pane > header span { color: var(--muted); font: 8px/1 ui-monospace, monospace; }
.preview-pane > header button { display: grid; width: 28px; height: 28px; place-items: center; color: var(--muted); cursor: pointer; font-size: 18px; }
.preview-pane > header button:hover { background: var(--hover); color: var(--bright); }
.preview { min-width: 0; min-height: 0; overflow: hidden; background: var(--canvas); color: var(--text); color-scheme: dark; }
.preview iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--canvas); color-scheme: dark; }
.terminal.active { display: block; overflow: hidden; background: var(--canvas); }
#terminal-host { width: 100%; height: 100%; padding: 5px 0 0 8px; }
#terminal-host .xterm { height: 100%; }
#terminal-host .xterm-viewport { background-color: var(--canvas) !important; }
#terminal-output { height: 100%; margin: 0; overflow: auto; padding: 7px 11px; color: var(--text); background: var(--canvas); font: 12px/19px ui-monospace, monospace; white-space: pre-wrap; }
#terminal-output[hidden] { display: none; }
.plotter.active { display: grid; min-width: 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: var(--canvas); }
#plotter-legend { display: flex; min-height: 28px; align-items: center; gap: 13px; overflow-x: auto; padding: 4px 10px; border-bottom: 1px solid var(--border); color: var(--muted); white-space: nowrap; font: 11px/18px ui-monospace, monospace; }
.plotter-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.plotter-legend-item i { width: 9px; height: 9px; border-radius: 50%; }
.plotter-legend-item strong { color: var(--text); font-weight: 500; }
.plotter-waiting { color: var(--muted); }
#serial-plotter-canvas { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; }

.status-bar { grid-column: 1 / -1; grid-row: 3; display: flex; min-width: 0; align-items: center; background: var(--midnight-violet); border-top: 1px solid var(--border); color: var(--text); user-select: none; }
.status-item { display: flex; height: 100%; align-items: center; gap: 4px; padding: 0 7px; color: inherit; white-space: nowrap; font-size: 11px; }
button.status-item { cursor: pointer; }
button.status-item:hover { background: var(--hover); }
.status-item svg { width: 12px; height: 12px; }
.status-spacer { flex: 1; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.status-ready .status-dot { background: var(--success); }
.status-error .status-dot { background: var(--danger); }

@media (min-width: 681px) and (max-width: 1050px) {
  .example-browser-layout { grid-template-columns: 238px minmax(0, 1fr); }
  .example-results { grid-template-columns: minmax(0, 1fr); }
  .workbench.preview-open { grid-template-columns: minmax(0, 1fr) minmax(310px, 46vw); }
}

@media (max-width: 820px) {
  .sidebar-resizer { display: none; }
  :root { --sidebar-width: 0px; }
  .ide.sidebar-open { --sidebar-width: 250px; }
  .ide:not(.sidebar-open) .sidebar { display: none; }
  .command-bar { grid-template-columns: 40px minmax(180px, 1fr) auto; }
  .project-title { display: none; }
  .target-picker { min-width: 122px; }
  .secondary-action span { display: none; }
}

@media (min-width: 681px) and (max-width: 1280px), (pointer: coarse) and (min-width: 681px) {
  .ide[data-device-class="tablet"] { --sidebar-width: 252px; --command-height: 50px; --status-height: 25px; }
  .ide[data-device-class="tablet"] .sidebar { display: flex; }
  .ide[data-device-class="tablet"] .command-bar { grid-template-columns: 40px minmax(180px, 1fr) auto; }
  .ide[data-device-class="tablet"] .project-title { display: none; }
  .ide[data-device-class="tablet"] .command-actions { gap: 4px; }
  .ide[data-device-class="tablet"] .command-actions button,
  .ide[data-device-class="tablet"] #target-button,
  .ide[data-device-class="tablet"] #flash-transport,
  .ide[data-device-class="tablet"] .target-picker,
  .ide[data-device-class="tablet"] .run-actions { min-height: 38px; height: 38px; }
  .ide[data-device-class="tablet"] .target-option { min-height: 40px; font-size: 12px; }
  .ide[data-device-class="tablet"] .file,
  .ide[data-device-class="tablet"] .stdlib-package,
  .ide[data-device-class="tablet"] .stdlib-file,
  .ide[data-device-class="tablet"] .help-package { min-height: 36px; font-size: 12px; }
  .ide[data-device-class="tablet"] .section-title { min-height: 34px; font-size: 11px; }
  .ide[data-device-class="tablet"] .project-toolbar button { min-height: 38px; }
  .ide[data-device-class="tablet"] .project-action-menu { top: 111px; }
  .ide[data-device-class="tablet"] .project-action-menu button { min-height: 42px; font-size: 12px; }
  .ide[data-device-class="tablet"] .panel-tab { min-height: 38px; }
  .ide[data-device-class="tablet"] .panel-tabs { height: 38px; }
  .ide[data-device-class="tablet"] .panel-content { height: calc(100% - 38px); }
  .ide[data-device-class="tablet"] .editor-tab { width: 165px; }
}

@media (max-width: 680px) {
  .workspace-resizer { display: none; }
  .quick-open { padding: calc(12px + env(safe-area-inset-top)) 10px 10px; }
  .quick-open-field kbd { display: none; }
  .quick-open-results { max-height: calc(100vh - 100px - env(safe-area-inset-top)); }
  .quick-open-item { min-height: 54px; grid-template-columns: 24px minmax(0, 1fr); }
  .quick-open-item-detail { display: none; }
  html, body { height: 100%; overscroll-behavior: none; }
  .ide {
    width: 100%;
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(52px + env(safe-area-inset-top)) minmax(0, 1fr) calc(58px + env(safe-area-inset-bottom));
  }
  .command-bar, .status-bar { display: none; }

  .mobile-header {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: env(safe-area-inset-top) 10px 0;
    border-bottom: 1px solid var(--border);
    background: var(--raised);
  }
  .mobile-heading { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
  #mobile-step { overflow: hidden; color: var(--bright); font-size: 15px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
  #mobile-context { overflow: hidden; color: var(--muted); font: 10px/1.2 ui-monospace, monospace; white-space: nowrap; text-overflow: ellipsis; }
  .mobile-header-actions { display: flex; flex: 0 0 auto; gap: 7px; }
  #mobile-target-button { min-width: 64px; height: 40px; padding: 0 10px; border: 1px solid var(--accent-muted); border-radius: 5px; background: var(--accent-soft); color: var(--accent-muted); font-size: 12px; }
  .ide[data-mobile-view="editor"] #mobile-target-button { display: none; }
  .mobile-editor-actions { display: flex; flex: 0 0 auto; gap: 7px; }
  .mobile-editor-actions button { min-width: 88px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--raised-strong); color: var(--bright); font-size: 12px; font-weight: 650; }
  .mobile-editor-actions button.primary { border-color: var(--accent); background: var(--accent); color: var(--bright); }
  .mobile-editor-actions #mobile-run.deploying { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
  .mobile-editor-actions #mobile-run.deploying::before { width: 12px; height: 12px; flex: none; border: 2px solid #dccde866; border-top-color: var(--thistle); border-radius: 50%; animation: spin .8s linear infinite; content: ""; }
  .mobile-editor-actions button:disabled { border-color: var(--border-strong); background: var(--active); color: var(--muted); }

  .sidebar, .mobile-target-view, .workbench { grid-column: 1; grid-row: 2; min-width: 0; min-height: 0; }
  .sidebar { width: auto; border: 0; overflow: hidden; }
  .ide[data-mobile-view="files"] .sidebar { display: flex; }
  .sidebar-header { min-height: 64px; padding: 12px 16px; }
  .sidebar-header strong { font-size: 17px; }
  .project-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) 44px; padding: 9px 12px; }
  .project-toolbar button { height: 42px; font-size: 13px; }
  .section-title { height: 38px; padding: 0 12px; font-size: 12px; }
  .project-action-menu { top: 112px; right: 8px; left: 8px; min-width: 0; }
  .project-action-menu button, .file-action-menu button { min-height: 46px; font-size: 13px; }
  .ide-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 30px); }
  .ide-dialog input, .dialog-primary, .dialog-secondary, .dialog-danger { min-height: 42px; font-size: 13px; }
  .new-file-body label { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .new-file-body select { min-height: 42px; font-size: 13px; }
  .new-file-help, .new-file-body .dialog-error { margin-left: 0; }
  .project-kind-options label { min-height: 72px; }
  .snapshot-dialog { width: calc(100vw - 20px); }
  .snapshot-header { min-height: 78px !important; padding: 13px 15px !important; }
  .snapshot-header h2 { font-size: 17px; }
  .snapshot-layout { grid-template-columns: minmax(0, 1fr); }
  .snapshot-create-card { padding: 17px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .snapshot-card-icon { display: none; }
  .snapshot-create-card h3 { margin-top: 0; }
  .snapshot-create { margin-top: 13px; }
  .snapshot-item { min-height: 70px; }
  .snapshot-item button { min-height: 40px; }
  .example-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .example-dialog .dialog-body { height: 100dvh; max-height: none; }
  .example-dialog header { min-height: calc(92px + env(safe-area-inset-top)); padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
  .example-dialog h2 { font-size: 20px; }
  .example-dialog header p { max-width: 300px; font-size: 12px; }
  .mobile-setup { display: grid; gap: 7px; padding: 10px 16px 9px; border-bottom: 1px solid var(--border); background: var(--accent-soft); }
  .mobile-setup[data-state="done"] { background: var(--success-surface); }
  .mobile-setup[data-state="error"] { background: var(--danger-surface); }
  .mobile-setup-copy { display: grid; gap: 3px; }
  .mobile-setup-copy strong { color: var(--bright); font-size: 13px; font-weight: 650; }
  .mobile-setup-copy span { color: var(--text); font-size: 10px; line-height: 1.35; }
  .mobile-setup-copy small { color: var(--muted); font-size: 9px; line-height: 1.35; }
  .mobile-setup[data-state="done"] .mobile-setup-copy small { display: none; }
  .mobile-setup progress { width: 100%; height: 4px; border: 0; border-radius: 4px; accent-color: var(--success); }
  .mobile-setup ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
  .mobile-setup li { display: flex; min-width: 0; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
  .mobile-setup li > span { width: 7px; height: 7px; flex: none; border: 1px solid var(--muted); border-radius: 50%; }
  .mobile-setup li[data-state="active"] { color: var(--accent-muted); }
  .mobile-setup li[data-state="active"] > span { border-color: var(--focus); background: var(--focus); box-shadow: 0 0 0 3px #b2c98d29; }
  .mobile-setup li[data-state="done"] { color: var(--success); }
  .mobile-setup li[data-state="done"] > span { border-color: var(--success); background: var(--success); }
  .mobile-setup li[data-state="error"] { color: var(--danger); }
  .mobile-setup li[data-state="error"] > span { border-color: var(--danger); background: var(--danger); }
  .example-browser-layout { display: flex; min-height: 0; flex-direction: column; }
  .example-board-pane { flex: none; overflow: hidden; padding: 9px 0 7px; border-right: 0; border-bottom: 1px solid var(--border); }
  .example-pane-heading { display: flex; align-items: baseline; gap: 8px; padding: 0 16px 7px; }
  .example-pane-heading > strong { font-size: 13px; }
  .example-board-list { display: flex; align-items: flex-start; gap: 7px; overflow-x: auto; padding: 0 16px 3px; scroll-padding-inline: 16px; scroll-snap-type: x proximity; }
  .example-machine-group { align-self: center; padding: 0 5px; writing-mode: vertical-rl; }
  .example-board-row { display: flex; width: 142px; flex: 0 0 auto; flex-direction: column; scroll-snap-align: start; }
  .example-board-choice { width: 142px; min-height: 70px; flex: 0 0 auto; grid-template-columns: 50px minmax(0, 1fr); padding: 7px; border-color: var(--border); background: var(--raised); scroll-snap-align: start; }
  .example-board-choice strong { white-space: normal; }
  .example-board-all { width: 116px; min-height: 70px; flex: 0 0 auto; grid-template-columns: 38px minmax(0, 1fr); }
  .example-board-all-icon { width: 38px; height: 38px; }
  .board-artwork { width: 50px; height: 42px; }
  .example-board-docs { display: none; }
  .example-project-pane { flex: 1; }
  .example-filters { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; padding: 11px 12px 9px; }
  .example-filters input, .example-filters select { min-height: 42px; font-size: 13px; }
  .example-summary { padding: 0 12px 9px; }
  .example-summary span:last-child { display: none; }
  .example-results { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 0 12px calc(18px + env(safe-area-inset-bottom)); }
  .example-card { gap: 11px; padding: 14px; }
  .example-card-heading { align-items: flex-start; }
  .device-permission-dialog { width: calc(100vw - 20px); }
  .device-permission-dialog h2 { font-size: 19px; }
  .device-permission-steps p { font-size: 12px; }
  .pico-monitor-installer li p { font-size: 11px; }
  .pico-monitor-actions .dialog-secondary { min-height: 42px; }
  .device-capabilities { grid-template-columns: minmax(0, 1fr); }
  .device-capabilities small { font-size: 10px; }
  .file-tree { padding: 4px 0 8px; }
  .file-row, .folder-row { grid-template-columns: minmax(0, 1fr) 48px; }
  .file, .folder { height: 50px; padding-left: calc(16px + var(--tree-depth, 0) * 18px); font-size: 15px; cursor: pointer; }
  .file { grid-template-columns: 34px minmax(0, 1fr) 14px; padding-right: 6px; }
  .folder { grid-template-columns: 18px 28px minmax(0, 1fr); }
  .file-more { width: 44px; height: 42px; color: var(--muted); font-size: 12px; }
  .go-icon, .mod-icon, .c-icon, .rtg-icon { font-size: 11px; }
  .stdlib-tree { padding: 4px 0 18px; }
  .library-group { padding: 12px 16px 5px; font-size: 10px; }
  .library-subgroup { padding: 12px 16px 5px; font-size: 12px; }
  .stdlib-package, .stdlib-file { min-height: 46px; font-size: 14px; }
  .stdlib-package { grid-template-columns: 20px minmax(0, 1fr); padding: 0 16px; }
  .library-board-package .stdlib-package { padding-left: 28px; }
  .stdlib-file { grid-template-columns: 34px minmax(0, 1fr); padding: 0 16px 0 34px; }

  .mobile-target-view { overflow: auto; background: linear-gradient(var(--accent-soft) 0, var(--editor) 230px); }
  .ide[data-mobile-view="device"] .mobile-target-view { display: block; }
  .mobile-view-intro { display: flex; flex-direction: column; gap: 5px; padding: 22px 18px 15px; }
  .mobile-view-intro .mobile-view-kicker { color: var(--accent-muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
  .mobile-view-intro strong { overflow: hidden; color: var(--bright); font: 18px/1.25 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-view-intro span:last-child { color: var(--text); font-size: 12px; line-height: 1.4; }
  .mobile-device-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 18px 18px; border-bottom: 1px solid var(--border); }
  .mobile-device-actions button { min-height: 44px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--raised-strong); color: var(--bright); font-size: 13px; }
  .mobile-device-actions button.primary { border-color: var(--accent); background: var(--accent); color: var(--bright); }
  .mobile-device-actions button:disabled { border-color: var(--border); background: var(--active); color: var(--muted); }
  .mobile-transport-picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--sidebar); }
  .mobile-transport-picker[hidden] { display: none; }
  .mobile-transport-picker > div:first-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
  .mobile-transport-picker > div:first-child strong { color: var(--bright); font-size: 12px; font-weight: 550; }
  .mobile-transport-picker > div:first-child span { color: var(--muted); font-size: 9px; }
  .mobile-transport-picker > div { display: flex; }
  .mobile-transport-picker button { min-width: 82px; height: 42px; padding: 0 10px; border: 1px solid var(--border-strong); background: var(--raised); color: var(--text); font-size: 12px; }
  .mobile-transport-picker button + button { margin-left: -1px; }
  .mobile-transport-picker button[aria-checked="true"] { position: relative; z-index: 1; border-color: var(--focus); background: var(--accent-soft); color: var(--bright); }
  .mobile-transport-picker button:disabled { background: var(--raised); color: var(--muted); }
  .mobile-target-label { padding: 18px 18px 3px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
  .mobile-target-search { display: block; padding: 7px 18px 4px; }
  .mobile-target-search input { height: 42px; padding: 0 11px; font-size: 13px; }
  .mobile-target-list { padding: 3px 10px 16px; }
  .mobile-target-group { padding: 15px 9px 6px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-target-option { display: grid; width: 100%; min-height: 62px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 5px 10px; padding: 9px 10px; border-top: 1px solid var(--border); color: var(--text); text-align: left; }
  .mobile-target-name { grid-column: 1; grid-row: 1; overflow: hidden; font: 13px/1.25 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
  .target-capabilities { display: flex; min-width: 0; grid-column: 1; grid-row: 2; flex-wrap: wrap; gap: 5px; }
  .target-capability { padding: 2px 5px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--raised); color: var(--muted); font: 9px/1.2 system-ui, sans-serif; white-space: nowrap; }
  .target-capability[data-capability="browser"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-muted); }
  .target-capability[data-capability="flash"] { border-color: var(--warning); color: var(--warning); }
  .mobile-target-selected { grid-column: 2; grid-row: 1 / 3; color: transparent; font: 10px/1 system-ui, sans-serif; text-transform: uppercase; }
  .mobile-target-option[aria-selected="true"] { background: var(--accent-soft); color: var(--bright); }
  .mobile-target-option[aria-selected="true"] .mobile-target-selected { color: var(--accent-muted); }
  .mobile-device-console { margin: 0 10px calc(18px + env(safe-area-inset-bottom)); overflow: hidden; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--canvas); }
  .mobile-device-console > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--border); background: var(--raised); }
  .mobile-device-console strong { color: var(--bright); font-size: 11px; font-weight: 550; }
  .mobile-device-console span { color: var(--muted); font-size: 9px; }
  #mobile-device-output { max-height: 180px; margin: 0; overflow: auto; padding: 11px; color: var(--text); font: 11px/17px ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

  .workbench { display: none; grid-template-rows: 44px minmax(0, 1fr) 0; }
  .workbench.preview-open { grid-template-columns: minmax(0, 1fr); }
  .ide[data-mobile-view="editor"] .workbench { display: grid; }
  .ide[data-mobile-view="editor"] .panel { display: none; }
  .hex-view { grid-template-rows: 52px 27px minmax(0, 1fr); }
  .hex-view > header { padding: 0 8px 0 11px; }
  .editor-tabs { height: 44px; }
  .editor-tab { height: 43px; width: auto; min-width: 140px; font-size: 13px; }
  .editor-toolbar button { width: 44px; height: 43px; }
  .editor-toolbar #copy-to-playground { width: auto; min-width: 104px; padding: 0 9px; font-size: 11px; }
  .start-screen { padding: 24px 17px calc(30px + env(safe-area-inset-bottom)); place-items: start stretch; }
  .start-mark { width: 44px; height: 44px; }
  .start-card h1 { font-size: 30px; }
  .start-primary-actions { display: grid; }
  .start-primary-actions button { min-height: 44px; }
  .start-grid { grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
  .start-grid button { min-height: 66px; }
  .preview-pane { z-index: 30; grid-column: 1; grid-row: 1 / 4; }
  .help-view { padding: 22px 17px 50px; }
  .help-index { grid-template-columns: minmax(0, 1fr); padding: 10px 13px; }
  .help-package-title { font-size: 24px; }
  .help-overview, .help-doc { font-size: 12px; }

  .mobile-nav {
    grid-column: 1;
    grid-row: 3;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--border);
    background: var(--raised);
  }
  .mobile-nav button { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 11px; }
  .mobile-nav button svg { width: 17px; height: 17px; }
  .mobile-nav button.active { background: var(--hover); color: var(--bright); }
  .mobile-nav button.active svg { color: var(--accent-muted); }

  .mobile-flash-view {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    grid-template-rows: calc(66px + env(safe-area-inset-top)) 5px minmax(0, 1fr);
    background: var(--canvas);
    color: var(--text);
  }
  .mobile-flash-view > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: env(safe-area-inset-top) 14px 0; border-bottom: 1px solid var(--border); background: var(--sidebar); }
  .mobile-flash-view > header div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
  .mobile-flash-kicker { color: var(--accent-muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
  #mobile-flash-state { overflow: hidden; color: var(--bright); font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
  #mobile-flash-close { min-width: 58px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); background: var(--raised-strong); color: var(--bright); }
  #mobile-flash-progress { width: 100%; height: 5px; border: 0; border-radius: 0; accent-color: var(--success); }
  .mobile-flash-body { min-width: 0; min-height: 0; overflow: auto; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(var(--accent-soft), var(--canvas) 280px); }
  #mobile-flash-detail { min-height: 38px; margin: 0 0 18px; color: var(--text); font-size: 13px; line-height: 1.45; }
  .mobile-flash-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
  .mobile-flash-steps li { position: relative; display: grid; min-height: 64px; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; color: var(--muted); }
  .mobile-flash-steps li::after { position: absolute; top: 20px; bottom: 0; left: 8px; width: 1px; background: var(--border-strong); content: ""; }
  .mobile-flash-steps li:last-child::after { display: none; }
  .mobile-flash-steps li > span { z-index: 1; display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid var(--muted); border-radius: 50%; background: var(--accent-soft); }
  .mobile-flash-steps li > div { display: grid; align-content: start; gap: 4px; }
  .mobile-flash-steps strong { color: var(--text); font-size: 13px; font-weight: 600; }
  .mobile-flash-steps small { font-size: 10px; line-height: 1.35; }
  .mobile-flash-steps li[data-state="active"] > span { border-color: var(--focus); background: var(--focus); box-shadow: 0 0 0 4px #b2c98d29; }
  .mobile-flash-steps li[data-state="active"] strong { color: var(--bright); }
  .mobile-flash-steps li[data-state="active"] small { color: var(--accent-muted); }
  .mobile-flash-steps li[data-state="done"] > span { border-color: var(--success); background: var(--success); }
  .mobile-flash-steps li[data-state="done"] > span::after { color: var(--success-surface); font-size: 11px; font-weight: 800; content: "✓"; }
  .mobile-flash-steps li[data-state="done"] strong { color: var(--success); }
  .mobile-flash-steps li[data-state="error"] > span { border-color: var(--danger); background: var(--danger); }
  .mobile-flash-steps li[data-state="error"] strong, .mobile-flash-steps li[data-state="error"] small { color: var(--danger); }
  .mobile-flash-log { margin-top: 5px; border: 1px solid var(--border); border-radius: 6px; background: var(--canvas); }
  .mobile-flash-log summary { min-height: 44px; padding: 14px; color: var(--muted); cursor: pointer; font-size: 11px; }
  #mobile-flash-output { max-height: 220px; min-width: 0; margin: 0; overflow: auto; padding: 0 14px 14px; color: var(--text); font: 11px/18px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
