:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #050505;
  --bg-2: #080808;
  --surface-0: #070707;
  --surface-1: #0b0c0b;
  --surface-2: #0f1110;
  --surface-3: #141714;
  --surface-4: #181b19;
  --text-1: #f0f3f1;
  --text-2: #c0c7c2;
  --text-3: #808881;
  --text-4: #747d76;
  --accent: #339c5e;
  --accent-bright: #49b776;
  --accent-dim: rgba(51, 156, 94, .14);
  --accent-line: rgba(51, 156, 94, .34);
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.13);
  --warning: #b79b5a;
  --warning-bg: rgba(183,155,90,.09);
  --error: #c36b67;
  --error-bg: rgba(195,107,103,.09);
  --info: #6f8ea4;
  --shadow-xl: 0 24px 80px rgba(0,0,0,.44);
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius: 7px;
  --topbar-h: 46px;
  --status-h: 24px;
  --rail-w: 42px;
  --context-w: 218px;
  --ai-w: 326px;
  --bottom-h: 204px;
  --mono: "SFMono-Regular", "Roboto Mono", "Cascadia Code", "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; background: var(--bg); color: var(--text-1); overflow: hidden; }
body { font-size: 12px; line-height: 1.45; letter-spacing: -.005em; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, input, textarea { outline: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { box-shadow: 0 0 0 2px rgba(51,156,94,.22); border-color: var(--accent) !important; }
button:disabled { cursor: not-allowed !important; opacity: .38; filter: saturate(.4); }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(51,156,94,.35); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.09); border: 2px solid transparent; background-clip: padding-box; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.15); border: 2px solid transparent; background-clip: padding-box; }

