/* FIZZ DEV — FIZZ's design system with a developer workspace. Builds on site.css tokens. */
.dev-app {
  --panel-w: 46%;
  display: flex; height: 100dvh; overflow: hidden; background: var(--bg);
}
.dev-app kbd { font-family: var(--mono); font-size: 11px; padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 15px; }
.spacer { flex: 1; }

/* sidebar: projects */
.proj { position: relative; display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 0 4px 0 10px; }
.proj:hover { background: var(--accent); } .proj.on { background: var(--surface-2); }
.proj .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.proj > button.name { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 8px 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj.on > button.name { font-weight: 600; }
.proj .more { opacity: 0; width: 26px; height: 26px; }
.proj:hover .more, .proj .more:focus, .proj .more[aria-expanded="true"] { opacity: 1; }
.proj-chats { margin: 2px 0 6px 20px; padding-left: 10px; border-left: 1px solid var(--border); display: grid; }
.proj-chats a { display: block; padding: 5px 8px; border-radius: 6px; font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-chats a:hover, .proj-chats a.on { background: var(--accent); color: var(--fg); }

/* center */
.dev-main { flex: 1; min-width: 320px; display: flex; flex-direction: column; position: relative; }
.dev-top { height: 54px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--border); }
.proj-title { min-width: 0; flex: 1; text-align: left; border: 0; background: none; font-weight: 600; font-size: 15px; padding: 6px 8px; margin-left: -8px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-title:hover { background: var(--accent); }
.proj-title small { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 8px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .btn .i { width: 15px; height: 15px; }
.dev-thread { gap: 22px; padding-top: 24px; grid-template-columns: minmax(0, 1fr); }
.only-narrow, .only-mid { display: none !important; }

/* messages */
.u-msg { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.6; }
.u-msg .meta { display: flex; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.a-msg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.steps { display: grid; gap: 4px; }
.step { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.step-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; border: 0; background: none; text-align: left; font-family: var(--mono); font-size: 12.5px; }
.step-head:hover { background: var(--surface); }
.step-head .verb { color: var(--muted); }
.step-head .path { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-head .delta { margin-left: auto; white-space: nowrap; }
.add { color: var(--success); } .del { color: var(--danger); }
.st { width: 16px; height: 16px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: var(--muted); }
.st svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.st.done { color: var(--success); }
.st.fail { color: var(--danger); }
.st.run { width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--fg) 25%, transparent); border-top-color: var(--fg); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.step-body { border-top: 1px solid var(--border); max-height: 360px; overflow: auto; }
.diff { margin: 0; font: 12px/1.55 var(--mono); }
.diff div { padding: 0 12px; white-space: pre; }
.diff .a { background: color-mix(in srgb, var(--success) 12%, transparent); }
.diff .d { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.diff .h { color: var(--muted); background: var(--surface); }
.a-actions { display: flex; flex-wrap: wrap; gap: 2px; font-size: 12px; color: var(--muted); }
.a-actions button { border: 0; background: none; color: var(--muted); padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.a-actions button:hover { background: var(--accent); color: var(--fg); }
.dev-welcome { min-height: 50vh; display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); text-align: center; gap: 22px; }
.dev-welcome > * { max-width: 100%; }
.dev-welcome h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: -.02em; }
.dev-welcome p { margin: 6px 0 0; color: var(--muted); }
.starter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 640px; }
.starter button { min-width: 0; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.starter button:hover { background: var(--accent); }
.starter b { display: block; font-size: 14px; font-weight: 500; }
.starter span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connect-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* composer */
.dev-app .composer textarea { font-size: 15px; }
.mode { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 8px; margin-left: 4px; }
.mode button { border: 0; background: none; padding: 3px 10px; border-radius: 6px; font-size: 12.5px; color: var(--muted); }
.mode button[aria-checked="true"] { background: var(--surface-2); color: var(--fg); font-weight: 600; }
.slash { border: 1px solid var(--border); border-radius: 12px; background: var(--popover); box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 4px; }
.slash button { display: flex; gap: 12px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 8px; text-align: left; font-size: 13px; }
.slash button.on, .slash button:hover { background: var(--accent); }
.slash code { font-family: var(--mono); color: var(--fg); min-width: 84px; }
.slash span { color: var(--muted); }

/* resizer + panel */
.resizer { width: 1px; flex: none; cursor: col-resize; background: var(--border); position: relative; transition: background .15s; }
.resizer::after { content: ""; position: absolute; inset: 0 -4px; }
.resizer:hover, .resizer:focus-visible, .resizer.drag { background: var(--muted); outline: none; }
.panel { width: var(--panel-w); min-width: 340px; max-width: 75vw; flex: none; display: flex; flex-direction: column; background: var(--surface); }
.dev-app[data-panel="closed"] .panel, .dev-app[data-panel="closed"] .resizer { display: none; }
.panel-tabs { height: 54px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--border); }
.mobile-back-chat { display: none; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--fg); font: 600 12px/1 inherit; white-space: nowrap; }
.mobile-back-chat [data-icon] { display: inline-flex; }
.mobile-back-chat svg { width: 16px; height: 16px; }
.panel-tabs [role=tab] { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.panel-tabs [role=tab][aria-selected="true"] { background: var(--surface-2); color: var(--fg); }
.pane { flex: 1; min-height: 0; display: none; }
.pane.on { display: flex; }

/* code pane */
.pane-code { flex-direction: row; }
.tree-wrap { width: 210px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.tree-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tree { flex: 1; overflow: auto; padding: 2px 6px 10px; font: 12.5px/1 var(--mono); }
.tree button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 6px; border: 0; background: none; border-radius: 6px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.tree button:hover { background: var(--accent); }
.tree button.on { background: var(--surface-2); color: var(--fg); }
.tree .dir { color: var(--muted); }
.tree .changed::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); flex: none; }
.tree .dir svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .12s; }
.tree .dir[aria-expanded="true"] svg { transform: rotate(90deg); }
.editor-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.file-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--surface); scrollbar-width: none; min-height: 36px; }
.file-tabs button { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; height: 36px; border: 0; border-right: 1px solid var(--border); background: none; font: 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
.file-tabs button.on { background: var(--bg); color: var(--fg); box-shadow: inset 0 -1.5px 0 var(--fg); }
.file-tabs .x { padding: 0 3px; border-radius: 4px; }
.file-tabs .x:hover { background: var(--accent); }
.editor-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); min-height: 32px; }
.editor-bar:empty { display: none; }
.editor-bar .path { font-family: var(--mono); color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-bar button { border: 1px solid var(--border); background: var(--card); border-radius: 6px; padding: 2px 8px; font-size: 12px; color: var(--fg); }
.editor-bar button:hover { background: var(--accent); }
.editor-bar button.on { border-color: var(--fg); color: var(--fg); background: var(--surface-2); }
.editor-host { flex: 1; min-height: 0; }
.editor-host .CodeMirror { height: 100%; font: 13px/1.6 var(--mono); background: var(--bg); color: var(--fg); }
.diff-host { flex: 1; overflow: auto; }
.editor-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; padding: 20px; text-align: center; background: var(--bg); }