.app-shell { height: 100vh; display: grid; grid-template-rows: var(--topbar-h) 1fr var(--status-h); background: var(--bg); }
.topbar { display: grid; grid-template-columns: 225px minmax(260px, 1fr) auto; height: var(--topbar-h); align-items: center; border-bottom: 1px solid var(--line); background: #060706; padding: 0 9px 0 12px; position: relative; z-index: 30; }
.topbar::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 128px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); opacity: .65; }
.brand-block { height: 100%; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--line); min-width: 0; }
.brand-block strong { font-size: 10px; font-weight: 780; letter-spacing: .18em; }
.brand-block > span { font-size: 8px; letter-spacing: .18em; color: var(--text-4); padding-left: 1px; }
.brand-symbol { position: relative; width: 17px; height: 17px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; align-items: end; }
.brand-symbol i { display: block; width: 100%; background: var(--accent); opacity: .78; }
.brand-symbol i:nth-child(1) { height: 6px; }
.brand-symbol i:nth-child(2) { height: 12px; }
.brand-symbol i:nth-child(3) { height: 9px; }
.project-context { height: 100%; display: flex; align-items: center; gap: 7px; padding-left: 14px; min-width: 0; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.project-context > strong { color: var(--text-2); font-weight: 560; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.context-branch { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); margin-left: 5px; }
.environment-badge { border: 1px solid var(--accent-line); color: #7bb994; background: var(--accent-dim); padding: 2px 6px; font-size: 8px; letter-spacing: .08em; font-weight: 730; clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 0 100%); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding-left: 10px; }
.build-indicator { display: flex; align-items: center; gap: 6px; max-width: 205px; color: var(--text-3); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.build-indicator i { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: var(--text-4); }
.build-indicator.success i { background: var(--accent-bright); box-shadow: 0 0 9px rgba(51,156,94,.45); }
.build-indicator.warning i { background: var(--warning); }
.build-indicator.error i { background: var(--error); }
.build-indicator.running i { background: var(--accent-bright); animation: softPulse 1.1s infinite; }
.command-trigger { min-width: 178px; height: 28px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #0a0b0a; color: var(--text-3); border-radius: var(--radius-sm); padding: 0 7px; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.command-trigger:hover { border-color: var(--line-strong); background: #0d0f0e; color: var(--text-2); }
.command-trigger span { flex: 1; text-align: left; }
kbd { font-family: inherit; font-size: 9px; border: 1px solid var(--line); background: #050505; color: var(--text-4); border-radius: 3px; padding: 2px 4px; box-shadow: inset 0 -1px rgba(255,255,255,.03); }
.avatar-button { width: 28px; height: 28px; border: 1px solid var(--line-strong); background: linear-gradient(145deg, #171a18, #0d0f0e); border-radius: 50%; font-size: 8px; font-weight: 750; color: var(--text-2); cursor: pointer; }

.workspace-body { min-height: 0; display: grid; grid-template-columns: var(--rail-w) var(--context-w) minmax(0, 1fr) var(--ai-w); background: var(--bg); }
.activity-rail { min-height: 0; border-right: 1px solid var(--line); background: #060706; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 8px 0; z-index: 12; }
.activity-rail > div { display: grid; gap: 4px; }
.activity-button { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-4); cursor: pointer; border-radius: var(--radius-sm); transition: background .12s ease, color .12s ease; }
.activity-button:hover { color: var(--text-2); background: rgba(255,255,255,.035); }
.activity-button.active { color: var(--text-1); background: rgba(255,255,255,.045); }
.activity-button.active::before { content: ""; position: absolute; left: -5px; height: 17px; width: 2px; background: var(--accent); box-shadow: 0 0 12px rgba(51,156,94,.45); }
.activity-count { position: absolute; right: 1px; top: 1px; min-width: 13px; height: 13px; display: grid; place-items: center; padding: 0 3px; background: var(--accent); color: #041108; border-radius: 8px; font-size: 7px; font-weight: 800; }
.context-panel { min-width: 0; overflow: auto; background: #080908; border-right: 1px solid var(--line); transition: width .16s ease, transform .16s ease; }
.context-header { min-height: 37px; padding: 0 9px 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 9px; letter-spacing: .12em; font-weight: 700; position: sticky; top: 0; background: rgba(8,9,8,.96); backdrop-filter: blur(8px); z-index: 3; }
.context-header small { color: var(--text-4); letter-spacing: 0; font-weight: 500; }
.context-meta { height: 27px; display: flex; align-items: center; gap: 7px; padding: 0 11px; color: var(--text-4); font-size: 8px; letter-spacing: .12em; border-bottom: 1px solid rgba(255,255,255,.045); }
.status-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--text-4); }
.status-dot.ok, .status-dot.success { background: var(--accent-bright); box-shadow: 0 0 7px rgba(51,156,94,.38); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--error); }
.tree-root { padding: 7px 0 4px; }
.tree-project { height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0 7px 0 11px; color: var(--text-2); font-size: 9px; letter-spacing: .06em; font-weight: 690; }
.tree-folder { height: 24px; display: flex; align-items: center; gap: 4px; color: var(--text-3); padding: 0 8px; font-size: 10px; }
.tree-folder svg { transform: rotate(90deg); color: var(--text-4); }
.tree-items { display: grid; }
.root-files { margin-top: 4px; }
.tree-file { height: 26px; width: 100%; display: grid; grid-template-columns: 20px minmax(0,1fr) 9px; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--text-3); text-align: left; padding: 0 7px 0 25px; cursor: pointer; position: relative; }
.root-files .tree-file { padding-left: 11px; }
.tree-file:hover { background: rgba(255,255,255,.03); color: var(--text-2); }
.tree-file.active { background: rgba(51,156,94,.07); color: var(--text-1); }
.tree-file.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--accent); }
.tree-file > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-glyph { font-family: var(--mono); font-size: 7px; color: var(--text-4); letter-spacing: -.08em; }
.file-glyph.javascript { color: #a99b5a; }
.file-glyph.css { color: #6c8fad; }
.file-glyph.html { color: #b27d67; }
.file-glyph.json { color: #8b9e7d; }
.dirty-dot, .tab-dirty { width: 5px; height: 5px; background: var(--accent-bright); border-radius: 50%; display: block; }
.outline-section { margin-top: 6px; border-top: 1px solid var(--line); }
.section-rule { height: 31px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; color: var(--text-4); font-size: 8px; letter-spacing: .12em; font-weight: 700; border-top: 1px solid rgba(255,255,255,.035); border-bottom: 1px solid rgba(255,255,255,.035); }
.section-rule small { letter-spacing: 0; font-weight: 500; max-width: 95px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-row { width: 100%; min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 0 10px 0 18px; background: transparent; border: 0; color: var(--text-3); cursor: pointer; text-align: left; }
.outline-row:hover { color: var(--text-2); background: rgba(255,255,255,.025); }
.outline-row small { color: var(--text-4); font-size: 8px; }

.context-search { margin: 9px; height: 30px; display: grid; grid-template-columns: 20px 1fr; align-items: center; background: #050605; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 6px; color: var(--text-4); }
.context-search input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text-2); font-size: 10px; }
.context-search input::placeholder { color: var(--text-4); }
.search-results { display: grid; }
.search-result { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid rgba(255,255,255,.045); background: transparent; color: var(--text-2); cursor: pointer; }
.search-result:hover { background: rgba(255,255,255,.025); }
.search-result strong { font-size: 10px; font-weight: 520; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result small { color: var(--text-4); font-size: 8px; }
.search-result code { grid-column: 1 / -1; color: var(--text-4); font-family: var(--mono); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.local-notice { display: flex; gap: 8px; padding: 9px 10px; margin: 9px; background: var(--warning-bg); border: 1px solid rgba(183,155,90,.14); color: #9c8c62; font-size: 9px; line-height: 1.45; border-radius: var(--radius-sm); }
.local-notice svg { flex: 0 0 auto; margin-top: 1px; }
.commit-box { display: grid; gap: 6px; padding: 0 9px 9px; }
.commit-box textarea, .plan-edit textarea, .visual-inspector textarea { resize: vertical; min-height: 48px; border: 1px solid var(--line); background: #050605; color: var(--text-2); border-radius: var(--radius-sm); padding: 7px 8px; }
.count-badge { min-width: 17px; height: 17px; display: grid; place-items: center; background: var(--accent-dim); color: #83c39c; border: 1px solid var(--accent-line); border-radius: 9px; font-size: 8px; letter-spacing: 0; }
.change-row { width: 100%; min-height: 27px; display: grid; grid-template-columns: 16px minmax(0,1fr) auto; align-items: center; gap: 5px; padding: 0 10px; border: 0; background: transparent; color: var(--text-3); text-align: left; cursor: pointer; }
.change-row:hover { background: rgba(255,255,255,.025); color: var(--text-2); }
.change-row > span { color: #d0ac61; font-family: var(--mono); font-size: 8px; }
.change-row strong { font-size: 9px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change-row small { color: var(--text-4); font-size: 8px; }
.commit-list { display: grid; }
.commit-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 7px; align-items: center; padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.035); }
.commit-row code { font-family: var(--mono); color: #7fb693; font-size: 8px; }
.commit-row span { color: var(--text-3); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-row small { color: var(--text-4); font-size: 8px; }
.dependency-list { display: grid; padding-bottom: 5px; }
.dependency-row { min-height: 44px; display: grid; grid-template-columns: 24px 1fr auto; gap: 7px; align-items: center; padding: 4px 10px; border-bottom: 1px solid rgba(255,255,255,.035); }
.package-cube { color: var(--text-4); }
.dependency-row strong { display: block; font-size: 9px; font-weight: 570; color: var(--text-2); }
.dependency-row small { display: block; color: var(--text-4); font-size: 8px; margin-top: 2px; }
.env-row { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 4px 10px; border-bottom: 1px solid rgba(255,255,255,.035); gap: 8px; }
.env-row code { font-family: var(--mono); color: var(--text-2); font-size: 8px; }
.env-row small { display: block; color: var(--text-4); font-size: 8px; }
.settings-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; padding: 8px; border-bottom: 1px solid var(--line); }
.settings-tabs button { border: 1px solid transparent; background: transparent; color: var(--text-4); text-transform: capitalize; padding: 5px 4px; border-radius: var(--radius-xs); cursor: pointer; font-size: 9px; }
.settings-tabs button:hover { color: var(--text-2); background: rgba(255,255,255,.025); }
.settings-tabs button.active { color: var(--text-1); border-color: var(--line); background: #0d0f0e; }
.settings-body { padding: 10px; }
.setting-copy h3 { margin: 0 0 5px; font-size: 11px; font-weight: 620; }
.setting-copy p { margin: 0 0 12px; color: var(--text-4); font-size: 9px; line-height: 1.55; }
.field-label { display: grid; gap: 5px; color: var(--text-3); font-size: 9px; }
.field-label input, .settings-row input { width: 100%; height: 30px; border: 1px solid var(--line); background: #050605; color: var(--text-2); border-radius: var(--radius-sm); padding: 0 8px; }
.setting-actions { display: grid; gap: 6px; margin-top: 12px; }
.settings-table, .integration-list, .permissions-table { display: grid; border-top: 1px solid var(--line); margin-bottom: 10px; }
.settings-row { display: grid; grid-template-columns: 1fr; gap: 5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.settings-row code { font-family: var(--mono); font-size: 8px; color: var(--text-2); }
.settings-row small { display: block; color: var(--text-4); font-size: 8px; }
.integration-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.integration-row strong { display: block; font-size: 9px; font-weight: 600; }
.integration-row small { display: block; color: var(--text-4); font-size: 8px; line-height: 1.45; }
.integration-row .state-pill { grid-column: 1 / -1; width: max-content; }
.permission-row { display: grid; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.permission-row strong { font-size: 9px; }
.permission-row span { color: var(--text-3); font-size: 8px; }
.permission-row small { color: var(--text-4); font-size: 8px; }

.work-area { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #070807; overflow: hidden; }
.primary-workbench { min-height: 0; display: grid; grid-template-columns: minmax(350px, 1.08fr) minmax(310px, .92fr); border-bottom: 1px solid var(--line); }
.editor-pane, .preview-pane { min-width: 0; min-height: 0; display: grid; overflow: hidden; background: #070807; }
.editor-pane { grid-template-rows: 34px 27px minmax(0,1fr) 21px; border-right: 1px solid var(--line); }
.preview-pane { grid-template-rows: 34px minmax(0,1fr); background: #090a09; }
.pane-tabs { height: 34px; min-width: 0; display: flex; align-items: stretch; justify-content: space-between; background: #080908; border-bottom: 1px solid var(--line); }
.tab-strip { min-width: 0; display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab-strip::-webkit-scrollbar { display: none; }
.editor-tab { min-width: 98px; max-width: 145px; display: flex; border-right: 1px solid rgba(255,255,255,.055); border-top: 1px solid transparent; background: #080908; position: relative; }
.editor-tab.active { background: #0b0c0b; border-top-color: var(--accent); }
.tab-select { min-width: 0; flex: 1; display: grid; grid-template-columns: 17px minmax(0,1fr) 7px; align-items: center; gap: 3px; padding: 0 5px 0 8px; border: 0; background: transparent; color: var(--text-4); text-align: left; cursor: pointer; }
.editor-tab.active .tab-select { color: var(--text-2); }
.tab-select > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.tab-close { width: 20px; border: 0; background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; }
.editor-tab:hover .tab-close, .editor-tab.active .tab-close { color: var(--text-4); }
.tab-close:hover { color: var(--text-1) !important; }
.pane-actions { flex: 0 0 auto; display: flex; gap: 4px; align-items: center; padding: 0 5px; border-left: 1px solid var(--line); }
.editor-breadcrumb { height: 27px; display: flex; align-items: center; gap: 4px; padding: 0 9px; color: var(--text-4); background: #090a09; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 8px; }
.editor-breadcrumb span:nth-of-type(2) { color: var(--text-3); }
.editor-language { margin-left: auto; color: #738279; }
.code-area { min-height: 0; display: grid; grid-template-columns: 42px 1fr; background: #080908; overflow: hidden; }
.line-numbers { min-height: 0; overflow: hidden; padding: 11px 0 40px; background: #070807; border-right: 1px solid rgba(255,255,255,.025); color: #3f4541; font: 10px/1.62 var(--mono); user-select: none; text-align: right; }
.line-numbers span { display: block; padding-right: 9px; height: 16.2px; }
#code-editor { width: 100%; height: 100%; resize: none; border: 0; background: #080908; color: #c6cec9; caret-color: var(--accent-bright); padding: 11px 14px 40px; font: 10px/1.62 var(--mono); tab-size: 2; white-space: pre; overflow: auto; }
.editor-statusbar { height: 21px; display: flex; align-items: center; justify-content: flex-end; gap: 13px; padding: 0 8px; border-top: 1px solid rgba(255,255,255,.045); background: #070807; color: var(--text-4); font-size: 8px; }
.editor-statusbar span:first-child { margin-right: auto; color: #6f8c79; }

.preview-toolbar { height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 0 9px; border-bottom: 1px solid var(--line); background: #080908; }
.preview-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.preview-title strong { font-size: 8px; letter-spacing: .13em; font-weight: 720; color: var(--text-2); }
.preview-title small { color: var(--text-4); font-size: 8px; }
.preview-actions { display: flex; align-items: center; gap: 3px; }
.device-switch { display: flex; align-items: center; border: 1px solid var(--line); background: #050605; border-radius: 4px; padding: 1px; }
.device-switch button { width: 23px; height: 20px; border: 0; background: transparent; color: var(--text-4); cursor: pointer; border-radius: 3px; font-size: 8px; }
.device-switch button:hover { color: var(--text-2); }
.device-switch button.active { color: var(--text-1); background: #141614; }
.preview-stage { min-height: 0; position: relative; display: flex; justify-content: center; align-items: stretch; padding: 8px; overflow: auto; background:
  linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
  #070807; background-size: 24px 24px; }
.preview-stage.mobile, .preview-stage.tablet { align-items: flex-start; }
.browser-frame { min-height: 100%; max-width: 100%; display: grid; grid-template-rows: 24px minmax(0,1fr); background: #0b0c0b; border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0,0,0,.25); transition: width .18s cubic-bezier(.2,.8,.2,1); }
.preview-stage.mobile .browser-frame { min-height: min(760px, calc(100vh - 170px)); }
.browser-chrome { min-width: 0; display: grid; grid-template-columns: 6px 6px 6px minmax(0,1fr); gap: 5px; align-items: center; padding: 0 7px; background: #101210; border-bottom: 1px solid var(--line); }
.browser-chrome > span { width: 5px; height: 5px; border-radius: 50%; background: #363b37; }
.browser-chrome > span:nth-child(1) { background: #6d4a47; }
.browser-chrome > span:nth-child(2) { background: #756845; }
.browser-chrome > span:nth-child(3) { background: #3f644e; }
.browser-chrome > div { justify-self: center; max-width: 74%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #090a09; border: 1px solid rgba(255,255,255,.045); border-radius: 3px; padding: 1px 8px; color: #505751; font-size: 7px; font-family: var(--mono); }
#preview-frame { width: 100%; height: 100%; min-height: 300px; border: 0; background: #080a08; }
.visual-inspector { position: absolute; right: 14px; top: 14px; width: min(258px, calc(100% - 28px)); display: grid; gap: 10px; padding: 12px; background: rgba(10,12,10,.97); border: 1px solid var(--line-strong); border-top-color: var(--accent-line); box-shadow: var(--shadow-xl); border-radius: var(--radius); z-index: 8; }
.inspector-head { display: flex; align-items: center; justify-content: space-between; }
.inspector-head > div { display: grid; }
.inspector-head span { color: var(--text-2); font-size: 8px; letter-spacing: .13em; font-weight: 700; }
.inspector-head small { color: var(--text-4); font-size: 8px; }
.visual-inspector label { display: grid; gap: 5px; color: var(--text-3); font-size: 8px; }
.color-field { height: 32px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #050605; padding: 4px 7px; border-radius: var(--radius-sm); }
.color-field input { width: 28px; height: 20px; border: 0; background: transparent; padding: 0; }
.color-field code { font: 9px var(--mono); color: var(--text-3); }
.inspector-note { border-left: 1px solid var(--accent); padding-left: 8px; color: var(--text-4); font-size: 8px; line-height: 1.55; }
.inspector-note code { font-family: var(--mono); color: var(--text-3); }

.bottom-panel { min-height: 28px; height: var(--bottom-h); background: #070807; overflow: hidden; transition: height .15s ease; }
.bottom-panel.closed { height: 28px; }
.bottom-tabs { height: 28px; display: flex; align-items: stretch; justify-content: space-between; border-bottom: 1px solid var(--line); background: #080908; }
.bottom-tabs > div { display: flex; align-items: stretch; }
.bottom-tabs button[data-bottom-tab] { border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--text-4); padding: 0 10px; font-size: 8px; cursor: pointer; }
.bottom-tabs button[data-bottom-tab]:hover { color: var(--text-2); }
.bottom-tabs button[data-bottom-tab].active { color: var(--text-2); border-bottom-color: var(--accent); }
.bottom-actions { padding: 0 5px; }
.bottom-actions button:last-child svg { transform: rotate(90deg); }
.bottom-panel.closed .bottom-actions button:last-child svg { transform: rotate(-90deg); }
.bottom-content { height: calc(var(--bottom-h) - 28px); min-height: 0; overflow: auto; }
.terminal-view { min-height: 100%; display: grid; grid-template-rows: minmax(0,1fr) 28px; }
.terminal-output { min-height: 0; overflow: auto; padding: 6px 10px 12px; font: 9px/1.62 var(--mono); }
.terminal-line { display: grid; grid-template-columns: 13px 1fr; gap: 4px; color: var(--text-4); }
.terminal-line code { font: inherit; color: inherit; white-space: pre-wrap; }
.terminal-line.command { color: var(--text-2); margin-top: 3px; }
.terminal-line.success { color: #6fa984; }
.terminal-line.error { color: #b96d68; }
.terminal-line.warning { color: #a38d5b; }
.terminal-commandbar { display: flex; align-items: center; gap: 6px; border-top: 1px solid rgba(255,255,255,.04); padding: 0 7px; color: var(--text-4); }
.terminal-commandbar code { font: 8px var(--mono); margin-right: auto; }
.log-view, .problem-view { min-height: 100%; overflow: auto; padding: 5px 0; }
.log-line { min-height: 24px; display: grid; grid-template-columns: 55px 1fr; gap: 8px; align-items: start; padding: 4px 10px; border-bottom: 1px solid rgba(255,255,255,.025); }
.log-line span { color: var(--text-4); font-size: 7px; letter-spacing: .08em; }
.log-line code { font: 9px/1.45 var(--mono); color: var(--text-3); white-space: pre-wrap; }
.log-line.error code { color: #b96d68; }
.log-line.warn code { color: #a38d5b; }
.problem-row { width: 100%; min-height: 29px; display: grid; grid-template-columns: 18px minmax(0,1fr) auto auto; gap: 8px; align-items: center; padding: 3px 10px; border: 0; border-bottom: 1px solid rgba(255,255,255,.03); background: transparent; color: var(--text-3); text-align: left; cursor: pointer; }
.problem-row:hover { background: rgba(255,255,255,.02); }
.problem-row svg { color: var(--warning); }
.problem-row.error svg { color: var(--error); }
.problem-row strong { font-size: 9px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.problem-row code { font: 8px var(--mono); color: var(--text-4); }
.problem-row small { font-size: 7px; color: var(--text-4); }
.history-view { display: grid; grid-template-columns: .9fr 1.1fr; min-height: 100%; }
.checkpoint-column { border-right: 1px solid var(--line); min-width: 0; }
.toolwell-head { height: 27px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; color: var(--text-4); font-size: 8px; letter-spacing: .1em; border-bottom: 1px solid rgba(255,255,255,.03); }
.checkpoint-row { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.035); }
.checkpoint-row > div { min-width: 0; flex: 1; }
.checkpoint-row strong { display: block; color: var(--text-3); font-size: 9px; font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checkpoint-row small { display: block; color: var(--text-4); font-size: 7px; }
.event-column { min-width: 0; }
.event-row { min-height: 36px; display: grid; grid-template-columns: 8px 1fr auto; gap: 6px; align-items: start; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.03); }
.event-row > i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-4); margin-top: 4px; }
.event-row.ai > i, .event-row.validation > i, .event-row.approval > i { background: var(--accent-bright); }
.event-row.error > i { background: var(--error); }
.event-row strong { display: block; color: var(--text-3); font-size: 8px; font-weight: 560; }
.event-row small { display: block; color: var(--text-4); font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row time { color: var(--text-4); font-size: 7px; }

.ai-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 43px 43px minmax(0,1fr) auto; border-left: 1px solid var(--line); background: #080908; overflow: hidden; position: relative; z-index: 15; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 0 9px; border-bottom: 1px solid var(--line); }
.ai-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ai-mark { width: 25px; height: 25px; display: grid; place-items: center; color: #78bb92; background: var(--accent-dim); border: 1px solid var(--accent-line); clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 0 100%); }
.ai-title strong { display: block; color: var(--text-2); font-size: 8px; letter-spacing: .13em; font-weight: 760; }
.ai-title small { display: block; color: var(--text-4); font-size: 8px; }
.ai-context-strip { display: grid; grid-template-columns: 1.6fr .65fr .75fr; border-bottom: 1px solid var(--line); background: #070807; }
.ai-context-strip > div { min-width: 0; padding: 7px 8px; border-right: 1px solid rgba(255,255,255,.045); }
.ai-context-strip > div:last-child { border-right: 0; }
.ai-context-strip span { display: block; color: var(--text-4); font-size: 7px; letter-spacing: .1em; }
.ai-context-strip strong { display: block; color: var(--text-3); font-size: 8px; font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ai-scroll { min-height: 0; overflow: auto; padding: 10px 10px 16px; }
.ai-system-note { display: grid; grid-template-columns: 16px 1fr; gap: 6px; padding: 8px; background: var(--warning-bg); border: 1px solid rgba(183,155,90,.12); border-radius: var(--radius-sm); color: #8f815f; margin-bottom: 12px; }
.ai-system-note p { margin: 0; font-size: 8px; line-height: 1.55; }
.ai-system-note svg { margin-top: 1px; }
.ai-empty { min-height: 320px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 18px 5px; }
.empty-glyph { width: 38px; height: 38px; display: grid; place-items: center; color: #72ad88; border: 1px solid var(--accent-line); background: linear-gradient(145deg, rgba(51,156,94,.12), rgba(255,255,255,.015)); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); }
.ai-empty h3 { margin: 14px 0 5px; font-size: 15px; letter-spacing: -.02em; font-weight: 610; }
.ai-empty p { margin: 0; max-width: 250px; color: var(--text-4); line-height: 1.55; font-size: 9px; }
.prompt-suggestions { display: grid; width: 100%; gap: 5px; margin-top: 15px; }
.prompt-suggestions button { width: 100%; min-height: 30px; display: flex; align-items: center; padding: 0 8px; border: 1px solid var(--line); background: rgba(255,255,255,.015); color: var(--text-3); border-radius: var(--radius-sm); cursor: pointer; text-align: left; font-size: 9px; }
.prompt-suggestions button:hover { color: var(--text-1); border-color: var(--line-strong); background: rgba(255,255,255,.028); }
.ai-request { margin: 4px 0 12px; }
.ai-request > span { color: var(--text-4); font-size: 7px; letter-spacing: .12em; font-weight: 700; }
.ai-request p { margin: 4px 0 0; padding: 8px 9px; border-left: 1px solid var(--line-strong); background: rgba(255,255,255,.015); color: var(--text-2); font-size: 9px; line-height: 1.55; }
.analysis-state { position: relative; overflow: hidden; display: grid; gap: 2px; padding: 12px 10px; border: 1px solid var(--line); background: #090b09; }
.analysis-state span { color: var(--text-2); font-size: 9px; }
.analysis-state small { color: var(--text-4); font-size: 8px; }
.scan-line { position: absolute; left: 0; top: 0; width: 35%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-bright), transparent); animation: scan 1.15s linear infinite; }
.plan-surface { border: 1px solid var(--line-strong); background: #090b09; position: relative; overflow: hidden; }
.plan-surface::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: #242824; }
.plan-surface.approved::before, .plan-surface.executing::before, .plan-surface.executed::before { background: var(--accent); box-shadow: 0 0 14px rgba(51,156,94,.28); }
.plan-surface.error::before { background: var(--error); }
.plan-head { min-height: 48px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 9px 9px 8px 11px; border-bottom: 1px solid var(--line); }
.plan-head > div { min-width: 0; }
.plan-head span:first-child { display: block; color: var(--text-4); font-size: 7px; letter-spacing: .12em; }
.plan-head strong { display: block; margin-top: 3px; color: var(--text-2); font-size: 10px; font-weight: 610; line-height: 1.35; }
.plan-state { color: var(--text-4); border: 1px solid var(--line); padding: 2px 4px; border-radius: 3px; font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }
.plan-warning { display: grid; grid-template-columns: 16px 1fr; gap: 5px; padding: 8px 10px; color: #9e8a58; background: var(--warning-bg); border-bottom: 1px solid rgba(183,155,90,.12); font-size: 8px; line-height: 1.5; }
.plan-steps { list-style: none; margin: 0; padding: 0; }
.plan-steps li { min-height: 62px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; gap: 7px; padding: 9px 8px 9px 10px; border-bottom: 1px solid rgba(255,255,255,.045); position: relative; }
.plan-steps li.running { background: rgba(51,156,94,.035); }
.plan-steps li.running::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 46%; background: linear-gradient(90deg, var(--accent), transparent); animation: grow 1.1s ease-in-out infinite alternate; }
.plan-steps li.complete .step-index { border-color: var(--accent-line); color: #79b990; background: var(--accent-dim); }
.step-index { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--text-4); font: 7px var(--mono); border-radius: 50%; }
.plan-steps strong { display: block; color: var(--text-2); font-size: 9px; font-weight: 570; }
.plan-steps span { display: block; color: var(--text-4); font-size: 8px; line-height: 1.45; margin-top: 2px; }
.plan-steps code { display: block; color: #64736a; font: 7px var(--mono); margin-top: 4px; }
.step-state { color: var(--text-4); font-size: 7px; font-style: normal; text-transform: uppercase; }
.plan-controls { display: grid; grid-template-columns: auto auto 1fr 1fr; gap: 4px; padding: 7px; background: #080908; }
.plan-controls .primary-button { justify-content: center; }
.plan-edit { padding: 9px; display: grid; gap: 8px; }
.plan-edit label { display: grid; gap: 5px; color: var(--text-4); font-size: 8px; }
.plan-edit > div { display: flex; justify-content: flex-end; gap: 5px; }
.ai-result { display: grid; grid-template-columns: 22px 1fr; gap: 7px; margin-top: 8px; padding: 9px; border: 1px solid var(--line); }
.ai-result.success { border-color: rgba(51,156,94,.2); background: rgba(51,156,94,.04); color: #77b58c; }
.ai-result.error { border-color: rgba(195,107,103,.2); background: var(--error-bg); color: #bc7772; }
.ai-result strong { display: block; font-size: 9px; }
.ai-result p { margin: 2px 0 0; color: var(--text-4); font-size: 8px; line-height: 1.5; }
.ai-composer { margin: 0; padding: 8px; border-top: 1px solid var(--line); background: #070807; }
.ai-composer textarea { width: 100%; min-height: 58px; max-height: 130px; resize: vertical; border: 1px solid var(--line-strong); border-bottom: 0; background: #0a0b0a; color: var(--text-2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 9px; font-size: 10px; line-height: 1.5; }
.ai-composer textarea::placeholder { color: var(--text-4); }
.composer-foot { min-height: 31px; display: flex; align-items: center; justify-content: space-between; padding: 0 5px 0 7px; border: 1px solid var(--line-strong); border-top: 1px solid rgba(255,255,255,.04); background: #0a0b0a; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.context-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--text-4); border: 1px solid var(--line); background: #070807; padding: 3px 5px; border-radius: 3px; font-size: 8px; }
.primary-icon-button { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(51,156,94,.42); background: var(--accent); color: #031009; border-radius: 4px; cursor: pointer; }
.primary-icon-button:hover { background: var(--accent-bright); }

.status-rail { height: var(--status-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 8px 0 50px; border-top: 1px solid var(--line); background: #060706; color: var(--text-4); font-size: 8px; position: relative; z-index: 25; }
.status-rail > div { display: flex; align-items: center; gap: 13px; }
.status-rail span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.status-rail > div:first-child span:first-child { color: #699579; }
.mobile-nav { display: none; }

.icon-button { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--text-4); border-radius: var(--radius-sm); cursor: pointer; transition: color .12s ease, border-color .12s ease, background .12s ease; }
.icon-button:hover:not(:disabled) { color: var(--text-2); border-color: var(--line); background: rgba(255,255,255,.025); }
.icon-button.compact { width: 22px; height: 22px; }
.primary-button, .secondary-button, .danger-button { min-height: 27px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: var(--radius-sm); padding: 0 9px; font-size: 9px; cursor: pointer; transition: border-color .12s ease, background .12s ease, color .12s ease; }
.primary-button { border: 1px solid #3ea86a; background: var(--accent); color: #031009; font-weight: 690; }
.primary-button:hover:not(:disabled) { background: var(--accent-bright); border-color: var(--accent-bright); }
.secondary-button { border: 1px solid var(--line-strong); background: #0b0d0b; color: var(--text-3); }
.secondary-button:hover:not(:disabled), .secondary-button.active { border-color: rgba(255,255,255,.17); color: var(--text-1); background: #111311; }
.secondary-button.approved { border-color: var(--accent-line); color: #78b68d; background: var(--accent-dim); }
.danger-button { border: 1px solid rgba(195,107,103,.22); background: rgba(195,107,103,.06); color: #a86d69; }
.danger-button:hover:not(:disabled) { color: #cf817b; border-color: rgba(195,107,103,.35); }
.danger-button.ghost { background: transparent; border-color: var(--line); color: var(--text-4); }
.full { width: 100%; }
.small { min-height: 24px; padding: 0 7px; font-size: 8px; }
.tiny { min-height: 22px; height: 22px; padding: 0 6px; font-size: 8px; }
.secondary-button.top { min-height: 28px; }
.state-pill { display: inline-flex; align-items: center; width: max-content; height: 17px; padding: 0 5px; border-radius: 8px; border: 1px solid var(--line); font-size: 7px; color: var(--text-4); white-space: nowrap; }
.state-pill.success { color: #73aa87; border-color: rgba(51,156,94,.22); background: rgba(51,156,94,.06); }
.state-pill.warning { color: #9d8958; border-color: rgba(183,155,90,.18); background: var(--warning-bg); }
.state-pill.error { color: #b66e69; border-color: rgba(195,107,103,.2); background: var(--error-bg); }
.state-pill.running { color: #7bb692; border-color: var(--accent-line); background: var(--accent-dim); }
.state-pill.muted { color: var(--text-4); }
.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-4); text-align: center; padding: 16px; }
.empty-state.compact { min-height: 88px; }
.empty-state p { max-width: 220px; margin: 4px 0 0; font-size: 9px; line-height: 1.5; }
.empty-state span { color: var(--text-4); }
.success-empty span { color: #6fa984; }
.spinner { width: 11px; height: 11px; border: 1px solid rgba(255,255,255,.12); border-top-color: var(--accent-bright); border-radius: 50%; animation: spin .72s linear infinite; }

.command-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: min(16vh, 140px); background: rgba(0,0,0,.58); backdrop-filter: blur(5px); }
.command-palette { width: min(620px, calc(100vw - 32px)); max-height: min(540px, 70vh); display: grid; grid-template-rows: 46px minmax(0,1fr) 27px; overflow: hidden; background: #0a0b0a; border: 1px solid rgba(255,255,255,.15); border-top-color: rgba(51,156,94,.5); box-shadow: 0 28px 90px rgba(0,0,0,.65); border-radius: 7px; }
.command-input { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 0 11px; border-bottom: 1px solid var(--line); color: var(--text-4); }
.command-input input { width: 100%; border: 0; background: transparent; color: var(--text-1); font-size: 12px; }
.command-results { overflow: auto; padding: 5px; }
.command-item { width: 100%; min-height: 36px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: 7px; border: 1px solid transparent; background: transparent; color: var(--text-3); text-align: left; padding: 0 7px; border-radius: var(--radius-sm); cursor: pointer; }
.command-item:hover, .command-item:focus { color: var(--text-1); background: rgba(255,255,255,.035); border-color: var(--line); }
.command-item > span { width: 23px; height: 23px; display: grid; place-items: center; background: #111311; border: 1px solid var(--line); border-radius: 4px; color: var(--text-4); }
.command-item strong { font-size: 10px; font-weight: 540; }
.command-item small { color: var(--text-4); font-size: 8px; }
.command-footer { display: flex; align-items: center; gap: 16px; padding: 0 9px; border-top: 1px solid var(--line); color: var(--text-4); font-size: 8px; }
.command-footer span:last-child { margin-left: auto; }
.toast-region { position: fixed; right: 12px; top: 58px; width: min(340px, calc(100vw - 24px)); display: grid; gap: 7px; z-index: 120; pointer-events: none; }
.app-toast { transform: translateX(15px); opacity: 0; display: grid; grid-template-columns: 22px 1fr 20px; gap: 7px; padding: 9px; background: #0d0f0e; border: 1px solid var(--line-strong); border-left-color: var(--warning); box-shadow: var(--shadow-xl); border-radius: var(--radius-sm); pointer-events: auto; transition: opacity .16s ease, transform .16s ease; }
.app-toast.visible { transform: translateX(0); opacity: 1; }
.app-toast.success { border-left-color: var(--accent); }
.app-toast.error { border-left-color: var(--error); }
.app-toast > span { color: var(--warning); }
.app-toast.success > span { color: var(--accent-bright); }
.app-toast.error > span { color: var(--error); }
.app-toast strong { display: block; font-size: 9px; }
.app-toast p { margin: 2px 0 0; color: var(--text-4); font-size: 8px; line-height: 1.45; }
.app-toast button { width: 20px; height: 20px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-4); cursor: pointer; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes softPulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes scan { from { transform: translateX(-120%); } to { transform: translateX(400%); } }
@keyframes grow { from { width: 18%; } to { width: 72%; } }

@media (max-width: 1400px) {
  :root { --context-w: 195px; --ai-w: 300px; --bottom-h: 190px; }
  .primary-workbench { grid-template-columns: minmax(340px, 1fr) minmax(300px, .82fr); }
  .command-trigger { min-width: 150px; }
  .command-trigger span { max-width: 88px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .build-indicator { display: none; }
}

@media (max-width: 1180px) {
  :root { --ai-w: 286px; }
  .workspace-body { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) var(--ai-w); }
  .context-panel { width: 0; transform: translateX(-100%); border-right: 0; overflow: hidden; }
  .project-context > span:first-child, .project-context > svg { display: none; }
  .topbar { grid-template-columns: 150px minmax(220px,1fr) auto; }
  .brand-block { border-right: 0; }
}

@media (max-width: 930px) {
  :root { --ai-w: 272px; --bottom-h: 178px; }
  .primary-workbench { grid-template-columns: minmax(330px, 1fr) minmax(275px, .75fr); }
  .command-trigger { min-width: 31px; width: 31px; }
  .command-trigger span, .command-trigger kbd { display: none; }
  .project-context .environment-badge { display: none; }
  .top-actions .secondary-button.top { width: 29px; padding: 0; font-size: 0; }
  .top-actions .secondary-button.top svg { width: 14px; height: 14px; }
  .status-rail > div:last-child span:nth-child(2) { display: none; }
}

@media (max-width: 780px) {
  :root { --topbar-h: 44px; --status-h: 0px; --mobile-nav-h: 54px; }
  html, body { overflow: hidden; }
  .app-shell { grid-template-rows: var(--topbar-h) minmax(0,1fr) var(--mobile-nav-h); }
  .topbar { grid-template-columns: 110px minmax(0,1fr) auto; padding-left: 9px; }
  .brand-block > span { display: none; }
  .project-context { padding-left: 5px; justify-content: center; }
  .project-context > strong { max-width: 128px; }
  .context-branch, .project-context > span:not(.context-branch):not(.environment-badge) { display: none; }
  .top-actions { padding-left: 4px; }
  .avatar-button, .top-actions .secondary-button.top { display: none; }
  .workspace-body { display: block; position: relative; min-height: 0; }
  .activity-rail, .context-panel, .status-rail { display: none; }
  .work-area { position: absolute; inset: 0; display: block; overflow: hidden; }
  .primary-workbench { position: absolute; inset: 0 0 0 0; display: block; }
  .editor-pane, .preview-pane, .bottom-panel, .ai-panel { position: absolute; inset: 0; display: none; border: 0; height: 100%; }
  .app-shell[data-mobile-view="code"] .editor-pane { display: grid; }
  .app-shell[data-mobile-view="preview"] .preview-pane { display: grid; }
  .app-shell[data-mobile-view="ai"] .ai-panel { display: grid; }
  .app-shell[data-mobile-view="problems"] .bottom-panel { display: grid; grid-template-rows: 28px minmax(0,1fr); height: 100%; }
  .app-shell[data-mobile-view="problems"] .bottom-content { height: auto; min-height: 0; }
  .app-shell[data-mobile-view="problems"] .bottom-tabs button[data-bottom-tab]:not([data-bottom-tab="problems"]):not([data-bottom-tab="history"]) { display: none; }
  .editor-pane { grid-template-rows: 34px 28px minmax(0,1fr) 23px; }
  .preview-pane { grid-template-rows: 38px minmax(0,1fr); }
  .preview-toolbar { height: 38px; }
  .preview-stage { padding: 7px; }
  .browser-frame { min-height: calc(100vh - 113px); }
  .ai-panel { grid-template-rows: 45px 42px minmax(0,1fr) auto; }
  .ai-empty { min-height: 280px; }
  .ai-composer textarea { min-height: 66px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4,1fr); height: var(--mobile-nav-h); border-top: 1px solid var(--line); background: #060706; position: relative; z-index: 30; }
  .mobile-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--text-4); cursor: pointer; font-size: 8px; }
  .mobile-nav button.active { color: var(--text-1); }
  .mobile-nav button.active::before { content: ""; position: absolute; left: 24%; right: 24%; top: -1px; height: 1px; background: var(--accent); box-shadow: 0 0 9px rgba(51,156,94,.4); }
  .mobile-nav button i { position: absolute; top: 4px; right: calc(50% - 18px); min-width: 13px; height: 13px; display: grid; place-items: center; background: var(--error); color: #fff; border-radius: 7px; font-size: 7px; font-style: normal; }
  .visual-inspector { width: calc(100% - 24px); right: 12px; top: 12px; }
  .history-view { grid-template-columns: 1fr; }
  .checkpoint-column { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 460px) {
  .brand-block strong { font-size: 9px; }
  .project-context > strong { max-width: 100px; font-size: 10px; }
  .command-trigger { display: none; }
  .topbar { grid-template-columns: 86px 1fr 0; }
  .top-actions { display: none; }
  .pane-actions .icon-button { display: none; }
  .editor-tab { min-width: 88px; }
  .preview-title small { display: none; }
  .device-switch button { width: 26px; height: 22px; }
  .browser-chrome > div { max-width: 64%; }
  .plan-controls { grid-template-columns: 1fr 1fr; }
  .plan-controls .primary-button, .plan-controls .secondary-button, .plan-controls .danger-button { min-height: 30px; }
  .ai-scroll { padding-left: 9px; padding-right: 9px; }
  .problem-row { grid-template-columns: 18px minmax(0,1fr); }
  .problem-row code, .problem-row small { grid-column: 2; }
}

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