/* CodeMirror theme mapped to FIZZ tokens */
.CodeMirror-gutters { background: var(--bg); border-right: 1px solid var(--border); }
.CodeMirror-linenumber { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.CodeMirror-cursor { border-left-color: var(--fg); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: color-mix(in srgb, var(--fg) 12%, transparent) !important; }
.CodeMirror-activeline-background { background: var(--surface); }
.CodeMirror-matchingbracket { color: var(--fg) !important; text-decoration: underline; }
.cm-s-default .cm-keyword { color: #b0472a; } .cm-s-default .cm-string, .cm-s-default .cm-string-2 { color: #4f7a28; }
.cm-s-default .cm-number, .cm-s-default .cm-atom { color: #a8671a; } .cm-s-default .cm-def, .cm-s-default .cm-variable-2 { color: #7a4fa8; }
.cm-s-default .cm-comment { color: #8c897f; font-style: italic; } .cm-s-default .cm-tag { color: #b0472a; }
.cm-s-default .cm-attribute, .cm-s-default .cm-property { color: #8a5a12; } .cm-s-default .cm-variable { color: var(--fg); }
.cm-s-default .cm-header { color: var(--fg); font-weight: 600; } .cm-s-default .cm-qualifier, .cm-s-default .cm-builtin { color: #7a4fa8; }
.dark .cm-s-default .cm-keyword { color: #ec9a76; } .dark .cm-s-default .cm-string, .dark .cm-s-default .cm-string-2 { color: #b3cc86; }
.dark .cm-s-default .cm-number, .dark .cm-s-default .cm-atom { color: #e5bd78; } .dark .cm-s-default .cm-def, .dark .cm-s-default .cm-variable-2 { color: #cdb0ec; }
.dark .cm-s-default .cm-comment { color: #8a887f; } .dark .cm-s-default .cm-tag { color: #ec9a76; }
.dark .cm-s-default .cm-attribute, .dark .cm-s-default .cm-property { color: #e5bd78; } .dark .cm-s-default .cm-qualifier, .dark .cm-s-default .cm-builtin { color: #cdb0ec; }

/* terminal pane */
.pane-terminal { background: #1c1b1a; }
.term-host { flex: 1; min-width: 0; padding: 6px 0 0 8px; }
.term-host .xterm { height: 100%; }

/* browser pane */
.pane-browser { flex-direction: column; }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.browser-bar .url { height: 32px; flex: 1; min-width: 80px; font: 12.5px var(--mono); border-radius: 999px; padding: 0 14px; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.seg button { border: 0; background: none; padding: 3px 9px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: var(--fg); }
.browser-stage { flex: 1; min-height: 0; display: flex; justify-content: center; padding: 10px; overflow: auto; }
#preview { width: 100%; height: 100%; border: 1px solid var(--border); border-radius: 12px; background: #fff; transition: width .2s; }
.console { border-top: 1px solid var(--border); background: var(--bg); }
.console-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; }
.console-body { max-height: 160px; overflow: auto; font: 12px/1.5 var(--mono); }
.console.collapsed .console-body { display: none; }
.console-body div { padding: 2px 12px; border-top: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; }
.console-body .error { color: var(--danger); background: var(--danger-soft); }
.console-body .warn { color: var(--warning); background: var(--warning-soft); }
.console-body .empty { color: var(--muted); }

/* quick open */
.qo-list { max-height: 50vh; overflow: auto; display: grid; }
.qo-list button { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 8px; font: 13px var(--mono); }
.qo-list button.on, .qo-list button:hover { background: var(--accent); }

.tabbar { display: none; }

/* tablet: sidebar & panel become drawers */
@media (max-width: 1100px) {
  .dev-app .chat-side { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .dev-app.drawer .chat-side { transform: none; }
  .only-narrow { display: inline-flex !important; }
  .only-wide { display: none !important; }
  .only-mid { display: inline-flex !important; }
  .resizer { display: none; }
  .panel { position: fixed; z-index: 55; top: 0; right: 0; bottom: 0; width: min(720px, 92vw) !important; max-width: none; min-width: 0; transform: translateX(100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .dev-app.panel-open .panel { transform: none; }
  .dev-app[data-panel="closed"] .panel { display: flex; }
}
/* phone: one workspace view at a time; navigation lives in the top menu */
@media (max-width: 760px) {
  .mobile-back-chat { display: inline-flex; flex: none; }
  .panel-tabs { gap: 4px; padding: 0 8px; }
  .panel-tabs [role=tab] { padding: 7px 8px; font-size: 12px; }
  .only-mid { display: none !important; }
  .dev-app { flex-direction: column; padding-bottom: 0; }
  .dev-main { min-width: 0; }
  .panel { position: fixed; inset: 0; width: 100% !important; transform: none; box-shadow: none; display: none !important; }
  .dev-app:not([data-view="chat"]) .panel { display: flex !important; }
  .dev-app:not([data-view="chat"]) .dev-main { display: none; }
  #panel-close { display: none; }
  .tree-wrap { width: 130px; }
  .tabbar { display: flex; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--border); }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; font-size: 11px; color: var(--muted); }
  .tabbar button[aria-current="true"] { color: var(--fg); font-weight: 600; }
  .hide-xs { display: none; }
  .starter { grid-template-columns: 1fr; }
  .seg button { padding: 3px 6px; }
  .dev-top { padding-left: 6px; }
}

@media (max-width: 1280px) and (min-width: 1101px) { .starter { grid-template-columns: minmax(0, 1fr); } }

/* ---- FIZZ DEV look: same calm controls as FIZZ ---- */
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--fg); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill-btn:hover { background: var(--accent); }
.pill-btn .i { width: 15px; height: 15px; }
#dev-app .icon-btn.ring { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); color: var(--fg); background: var(--card); }
#dev-app .icon-btn.ring:hover { background: var(--accent); }
.proj .folder { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; color: var(--muted); }
.proj.on > button.name { color: var(--fg); }
.dev-welcome h1 { font-weight: 600; }
.a-actions button.primary { color: var(--fg); font-weight: 600; }
.a-actions button.primary:hover { background: var(--accent); }

/* ---- Agent chat (activity lines, task cards, prose) ---- */
#dev-app .dev-thread { max-width: 760px; gap: 18px; padding-top: 28px; }
.u-wrap { display: grid; justify-items: end; gap: 4px; }
.u-wrap .chips { justify-content: flex-end; }
#dev-app .u-msg { max-width: min(85%, 560px); border: 0; border-radius: 18px; padding: 10px 16px; background: var(--surface-2); font-size: 15px; }
.u-wrap .meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); opacity: 0; transition: opacity .15s; padding-right: 6px; }
.u-wrap:hover .meta { opacity: 1; }
@media (hover: none) { .u-wrap .meta { opacity: 1; } }
#dev-app .a-msg { gap: 12px; }
#dev-app .a-msg .md { font-size: 15.5px; line-height: 1.7; }
.act-line, .act-head { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; font-size: 14.5px; color: var(--muted); }
.act-line b { color: var(--fg); font-weight: 500; }
.act-line small { color: var(--muted); }
.act-head { border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; max-width: 100%; min-width: 0; }
.act-head > span { min-width: 0; }
.act-head:hover { color: var(--fg); }
.act-head > span:not(.st):not(.act-ic):not(.act-warn) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-head .chev { width: 14px; height: 14px; transition: transform .15s; opacity: .7; }
.act-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.act-ic { width: 18px; height: 18px; flex: none; display: grid; place-items: center; color: var(--muted); }
.act-ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.act-ic.fail { color: var(--danger); }
.act-warn { font-size: 12px; color: var(--warning); }
.activity { display: grid; gap: 6px; }
.activity .steps { margin-left: 8px; padding-left: 18px; border-left: 1px solid var(--border); gap: 2px; }
.activity .step { border: 0; background: none; border-radius: 8px; }
.activity .step-head { padding: 4px 8px; font-size: 12.5px; border-radius: 8px; }
.activity .step-body { border: 1px solid var(--border); border-radius: 10px; margin: 4px 0 6px; }
.tasks { border: 1px solid var(--border); border-radius: 14px; background: var(--card); overflow: hidden; }
.tasks-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0; background: none; font-size: 14px; color: var(--muted); text-align: left; }
.tasks-head .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; }
.tasks-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.tasks ol { list-style: none; margin: 0; padding: 0 14px 12px; display: grid; gap: 6px; }
.tasks li, .act-task { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--fg); }
.tasks li.done span:last-child { color: var(--muted); text-decoration: line-through; }
.tk { width: 16px; height: 16px; margin-top: 2px; flex: none; border-radius: 50%; border: 1.5px solid var(--muted); display: grid; place-items: center; font-size: 10px; box-sizing: border-box; }
.done > .tk { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.tk svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Composer: one big rounded box ---- */
#dev-app .composer { border-radius: 20px; padding: 2px 4px; }
#dev-app .composer textarea { padding: 14px 14px 6px; font-size: 15.5px; }
#dev-app .composer .row { gap: 6px; padding: 4px 4px 6px; }
#dev-app .composer #attach { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 10px; color: var(--fg); background: transparent; }
#dev-app .composer #attach:hover { background: var(--accent); }
#dev-app .model-btn { display: inline-flex !important; flex: 0 0 auto !important; width: auto; min-width: 112px !important; max-width: 180px; visibility: visible !important; opacity: 1 !important; position: relative; z-index: 1; align-items: center; justify-content: center; gap: 4px; border: 0; height: 32px; padding: 0 10px; color: var(--muted); font-weight: 500; border-radius: 9px; white-space: nowrap; }
#dev-app .model-btn:hover { background: var(--accent); }
#dev-app .mic { width: 34px; height: 34px; border-radius: 10px; color: var(--muted); }
#dev-app .mic.on { color: #fff; background: var(--danger); animation: mic-pulse 1.4s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 25%, transparent); } }
#dev-app .send { width: 34px; height: 34px; }
.skill-chips { padding: 10px 12px 0; }
.chip.skill { background: var(--surface-2); color: var(--fg); border-color: transparent; font-weight: 500; }
.chip.skill > span { font-size: 12px; }

/* ---- Activity pane ---- */
.pane-activity { overflow: auto; }
.activity-pane { width: 100%; padding: 14px; display: grid; gap: 12px; align-content: start; }
.act-sec { border: 1px solid var(--border); border-radius: 14px; background: var(--card); padding: 12px 14px; display: grid; gap: 8px; }
.act-sec h3 { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.act-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.act-row b, .act-row small { color: var(--muted); font-weight: 500; }
.act-task small { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.act-task.done > span:nth-child(2) { color: var(--muted); }
.act-file { display: flex; justify-content: space-between; gap: 10px; border: 0; background: none; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; font: 13px var(--mono); text-align: left; }
.act-file:hover { background: var(--accent); }
.act-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-empty { margin: 0; font-size: 13px; color: var(--muted); }

/* ---- Skills dialog ---- */
.skills-dlg { width: min(640px, calc(100vw - 24px)); }
.skill-list { display: grid; gap: 6px; max-height: 56vh; overflow: auto; margin: 12px 0; }
.skill-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.skill-row.off { opacity: .6; }
.skill-ic { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--fg); }
.skill-ic svg { width: 16px; height: 16px; }
.skill-body { flex: 1; min-width: 0; display: grid; }
.skill-body b { font-size: 14px; }
.skill-body small { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--input); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--strong); }
.switch input:checked + span::after { background: var(--strong-fg); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.menu .label { text-transform: none; }
.skill-list:focus-visible { outline: none; }

/* ---- agent: thinking, automatic rounds, questions, review, context ---- */
.thinking { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--muted); }
.thinking .t { font-variant-numeric: tabular-nums; font-size: 12.5px; opacity: .8; }
.auto-msg { display: grid; gap: 6px; }
.auto-msg .act-head { font-size: 13.5px; }
.auto-body { border: 1px solid var(--border); border-radius: 10px; max-height: 260px; overflow: auto; }
.ask { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.ask > b { font-size: 15px; font-weight: 600; }
.ask p { margin: 0; color: var(--muted); font-size: 14px; }
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-opt { border: 1px solid var(--border); background: var(--bg); color: var(--fg); padding: 7px 14px; border-radius: 10px; font-size: 14px; }
.ask-opt:hover { background: var(--accent); } .ask-opt[aria-pressed="true"] { border-color: var(--fg); background: var(--surface-2); }
.ask-free { display: flex; gap: 8px; }
.ask-free .input { flex: 1; min-width: 0; height: 36px; border-radius: 10px; }
.ask.done { background: none; box-shadow: none; padding: 10px 14px; gap: 4px; }
.ask.done b { font-size: 14px; font-weight: 500; color: var(--muted); }
.ask-answer { font-size: 14px; }
.stage-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); }
.stage-bar.all { border: 1px solid var(--border); border-radius: 12px; font-size: 13.5px; color: var(--muted); }
.stage-bar.all span { margin-right: auto; }
.tool-img { display: block; max-width: 100%; margin: 8px 12px; border-radius: 8px; border: 1px solid var(--border); }
.chip.mention { background: var(--accent); border-color: transparent; font-family: var(--mono); font-size: 12px; }
.ctx-ring { --p: 0; width: 26px; height: 26px; border: 0; padding: 0; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--muted) calc(var(--p) * 1%), var(--border) 0); cursor: pointer; }
.ctx-ring span { width: 18px; height: 18px; border-radius: 50%; background: var(--card); }
.dark .ctx-ring span { background: var(--popover); }
.ctx-ring.warn { background: conic-gradient(var(--warning) calc(var(--p) * 1%), var(--border) 0); }
.composer .row .ctx-ring { margin-left: auto; }
.dev-app .composer .row .model-btn { margin-left: 0; }

/* ---- files: cards in chat, binary viewer ---- */
.file-cards { display: grid; gap: 8px; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); max-width: 520px; }
.file-card.missing { opacity: .6; }
.fc-ic { width: 40px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 8px; font: 700 10.5px var(--font); letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.fc-ic.k-pdf { color: #c0392b; } .fc-ic.k-doc { color: #3b5f9a; } .fc-ic.k-xls { color: #2f7a4f; } .fc-ic.k-ppt { color: #c0561f; }
.dark .fc-ic.k-pdf { color: #ef7d70; } .dark .fc-ic.k-doc { color: #9db3d8; } .dark .fc-ic.k-xls { color: #74c08f; } .dark .fc-ic.k-ppt { color: #e0915e; }
.fc-thumb { width: 48px; height: 48px; flex: none; object-fit: cover; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.fc-body { flex: 1; min-width: 0; display: grid; }
.fc-body b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-body small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 520px) { .file-card { flex-wrap: wrap; } .fc-actions { width: 100%; } .fc-actions .btn { flex: 1; } }
.bin-host { flex: 1; min-height: 0; overflow: auto; }
.bin-view { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 12px; box-sizing: border-box; }
.bin-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.bin-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: var(--surface); border-radius: 12px; overflow: auto;
  background-image: linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%), linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.bin-stage[data-kind="pdf"] { display: block; background: var(--surface); }
.bin-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bin-stage iframe { width: 100%; height: 100%; min-height: 480px; border: 0; }
.bin-stage[data-kind="file"] { display: none; }
#dev-app #br-select.on { background: var(--surface-2); color: var(--fg); }

/* web search results, page reads and app builds in the thread */
.web-results { list-style: none; margin: 0; padding: 6px 12px 10px; display: grid; gap: 10px; }
.web-results li { display: grid; gap: 1px; }
.web-results a { color: var(--fg); font-weight: 550; text-decoration: none; }
.web-results a:hover { text-decoration: underline; }
.web-results small { color: var(--muted); font-size: 12px; }
.web-results p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.web-read { padding: 8px 12px 10px; display: grid; gap: 6px; }
.web-read a { color: var(--fg); font-weight: 550; text-decoration: none; }
.web-read pre { margin: 0; max-height: 220px; overflow: auto; white-space: pre-wrap; font: 12px/1.5 var(--mono); color: var(--muted); }
.build-card { margin: 10px 0; padding: 12px 14px; max-width: 560px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); display: grid; gap: 10px; }
.build-card.ok { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.build-card.fail { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.build-top { display: flex; align-items: center; gap: 10px; }
.build-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--fg); flex: none; }
.build-txt { display: grid; min-width: 0; flex: 1; }
.build-txt span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.build-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.build-actions:empty { display: none; }
.build-actions small { opacity: .75; margin-left: 4px; }
.build-card p { margin: 0; }

/* browser tabs (project preview + the web) */
.br-tabs { display: flex; align-items: center; gap: 2px; padding: 6px 8px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); background: var(--surface); }
.br-tab .bt-ic svg { width: 14px; height: 14px; }
.br-tabs::-webkit-scrollbar { display: none; }
.br-tab { display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 200px; height: 32px; padding: 0 6px 0 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; font-size: 12.5px; color: var(--muted); cursor: pointer; flex: none; user-select: none; }
.br-tab:hover { background: var(--surface-2); color: var(--fg); }
.br-tab.on { background: var(--bg); color: var(--fg); border-color: var(--border); margin-bottom: -1px; height: 33px; }
.br-tab .bt-ic { width: 16px; height: 16px; flex: none; display: grid; place-items: center; font-size: 12px; border-radius: 4px; }
.br-tab .st { width: 14px; height: 14px; flex: none; }
.br-tab .bt-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.br-tab .bt-x { width: 20px; height: 20px; border: 0; background: none; border-radius: 5px; color: var(--muted); font-size: 15px; line-height: 1; flex: none; }
.br-tab .bt-x:hover { background: var(--surface-2); color: var(--fg); }
.br-new { width: 28px; height: 28px; border: 0; background: none; border-radius: 7px; color: var(--muted); font-size: 18px; flex: none; margin-left: 2px; }
.br-new:hover { background: var(--surface-2); color: var(--fg); }
.br-end { margin-left: auto; flex: none; border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 999px; font-size: 11.5px; padding: 3px 10px; }
.br-end:hover { color: var(--danger); border-color: var(--danger); }
.pane-browser[data-mode="web"] .preview-only { display: none !important; }
.pane-browser[data-mode="preview"] .web-only { display: none !important; }
.pane-browser[data-mode="web"] .browser-stage { padding: 0; }
.web-frame { width: 100%; height: 100%; border: 0; background: var(--bg); }
.web-frame[hidden], #preview[hidden] { display: none; }
.browser-stage { position: relative; }
.br-error { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2; max-width: 90%; padding: 8px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.br-handoff { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: color-mix(in srgb, var(--warning) 14%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--warning) 40%, var(--border)); }
.br-handoff[hidden] { display: none; }
.br-handoff > div { display: grid; flex: 1; min-width: 0; font-size: 13px; }
.br-handoff > div span { color: var(--muted); }
.br-handoff .hb-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--card); color: var(--warning); flex: none; }
.collect { flex-basis: 100%; display: grid; gap: 10px; padding: 4px 0 2px; }
.collect-open { justify-self: start; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.collect-open .i { width: 14px; height: 14px; }
.collect ol { margin: 0; padding-inline-start: 20px; font-size: 13.5px; line-height: 1.6; }
.collect ol a { overflow-wrap: anywhere; }
.collect .field { margin: 0; }
.stage-bar.handoff { background: color-mix(in srgb, var(--warning) 12%, transparent); }

/* template gallery */
.starter { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-width: 680px; }
.starter:not(.all) button:nth-child(n+7) { display: none; }
.starter button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; transition: border-color .15s, background .15s, transform .15s; }
.starter button:hover { border-color: color-mix(in srgb, var(--fg) 25%, var(--border)); background: var(--card); }
.starter .st-ic { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--fg); white-space: normal; }
.starter .st-ic svg { width: 17px; height: 17px; }
.dev-welcome .link { font-size: 13px; }

/* command palette */
.palette { width: min(620px, calc(100vw - 32px)); padding: 0; margin-top: 12vh; border-radius: 16px; }
.palette::backdrop { background: rgba(5, 8, 14, .45); backdrop-filter: blur(2px); }
.pal-body { display: flex; flex-direction: column; max-height: 70vh; }
.pal-body > .input { height: 52px; border: 0; border-bottom: 1px solid var(--border); border-radius: 16px 16px 0 0; font-size: 15.5px; padding: 0 18px; background: transparent; box-shadow: none; }
.pal-list { overflow: auto; padding: 6px; }
.pal-g { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pal-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 9px; text-align: left; font-size: 14px; color: var(--fg); }
.pal-list button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-list button small { color: var(--muted); font-size: 12px; flex: none; }
.pal-list button.on, .pal-list button:hover { background: var(--accent); }
.pal-list button .i { width: 16px; height: 16px; color: var(--muted); }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
@media (max-width: 640px) { .pal-foot { display: none; } .palette { margin-top: 8vh; } }
.step-head .verb .i { width: 14px; height: 14px; color: var(--muted); vertical-align: -2px; }
.chip.mention .i, .chip.skill .i { width: 13px; height: 13px; color: var(--muted); }
.tree .dir { display: flex; align-items: center; gap: 4px; }
.build-actions .btn .i { width: 14px; height: 14px; }
.br-tab .bt-x .i { width: 13px; height: 13px; }
.br-new .i { width: 16px; height: 16px; }
.browser-bar .icon-btn .i, .panel-tabs .icon-btn .i { width: 16px; height: 16px; }
.model-btn { white-space: nowrap; }
@media (max-width: 760px) {
  .dev-app .composer .row { gap: 4px; }
  .dev-app .composer .row .ctx-ring { display: none; }
  #dev-app .mode button { padding: 3px 8px; }
  #dev-app .model-btn { padding: 0 6px; font-size: 12.5px; }
  .disclaimer { display: none; }
}
.br-screen { position: absolute; inset: 0; display: grid; place-items: center; background: #1c1b1a; outline: none; cursor: default; }
.br-screen[hidden] { display: none; }
.br-screen img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.br-screen-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(28, 27, 26, .78); color: #ecebe6; font-size: 12px; pointer-events: none; transition: opacity .2s; }
.br-screen.used .br-screen-hint, .br-screen:focus .br-screen-hint { opacity: 0; }
.br-screen:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 70%, transparent); }
.br-starting { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 12px; max-width: min(460px, 92%); padding: 12px 16px; border-radius: 14px; background: var(--popover); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 13px; }
.br-starting > div { display: grid; } .br-starting span:not(.st) { color: var(--muted); }
/* one continuous turn: intermediate steps sit closer together */
#dev-app .a-msg.mid { margin-bottom: -6px; }
#dev-app .a-msg.mid .md:empty { display: none; }
/* editing a sent message */
.u-edit { width: min(85%, 560px); display: grid; gap: 8px; }
.u-edit .textarea { min-height: 80px; font-size: 15px; border-radius: 14px; }
.u-edit-bar { display: flex; justify-content: flex-end; gap: 6px; }
.u-wrap .meta button { border: 0; background: none; color: var(--muted); font-size: 11.5px; padding: 0 4px; border-radius: 5px; }
.u-wrap .meta button:hover { color: var(--fg); background: var(--accent); }
.kbd-list { display: grid; gap: 8px; }
.kbd-list div { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; }
.kbd-list kbd { font: 11.5px var(--mono); padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--card); margin-right: 4px; }
.kbd-list small { color: var(--muted); font-size: 13px; text-align: right; }
@media (max-width: 760px) {
  .dev-app .composer-inner, .dev-app .composer { min-width: 0; max-width: 100%; }
  .dev-app .composer .row { min-width: 0; flex-wrap: nowrap; }
  #dev-app .model-btn { flex: 0 0 auto !important; min-width: 92px !important; max-width: 124px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 420px) { #dev-app #mic { display: none; } #dev-app .mode button { padding: 3px 7px; font-size: 12px; } }
.auto-notice { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px dashed var(--border); border-radius: 12px; font-size: 13.5px; color: var(--muted); }
.auto-notice .i { width: 16px; height: 16px; flex: none; }
.verify-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: 13px; color: var(--muted); }
.verify-note .i { width: 15px; height: 15px; flex: none; }
.verify-note.ok .i { color: var(--success); }
.verify-note.warn .i { color: var(--warning); }
.verify-note ul { flex-basis: 100%; margin: 2px 0 0; padding-left: 22px; font-family: var(--mono); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.build-try { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.build-try:empty { display: none; }

.proj-chats a { display: flex; align-items: center; gap: 6px; }
.chat-st { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.chat-st.running { background: var(--primary); animation: chat-pulse 1.2s ease-in-out infinite; }
.chat-st.waiting { background: var(--warning); }
.chat-st.failed { background: var(--danger); }
@keyframes chat-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .chat-st.running { animation: none; } }
.proj-chats a .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Live agent activity: distinct, readable progress without implying unexecuted actions succeeded. */
.act-current { display: flex; align-items: flex-start; gap: 10px; padding: 12px; margin: 0 0 10px; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.act-current > .st { margin-top: 2px; }
.act-current > div { min-width: 0; display: grid; gap: 4px; }
.act-current b { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.act-current small { font-size: 12px; line-height: 1.45; color: var(--muted); }
#activity .act-sec { padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); margin-bottom: 10px; }
#activity .act-sec h3 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
#activity .act-row { padding: 6px 0; }
#activity .act-file { min-height: 42px; border-radius: 9px; margin: 3px 0; }
#activity .act-task { gap: 9px; padding: 8px 0; }


/* Brand marks for the Connections settings cards. */
.settings-dlg .conn > .i,
.settings-dlg .conn > .app-ic,
.settings-dlg .conn > .app-mark {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
}
.settings-dlg .conn > .i { padding: 8px; box-sizing: border-box; color: var(--text); background: var(--surface-2, rgba(127,127,127,.1)); }
.settings-dlg .conn > .canva-logo { background: #fff; padding: 5px; }
.settings-dlg .conn > .brand-logo { background: #fff; padding: 7px; }
.settings-dlg .conn > .app-ic, .settings-dlg .conn > .app-mark { display:inline-flex; align-items:center; justify-content:center; font-weight:800; font-size:20px; }
.settings-dlg .app-ic { background:var(--surface-2, rgba(127,127,127,.1)); color:var(--text); }
.settings-dlg .app-mark { font-family:Inter,sans-serif; }
.settings-dlg .notion-mark { background:#111; color:#fff; border:2px solid #fff; border-radius:7px!important; }
.settings-dlg .trello-mark { background:#1676d2; color:#fff; }
.settings-dlg .linear-mark { background:#5e6ad2; color:#fff; }
.settings-dlg .airtable-mark { background:#fff; color:#fc8c3c; border:1px solid #eee; }
.settings-dlg .figma-mark { background:#fff; display:grid!important; grid-template-columns:repeat(2,9px); grid-template-rows:repeat(3,8px); gap:0; padding:7px; box-sizing:border-box; }
.settings-dlg .figma-mark i { width:9px; height:8px; display:block; background:#f24e1e; border-radius:5px 0 0 5px; }
.settings-dlg .figma-mark i:nth-child(2) { background:#ff7262; border-radius:0 5px 5px 0; }
.settings-dlg .figma-mark i:nth-child(3) { background:#a259ff; }
.settings-dlg .figma-mark i:nth-child(4) { background:#1abcfe; border-radius:50%; }
.settings-dlg .figma-mark i:nth-child(5) { background:#0acf83; border-radius:5px 0 5px 5px; }
.settings-dlg .netlify-mark { background:#fff; color:#00ad9f; }
.settings-dlg .cloudflare-mark { background:#fff0dc; color:#f38020; }
.settings-dlg .discord-mark { background:#5865f2; color:#fff; }
.settings-dlg .telegram-mark { background:#229ed9; color:#fff; }
.settings-dlg .slack-mark { background:#fff; color:#611f69; }
.settings-dlg .supabase-mark { background:#e6fff1; color:#3ecf8e; }

/* Mobile chat layout: reserve real space for the tab bar and keep the composer
   inside the visible app viewport (including devices with a home-indicator inset). */
@media (max-width: 760px) {
  .dev-app {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .dev-app[data-view="chat"] .dev-main {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .dev-app[data-view="chat"] .dev-main > .scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
  }

  .dev-app[data-view="chat"] .composer-area {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: var(--bg);
  }

  .dev-app[data-view="chat"] .composer-inner {
    padding-top: 8px;
    padding-bottom: 4px;
  }

  /* Keep the latest message and send controls clear of the bottom navigation. */
  .dev-app[data-view="chat"] .dev-thread {
    padding-bottom: 18px;
  }
}

/* The top workspace menu replaces the bottom navigation on phones. */
@media (max-width: 760px) {
  .dev-app.keyboard-open[data-view="chat"] .dev-main {
    height: var(--fizz-visual-height, 100dvh);
  }
}

/* Compact phone workspace switcher: keep navigation out of the composer area. */
.mobile-view-menu { display: none; }
.mobile-view-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0,0,0,.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.mobile-view-backdrop.open { opacity: 1; pointer-events: auto; }
.mobile-view-sheet {
  position: fixed;
  z-index: 121;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  width: min(260px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 18px 55px rgba(0,0,0,.28);
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.mobile-view-sheet.open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-view-sheet .mobile-view-heading {
  padding: 8px 10px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mobile-view-sheet button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  text-align: left;
  font: inherit;
}
.mobile-view-sheet button:active,
.mobile-view-sheet button[aria-current="true"] { background: var(--surface-2); }
.mobile-view-sheet button .i { width: 18px; height: 18px; flex: none; color: var(--muted); }
.mobile-view-sheet button[aria-current="true"] { font-weight: 650; }
@media (max-width: 760px) {
  .mobile-view-menu { display: inline-flex; width: 34px; height: 34px; flex: none; }
  .dev-top .proj-title { flex: 1; }
}


/* Attachment/skills menu: stay inside the viewport and remain scrollable. */
.menu { box-sizing: border-box; max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.menu-mobile-head { display: none; }
@media (max-width: 760px) {
  .menu-mobile-head { position: sticky; top: -5px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 10px; margin: -5px -5px 4px; background: var(--popover); border-bottom: 1px solid var(--border); }
  .menu-mobile-head strong { font-size: 14px; font-weight: 600; }
  .menu-mobile-head .menu-close { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--fg); font-size: 22px; line-height: 1; }
}
