:root {
  --bg: #0f0f12;
  --panel: #141418;
  --panel-2: #1a1a20;
  --hover: #202028;
  --active: #202d29;
  --border: #26262e;
  --text: #e7e5e2;
  --dim: #a09fa9;
  --accent: #74c9ac;
  --bubble: #26262e;
  --bubble-user: #2f5fb3;
  --blue-dot: #4a8cf0;
  --green: #4bb96a;
  --amber: #e0a84f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 13.5px; overflow: hidden;
}
#app { display: grid; grid-template-columns: 264px 6px minmax(320px,1fr) 6px 300px; grid-template-rows: minmax(0, 1fr); height: calc(100vh - 22px); overflow: hidden; }
#app > * { min-height: 0; } /* let grid children shrink so inner scroll areas work */

/* Sidebar */
#sidebar { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.side-top { height: 48px; display: flex; align-items: center; justify-content: flex-end; padding: 8px 12px; }
#add-bot { -webkit-app-region: no-drag; background: none; border: none; color: var(--dim); font-size: 20px; cursor: pointer; width: 28px; height: 28px; border-radius: 6px; }
#add-bot:hover { background: var(--hover); color: var(--text); }
#search { margin: 4px 12px 8px; padding: 7px 10px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.bot-list { flex: 1; overflow-y: auto; padding: 0 8px; }
.sec-hdr { display: flex; align-items: center; justify-content: space-between; color: var(--dim); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 12px 8px 4px; }
.sec-add { background: none; border: none; color: var(--dim); font-size: 15px; cursor: pointer; line-height: 1; }
.sec-add:hover { color: var(--text); }
.team-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.team-row:hover { background: var(--hover); }
.team-name { flex: 1; }
.chan-row { padding: 5px 8px 5px 18px; border-radius: 6px; cursor: pointer; color: var(--dim); font-size: 13px; }
.chan-row:hover { background: var(--hover); color: var(--text); }
.chan-row.active { background: var(--active); color: var(--text); }
.usage-line { color: var(--dim); font-size: 11px; text-align: center; margin-top: 10px; font-family: ui-monospace, Menlo, monospace; }
.bot-row { display: flex; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 8px; cursor: pointer; position: relative; }
.bot-row:hover { background: var(--hover); }
.bot-row.active { background: var(--active); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.bot-meta { flex: 1; min-width: 0; }
.bot-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.tag { font-size: 10px; color: var(--dim); background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.bot-preview { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-time { color: var(--dim); font-size: 11px; align-self: flex-start; }
.unread { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-dot); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #555; position: absolute; left: 30px; bottom: 8px; border: 2px solid var(--panel); }
.dot.running { background: var(--green); }
.dot.paused { background: var(--amber); }
.dot.error { background: #d5544a; }
.side-foot { border-top: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.foot-btn { text-align: left; background: none; border: none; color: var(--dim); padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.foot-btn:hover { background: var(--hover); color: var(--text); }
.foot-btn[aria-pressed=true] { background:var(--active); color:var(--accent); }
#app.utility-layout .side-foot { margin-top:auto; }
.workspace { color: var(--dim); font-size: 12px; padding: 8px; }

/* Center */
#center { display: flex; flex-direction: column; background: var(--bg); min-height: 0; overflow: hidden; }
#chat-header, #composer { flex-shrink: 0; } /* header + composer keep their size; messages take the rest */
#chat-header { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
#chat-title { font-weight: 600; }
.status-pill { font-size: 11px; color: var(--dim); border: 1px solid var(--border); padding: 2px 8px; border-radius: 100px; }
.hdr-btn { -webkit-app-region: no-drag; margin-left: auto; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 7px; width: 30px; height: 28px; cursor: pointer; font-size: 14px; }
.hdr-btn:hover { background: var(--hover); }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 76%; padding: 10px 13px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { background: var(--bubble); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--bubble-user); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.tool { background: transparent; border: 1px dashed var(--border); color: var(--dim); font-size: 12px; font-family: ui-monospace, Menlo, monospace; align-self: flex-start; max-width: 88%; }
.msg.system { align-self: center; color: var(--dim); font-size: 12px; background: none; }
.msg-label { font-size: 11px; color: var(--dim); margin: 6px 4px 0; }
#composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; }
#composer button { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
#attach { width: 38px; font-size: 18px; }
#composer-input { flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; padding: 10px 16px; color: var(--text); }
#send-btn { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 600; }
#send-btn:disabled, #composer-input:disabled { opacity: 0.5; }

/* Right pane */
#rightpane { background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.right-head { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--border); }
#right-title { font-size: 12px; color: var(--dim); }
.mini-btn { font-size: 11px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.mini-btn:disabled { opacity: 0.4; }
.mini-btn.active { background: var(--accent); color: #1a1206; border-color: var(--accent); }
#screen-wrap { position: relative; margin: 12px; aspect-ratio: 16/10; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
#screen { width: 100%; height: 100%; display: none; }
.screen-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); text-align: center; font-size: 12px; line-height: 1.8; }
.routines { padding: 14px; }
.routines-hint { color: var(--dim); font-size: 12px; text-align: center; margin-bottom: 10px; }
.routine-btn { width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px; cursor: pointer; }
.routine-btn:disabled { opacity: 0.5; }
.routine-item { font-size: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; margin-top: 8px; color: var(--dim); }

/* Status bar */
#status-bar { height: 22px; background: var(--panel); border-top: 1px solid var(--border); display: flex; align-items: center; padding: 0 12px; font-size: 11px; color: var(--dim); }

/* Modal */
#modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: grid; place-items: center; z-index: 50; }
#modal-backdrop.hidden { display: none; }
#modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; width: 520px; max-width: 92vw; max-height: 84vh; overflow-y: auto; padding: 22px; }
#modal h2 { font-size: 16px; margin-bottom: 14px; }
#modal label { display: block; font-size: 12px; color: var(--dim); margin: 12px 0 4px; }
#modal input, #modal textarea, #modal select { width: 100%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; color: var(--text); font: inherit; }
#modal textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.docs-modal { width: min(1120px,94vw) !important; height: min(820px,90vh); max-height: 90vh !important; padding: 12px !important; overflow: hidden !important; display: flex; flex-direction: column; }
.docs-modal h2 { margin: 2px 4px 10px !important; }
.docs-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.docs-toolbar button { border: 1px solid var(--border); background: var(--panel-2); color: var(--dim); border-radius: 7px; padding: 7px 12px; cursor: pointer; }
.docs-toolbar button.active { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 600; }
.docs-toolbar .docs-close { margin-left: auto; color: var(--text); }
.docs-frame { width: 100%; min-height: 0; flex: 1; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px 16px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 600; }
.btn.danger { background: #9f302b; border-color: #c94c45; color: #fff; font-weight: 600; }
.btn:disabled, button:disabled { cursor: not-allowed; opacity: .5; }
.inline-error { margin: 10px; color: #ef8179; font-size: 12px; line-height: 1.4; }
.fatal-error { min-height: 100vh; display: grid; place-content: center; justify-items: start; gap: 12px; padding: 40px; }
.fatal-error h1,.fatal-error p { margin: 0; }
.fatal-error p { max-width: 680px; color: #ef8179; }
.app-dialog-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.68); }
.app-dialog { width: min(440px,100%); padding: 22px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: 0 24px 90px #000c; }
.app-dialog h2 { margin: 0 0 10px; font-size: 17px; }
.app-dialog p { margin: 0 0 16px; color: var(--dim); line-height: 1.45; white-space: pre-line; }
.app-dialog input,.app-dialog textarea { width: 100%; padding: 10px 11px; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; font: inherit; outline: none; }
.app-dialog input:focus,.app-dialog textarea:focus { border-color: var(--accent); }
.app-dialog textarea { min-height: 100px; resize: vertical; }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.prov-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.prov-row .prov-label { flex: 1; }
.prov-row .prov-note { font-size: 11px; color: var(--dim); display: block; }
.prov-row input { flex: 2; }
.test-result { font-size: 12px; margin-top: 6px; }
.test-result.ok { color: var(--green); }
.test-result.err { color: #d5544a; }
.hidden { display: none !important; }
.skill-item { display: flex; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 8px; margin: 6px 0; }
.skill-item .k { font-size: 10px; color: var(--dim); background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }
.grow { flex: 1; }
.muted, small { color: var(--dim); }
.field { display: block; font-size: 12px; color: var(--dim); margin: 12px 0 4px; }
.field > span { display: block; margin-bottom: 4px; }
.terminal-warning { display: flex !important; gap: 10px; align-items: flex-start; margin-top: 14px !important; padding: 10px; border: 1px solid #8a4e32; border-radius: 8px; color: #e8b08b !important; }
.terminal-warning input { width: auto !important; margin-top: 3px; }
.terminal-warning.disabled { opacity: .45; }
.artifact { align-self: flex-start; }
.provider-warning { align-self: stretch; display: flex; align-items: center; gap: 14px; margin: 10px 4px; padding: 12px 14px; border: 1px solid #8a6331; border-radius: 10px; background: #4d351766; }
.provider-warning > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.provider-warning span { color: var(--dim); font-size: 12px; }
.provider-warning .btn { flex: 0 0 auto; padding: 7px 10px; }
.codex-account,.codex-runtime-card { display:flex; flex-direction:column; gap:4px; margin:12px 0; padding:10px; border:1px solid var(--border); border-radius:8px; background:var(--panel-2); }
.codex-account span,.codex-runtime-card span { color:var(--dim); font-size:11px; }
.codex-account.warn { border-color:#8a6331; }
.codex-account .btn { align-self:flex-start; margin-top:5px; padding:6px 10px; }
.codex-browser { color:#9fc2f4 !important; border-color:#385c84; }
.codex-tag { color:#9fc2f4; border:1px solid #385c84; }
.opencode-tag { color:#9ee493; border:1px solid #3d7346; }
.field-hint { color:var(--dim);font-size:12px;margin:-4px 0 12px; }
.codex-approval { display:flex; flex-direction:column; gap:8px; margin:10px 0; padding:10px; border:1px solid #8a6331; border-radius:8px; background:#4d351733; }
.codex-approval code { max-height:120px; overflow:auto; white-space:pre-wrap; color:#e8c38b; font-size:11px; }
.codex-approval > div { display:flex; gap:6px; }
.codex-approval .btn { padding:6px 9px; font-size:11px; }

/* Phase 1.5 top-level view switcher and workspace. */
.view-tabs { position: fixed; z-index: 20; top: 8px; left: 12px; display: flex; gap: 3px; padding: 3px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; user-select: none; }
.view-tabs button { background: none; border: 0; color: var(--dim); padding: 4px 9px; border-radius: 5px; cursor: pointer; font-size: 11px; }
.view-tabs button.active { background: var(--hover); color: var(--text); }
#workspace-view { display: grid; grid-template-columns: 280px 6px minmax(320px,1fr); height: calc(100vh - 22px); padding-top: 0; }
.workspace-tree { display:flex; flex-direction:column; min-height:0; background: var(--panel); border-right: 1px solid var(--border); padding-top:16px; overflow:hidden; }
.workspace-tree > .side-foot { flex-shrink:0; }
.workspace-tree > .view-actions { padding:4px 12px 8px; }
.workspace-add { flex-shrink:0; padding:12px; }
.workspace-tree .workspace-add > button { width:100%; height:52px; border:1px dashed var(--border); border-radius:6px; color:var(--accent); background:var(--panel-2); }
.workspace-add > button:hover { border-color:var(--accent); background:var(--active); }
.workspace-add > button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.thing-type-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:20px 0; }
.thing-type-options .btn { display:flex; flex-direction:column; gap:10px; align-items:center; justify-content:center; min-height:78px; padding:12px 6px; }
.thing-type-options .btn svg { width:22px; height:22px; color:var(--accent); }
.thing-type-placement { display:flex; flex-direction:column; gap:8px; color:var(--dim); font-size:12px; }
.thing-type-placement select { min-height:38px; padding:8px; background:var(--panel-2); color:var(--text); border:1px solid var(--border); border-radius:6px; }
@media(max-width:700px) {
  #workspace-view { overflow:auto; }
  #workspace-view .workspace-tree { padding-top:16px; height:420px; }
  .workspace-tree .side-foot { flex-direction:row; justify-content:space-around; padding:8px 4px; }
  .workspace-tree .side-foot .workspace { display:none; }
  .workspace-tree .foot-btn { flex-direction:column; gap:4px; font-size:11px; padding:6px 8px; }
  .thing-type-options { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
}
.workspace-tree-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.workspace-tree-head > div { display: flex; gap: 5px; }
.workspace-tree select { max-width: 132px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 5px; }
.workspace-tree button, .tree-toggle { display: grid; place-items: center; background: none; color: var(--dim); border: 0; cursor: pointer; }
.workspace-tree .foot-btn { display:flex; justify-content:flex-start; }
.workspace-create-placement { display:flex; align-items:center; gap:7px; padding:7px 11px 3px; color:var(--dim); font-size:10px; }.workspace-create-placement select { flex:1; max-width:none; padding:4px; }
.workspace-search { display:flex; align-items:center; gap:6px; margin:7px 9px; padding:6px 8px; border:1px solid var(--border); border-radius:7px; background:var(--panel-2); color:var(--dim); }.workspace-search input { min-width:0; width:100%; border:0; outline:0; color:var(--text); background:transparent; }
.tree-root { min-height: 70%; padding: 8px; }
.thing-children { margin-left: 14px; border-left: 1px solid var(--border); padding-left: 3px; }
.thing-node { position:relative; }.thing-node.drop-before::before,.thing-node.drop-after::after { content:""; position:absolute; z-index:5; left:3px; right:3px; height:2px; border-radius:2px; background:var(--accent); }.thing-node.drop-before::before { top:0; }.thing-node.drop-after::after { bottom:0; }.thing-node.drop-inside > .thing-row { outline:1px solid var(--accent); background:color-mix(in srgb,var(--accent) 18%,transparent); }
.thing-row { display: flex; align-items: center; gap: 6px; min-height: 29px; padding: 4px 6px; border-radius: 6px; cursor: grab; }
.thing-row:hover { background: var(--hover); }.thing-row.active { background: var(--active); }
.tree-toggle { width: 14px; flex: 0 0 14px; }
.workspace-empty { display: grid; place-items: center; color: var(--dim); }
.thing-editor { min-width: 0; overflow: auto; padding: 48px 7vw 40px; }
.thing-breadcrumbs { display:flex; align-items:center; gap:6px; min-height:25px; overflow:hidden; color:var(--dim); font-size:11px; }.thing-breadcrumbs button { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:2px 3px; color:inherit; background:none; border:0; cursor:pointer; }.thing-breadcrumbs button[aria-current="page"] { color:var(--text); }
.thing-editor > header { display: flex; align-items: center; justify-content: space-between; }
.thing-editor > header > div { display: flex; gap: 6px; }.thing-kind { display: flex; align-items: center; gap: 6px; color: var(--dim); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.thing-title { display: block; width: 100%; margin: 20px 0 14px; padding: 0; background: none; border: 0; color: var(--text); font-size: 30px; font-weight: 700; outline: none; }
.thing-relations { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin:-4px 0 14px; color:var(--dim); font-size:10px; }.relation-chip { display:flex; border:1px solid var(--border); border-radius:999px; overflow:hidden; background:var(--panel-2); }.relation-chip button { padding:4px 7px; color:var(--dim); background:none; border:0; cursor:pointer; }.relation-chip button+button { border-left:1px solid var(--border); }
.thing-body { width: 100%; min-height: 55vh; resize: none; background: none; border: 0; outline: none; color: var(--text); font: inherit; line-height: 1.7; }
.view-actions { display: flex; align-items:center; gap: 8px; margin-bottom: 12px; }.view-actions select { padding:7px 9px; border:1px solid var(--border); border-radius:7px; color:var(--text); background:var(--panel-2); }.view-help { margin-left:auto; color:var(--dim); font-size:11px; }
.table-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }.table-scroll table { width: 100%; border-collapse: collapse; }.table-scroll th,.table-scroll td { min-width: 130px; padding: 7px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: left; }.table-scroll input,.table-scroll select { width: 100%; background: transparent; color: var(--text); border: 0; outline: none; }.table-thing-cell,.table-column-head { display:flex; align-items:center; gap:5px; }.table-thing-cell svg { color:var(--dim); cursor:grab; }.table-thing-cell button,.table-column-head button { margin-left:auto; color:var(--accent); background:none; border:0; cursor:pointer; font-size:10px; }.table-type { display:inline-flex; padding:2px 6px; border-radius:999px; background:var(--panel-2); color:var(--dim); font-size:10px; }
.dashboard-grid { position:relative; min-height:260px; display: grid; grid-template-columns: repeat(12,1fr); grid-auto-rows: 55px; gap: 10px; }.dashboard-empty { position:absolute; inset:0; display:grid; place-items:center; color:var(--dim); border:1px dashed var(--border); border-radius:10px; }.dashboard-block { position: relative; padding: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: auto; cursor:grab; }.dashboard-block small { text-transform: uppercase; letter-spacing: .08em; }.block-delete { position: absolute; right: 7px; top: 5px; background: none; border: 0; color: var(--dim); cursor: pointer; }.thing-link { margin-top: 12px; background: none; border: 0; color: var(--accent); cursor: pointer; }
.block-layout { display: inline-flex; gap: 2px; margin-left: 10px; }.block-layout button { background: var(--panel-2); border: 1px solid var(--border); color: var(--dim); width: 20px; cursor: pointer; }
.dash-todo { display: flex; gap: 7px; margin-top: 7px; color: var(--text); }.dash-todo input { width: auto; }
.thing-chat { position: fixed; z-index: 15; top: 38px; right: 0; bottom: 22px; width: 340px; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--border); box-shadow: -10px 0 30px #0008; }.thing-chat header { display: flex; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--border); }.thing-chat header strong { display: flex; gap: 6px; }.thing-chat header button { background: none; border: 0; color: var(--dim); cursor: pointer; }.thing-chat-meta { display: flex; flex-direction: column; gap: 6px; padding: 9px; }.thing-chat-meta select { min-width: 0; flex: 1; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); padding: 7px; border-radius: 6px; }.thing-chat-attach { display: flex; gap: 6px; }.thing-chat-messages { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; }.thing-chat-compose { display: flex; padding: 9px; border-top: 1px solid var(--border); }.thing-chat-compose input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 8px; }.thing-chat-compose button { background: var(--accent); border: 0; padding: 8px; }
.thing-bot-grant { display:flex; gap:6px; }.thing-bot-grant .btn { padding:5px 8px; }
.terminal-panel { position: fixed; z-index: 40; inset: 12vh 8vw 8vh; display: flex; flex-direction: column; background: #0b0b0d; border: 1px solid #45454e; border-radius: 10px; box-shadow: 0 25px 90px #000; overflow: hidden; }.terminal-panel header { display: flex; gap: 12px; align-items: center; padding: 9px 12px; background: var(--panel); border-bottom: 1px solid var(--border); }.terminal-panel header span { flex: 1; color: var(--dim); }.terminal-panel header button { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 5px 10px; border-radius: 5px; }.terminal-host { flex: 1; min-height: 0; padding: 10px; }.terminal-host .xterm { height: 100%; }.terminal-host .xterm-viewport { scrollbar-color: #45454e #0b0b0d; scrollbar-width: thin; }.terminal-host .xterm-viewport::-webkit-scrollbar { width: 8px; }.terminal-host .xterm-viewport::-webkit-scrollbar-track { background: #0b0b0d; }.terminal-host .xterm-viewport::-webkit-scrollbar-thumb { background: #45454e; border-radius: 4px; }

.resize-handle { position: relative; z-index: 8; width: 6px; min-width: 6px; height: 100%; cursor: col-resize; touch-action: none; outline: none; background: var(--bg); }
.resize-handle::before { content: ''; position: absolute; inset: 0 2px; background: var(--border); transition: background .12s,inset .12s; }.resize-handle:hover::before,.resize-handle:focus-visible::before,.resizing-panels .resize-handle::before { inset: 0 1px; background: var(--accent); }.resize-handle span { position: absolute; top: 50%; left: 1px; width: 4px; height: 32px; transform: translateY(-50%); border-radius: 4px; }
body.resizing-panels { cursor: col-resize !important; user-select: none; }.thing-chat > .resize-handle { position: absolute; top: 0; bottom: 0; left: -3px; height: 100%; }

/* Stable spatial Canvas and drawing-first Creator Flow. */
.thing-editor.immersive { display: flex; flex-direction: column; height: calc(100vh - 22px); overflow: hidden; padding: 52px 24px 18px; }
.thing-editor.immersive .thing-title { flex: 0 0 auto; margin: 12px 0 10px; font-size: 24px; }
.workspace-view-toolbar { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--dim); border-bottom: 1px solid var(--border); background: var(--panel); }.workspace-view-toolbar > span:first-child { flex:1; font-size:11px; }.workspace-view-toolbar .btn { display:inline-flex; align-items:center; gap:5px; padding:6px 9px; font-size:11px; white-space:nowrap; }.workspace-view-toolbar em { font-size:11px; color:var(--accent); }
.canvas-shell,.creator-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.canvas-stage { position: relative; flex: 1; min-height: 0; }.canvas-stage .react-flow { background: #101116; }.canvas-stage .react-flow__controls button { background: var(--panel); color: var(--text); border-color: var(--border); fill: currentColor; }.canvas-stage .react-flow__minimap { background: var(--panel); border: 1px solid var(--border); }
.canvas-card { min-width: 150px; max-width: 230px; display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border: 1px solid #4d5360; border-radius: 10px; background: #1b1e25; box-shadow: 0 8px 24px #0005; }.canvas-card strong { overflow: hidden; text-overflow: ellipsis; }.canvas-card small { text-transform: uppercase; letter-spacing: .08em; font-size: 9px; }.canvas-card.note { background: #3c331b; border-color: #8d7330; }.canvas-card.idea { border-color: #875bb0; background: #2c2038; }.canvas-card.thing { border-color: #436f9c; background: #192c3d; }.canvas-card .react-flow__handle { width: 8px; height: 8px; background: var(--accent); border-color: #fff8; }
.canvas-empty { pointer-events: none; position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--dim); }.view-loading { display: grid; place-items: center; flex: 1; color: var(--dim); }
.creator-tools { min-height: 42px; display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-bottom: 1px solid var(--border); }.creator-tools button { display: inline-flex; align-items: center; gap: 5px; min-width: 30px; min-height: 28px; justify-content: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; color: var(--dim); cursor: pointer; }.creator-tools button.active { color: var(--text); border-color: var(--accent); }.creator-tools button.color { min-width: 19px; min-height: 19px; width: 19px; height: 19px; border-radius: 50%; }.creator-tools button.color.active { outline: 2px solid var(--accent); outline-offset: 2px; }.creator-tools input { width: 90px; accent-color: var(--accent); }.creator-tools .btn { margin-left: auto; padding: 5px 9px; color: var(--text); }
.creator-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px,1fr) 6px 280px; }.drawing-wrap { min-width: 0; display: grid; place-items: center; padding: 18px; overflow: auto; background-color: #0c0d10; background-image: linear-gradient(45deg,#15161a 25%,transparent 25%),linear-gradient(-45deg,#15161a 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#15161a 75%),linear-gradient(-45deg,transparent 75%,#15161a 75%); background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0; }.drawing-wrap canvas { display: block; width: min(100%,960px); aspect-ratio: 16/9; border: 1px solid #393b43; border-radius: 4px; box-shadow: 0 18px 45px #0009; touch-action: none; cursor: crosshair; }
.storyboard-strip { overflow: auto; padding: 10px; border-left: 1px solid var(--border); background: var(--panel); }.storyboard-strip > header { display: flex; justify-content: space-between; margin-bottom: 10px; }.storyboard-strip article { margin-bottom: 10px; padding: 7px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }.storyboard-strip article.active { border-color: var(--accent); }.panel-preview { position: relative; display: block; width: 100%; border: 0; background: #111; cursor: pointer; }.panel-preview img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }.panel-preview span { position: absolute; z-index: 1; top: 5px; left: 5px; min-width: 20px; padding: 2px 5px; border-radius: 4px; color: white; background: #000a; font-size: 10px; }.storyboard-strip textarea { width: 100%; min-height: 58px; margin-top: 6px; padding: 6px; resize: vertical; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; }.storyboard-strip footer { display: flex; justify-content: flex-end; gap: 4px; margin-top: 6px; }.storyboard-strip footer button,.panel-links button { display: grid; place-items: center; padding: 4px; background: var(--bg); color: var(--dim); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }.storyboard-strip button:disabled { opacity: .3; }.panel-links { display: flex; flex-wrap: wrap; gap: 3px; }.panel-links button { display: inline-block; max-width: 100%; padding: 3px 5px; overflow: hidden; text-overflow: ellipsis; font-size: 9px; color: #87bcef; }
.thing-picker-backdrop { position:fixed; z-index:80; inset:0; display:grid; place-items:center; background:#0009; }.thing-picker { width:min(560px,92vw); max-height:min(680px,86vh); display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--border); border-radius:12px; background:var(--panel); box-shadow:0 24px 80px #000b; }.thing-picker > header { display:flex; justify-content:space-between; align-items:center; padding:14px; border-bottom:1px solid var(--border); }.thing-picker > header button { color:var(--dim); background:none; border:0; cursor:pointer; }.thing-picker-search { display:flex; align-items:center; gap:7px; margin:10px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; color:var(--dim); background:var(--panel-2); }.thing-picker-search input { flex:1; min-width:0; color:var(--text); background:none; border:0; outline:0; }.thing-picker-results { min-height:160px; overflow:auto; padding:0 10px 10px; }.thing-picker-results > button { width:100%; display:flex; align-items:center; gap:10px; padding:9px; color:var(--text); text-align:left; background:none; border:0; border-radius:7px; cursor:pointer; }.thing-picker-results > button:hover { background:var(--hover); }.thing-picker-results > button > span:last-child { min-width:0; display:flex; flex-direction:column; }.thing-picker-results strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.thing-picker-results small { color:var(--dim); }.thing-picker-icon { width:25px; height:25px; display:grid; place-items:center; border-radius:6px; color:var(--accent); background:var(--panel-2); }
@media (max-width: 900px) { .creator-body { grid-template-columns: 1fr !important; }.creator-body > .resize-handle { display: none; }.storyboard-strip { max-height: 220px; border-left: 0; border-top: 1px solid var(--border); }.workspace-view-toolbar > span:first-child,.view-help { display: none; } }

.workspace-files { margin: 6px 12px; border: 1px solid var(--border, #34343c); border-radius: 8px; flex-shrink: 0; }
.workspace-files summary { cursor: pointer; padding: 8px 12px; font-weight: 600; }
.workspace-files-content { padding: 0 12px 10px; max-height: 240px; overflow: auto; }
.workspace-path { font-size: 11px; opacity: .7; overflow-wrap: anywhere; }
.workspace-file-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.workspace-file-actions label { position: relative; overflow: hidden; }
.workspace-file-actions input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.workspace-files ul { list-style: none; margin: 8px 0; padding: 0; }
.workspace-files li { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.workspace-file-name { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: inherit; overflow-wrap: anywhere; cursor: pointer; }
.workspace-file-name:disabled { opacity: .7; cursor: default; }
.thing-editor > header .workspace-files { position: relative; margin: 0; }
.thing-editor > header .workspace-files-content { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: min(560px, 65vw); padding: 12px; background: var(--panel, #20232b); border: 1px solid var(--border, #34343c); border-radius: 8px; box-shadow: 0 10px 30px #0005; }
.module-frame { display: block; width: 100%; min-height: 520px; border: 1px solid var(--border); border-radius: 10px; margin-top: 16px; background: var(--panel); }
.module-unavailable { padding: 24px; border: 1px dashed var(--border); border-radius: 10px; margin-top: 20px; }
.plugins-modal { width: min(900px,94vw); }
.directory-center { overflow: hidden; }
.directory-view { height: 100%; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.directory-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 28px 34px 20px; border-bottom: 1px solid var(--border); background: var(--panel); }
.directory-header h1 { margin: 4px 0 4px; font-size: 24px; }
.directory-header p { margin: 0; color: var(--dim); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--accent); font-weight: 700; }
.directory-content { flex: 1; overflow: auto; padding: 22px 34px 44px; }
.directory-content > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.directory-section { margin-top: 22px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.directory-section h2 { margin: 0 0 14px; font-size: 16px; }
.directory-bot,.directory-request { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.directory-bot:first-of-type,.directory-request:first-of-type { border-top: 0; }
.directory-bot-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; }
.directory-bot p,.directory-request p { margin: 4px 0 0; color: var(--dim); font-size: 12px; }
.directory-request { align-items: flex-start; flex-wrap: wrap; }
.directory-request .btn { flex: 0 0 auto; }
.directory-view .scheduler-panel { max-width: none; margin: 0 0 22px; }

/* Persistent utility surfaces share the workspace's center pane. */
.utility-panel { height:100%; min-width:0; display:flex; flex-direction:column; background:var(--bg); }
.utility-header,.directory-header { min-height:76px; padding:20px 28px; align-items:center; background:var(--panel); border-bottom:1px solid var(--border); display:flex; justify-content:space-between; gap:16px; }
.utility-header h1,.directory-header h1 { font-size:20px; line-height:1.4; margin:0; font-weight:600; }
.utility-body { flex:1; min-height:0; overflow:auto; padding:24px 28px 48px; }
.utility-body > * { max-width:1040px; margin-left:auto; margin-right:auto; }
.utility-body h2 { font-size:16px; margin:0 0 12px; }
.utility-body h3,.directory-content h3 { font-size:14px; margin:28px 0 14px; }
.utility-body p,.directory-content p { line-height:1.6; overflow-wrap:anywhere; }
.utility-body .muted { margin:8px 0 24px; }
.settings-tabs { display:flex; gap:24px; border-bottom:1px solid var(--border); margin-bottom:28px; overflow-x:auto; }
.settings-tabs button { flex-shrink:0; background:none; border:0; border-bottom:2px solid transparent; color:var(--dim); padding:12px 0; font:inherit; cursor:pointer; }
.settings-tabs button.active { color:var(--text); border-bottom-color:var(--accent); }
.utility-body label,.directory-content label { display:flex; flex-direction:column; gap:8px; font-size:12px; font-weight:500; color:var(--dim); margin:0; min-width:0; }
.utility-body input:not([type=checkbox]),.utility-body select,.utility-body textarea,
.directory-content input:not([type=checkbox]),.directory-content select,.directory-content textarea {
  width:100%; min-width:0; min-height:38px; padding:9px 12px; color:var(--text); background:var(--panel-2); border:1px solid #3a3a44; border-radius:6px; font:inherit; box-shadow:0 1px 2px #0002;
}
.utility-body textarea { min-height:100px; resize:vertical; }
.utility-body input[type=checkbox],.directory-content input[type=checkbox] { width:16px; height:16px; flex-shrink:0; accent-color:var(--accent); }
.utility-body label:has(> input[type=checkbox]),.directory-content label:has(> input[type=checkbox]) { flex-direction:row; align-items:center; align-self:center; min-height:38px; color:var(--text); }
.utility-body :is(input,select,textarea):focus-visible,.directory-content :is(input,select,textarea):focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-color:var(--accent); }
.btn { min-height:34px; border-radius:6px; font-weight:500; transition:background .15s,border-color .15s; }
.btn:focus-visible,.foot-btn:focus-visible,.settings-tabs button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.icon-btn { width:34px; height:34px; padding:0; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
#modal { border-radius:8px; padding:24px; }
#modal .dialog-heading h2 { margin:0; }
#modal label { margin-top:16px; }
#modal input[type=checkbox] { width:16px; accent-color:var(--accent); }
.foot-btn { display:flex; align-items:center; gap:10px; }
.view-tabs button { display:inline-flex; align-items:center; justify-content:center; gap:8px; white-space:nowrap; }
.view-tabs { position:relative; top:0; left:0; height:48px; width:100%; border-radius:0; border:0; border-bottom:1px solid var(--border); padding:8px 16px; gap:6px; overflow-x:auto; background:var(--panel); }
#app,#workspace-view { height:calc(100vh - 70px); }
.side-top { height:16px; }
.view-tabs button { padding:7px 12px; font-size:12px; }
.view-tabs button.active { background:var(--active); color:var(--accent); }
.prov-row { display:grid; grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto; align-items:center; gap:20px; padding:20px 0; border-bottom:1px solid var(--border); }
.prov-label { font-weight:600; line-height:1.5; }
.prov-note { display:block; margin-top:6px; color:var(--dim); font-size:12px; font-weight:400; }
.directory-content { padding:24px 28px 48px; }
.directory-section { border:0; border-radius:0; background:transparent; padding:24px 0; border-top:1px solid var(--border); }
.directory-bot-avatar { border-radius:6px; flex-shrink:0; }
.directory-bot .status-pill { margin-left:10px; }
.directory-request .grow { flex-basis:260px; }
.utility-panel.docs-modal { width:100% !important; max-width:none !important; height:100%; max-height:none !important; padding:0 !important; }
.utility-panel.docs-modal .utility-body { display:flex; flex-direction:column; padding:16px; overflow:hidden; }
.utility-panel.docs-modal .docs-toolbar { width:100%; max-width:none; flex-shrink:0; }
.utility-panel.docs-modal .docs-frame { flex:1; width:100%; max-width:none; min-height:0; }
.utility-panel.plugins-modal { width:100%; }
.utility-body .scheduler-panel,.directory-content .scheduler-panel { border:0; padding:0; margin:0; max-height:none; overflow:visible; }
.utility-body .scheduler-panel > summary,.directory-content .scheduler-panel > summary { font-size:15px; margin-bottom:16px; cursor:pointer; }
.utility-body .scheduler-panel > p,.directory-content .scheduler-panel > p { color:var(--dim); margin:12px 0 20px; }
.utility-body .scheduler-panel .view-actions,.directory-content .scheduler-panel .view-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end; gap:20px 16px; margin:20px 0 28px; }
.utility-body .scheduler-panel input[type=number],.directory-content .scheduler-panel input[type=number] { width:100%; }
.scheduler-resource-status { border-top:1px solid var(--border); border-bottom:1px solid var(--border); padding:20px 0; line-height:1.6; margin:24px 0; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:16px; }
.capacity-metric { display:flex; flex-direction:column; gap:4px; }
.capacity-metric span { color:var(--dim); font-size:12px; }
.capacity-metric strong { font-size:24px; font-weight:600; }
.capacity-memory { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:24px; color:var(--dim); font-size:12px; }
.capacity-memory strong { color:var(--text); font-weight:500; margin-left:8px; }
.utility-body .scheduler-panel article,.directory-content .scheduler-panel article { padding:18px 0; border-bottom:1px solid var(--border); overflow-wrap:anywhere; line-height:1.6; }
.scheduler-panel article p { margin:6px 0 12px; color:var(--dim); }
.scheduler-panel article .btn { margin:4px 8px 4px 0; }
.utility-body .scheduler-panel > label { margin:20px 0; }
.utility-body .scheduler-panel > .btn { margin:8px 8px 12px 0; }
.utility-body .scheduler-panel details { margin:24px 0; border-top:1px solid var(--border); padding-top:20px; }
.utility-body .scheduler-panel details > *:not(summary) { margin-top:16px; }
.utility-body pre { white-space:pre-wrap; overflow-wrap:anywhere; padding:16px; background:var(--panel-2); border-radius:6px; margin:16px 0; }
.skill-item { padding:18px 0; gap:14px; line-height:1.6; border-bottom:1px solid var(--border); }
.utility-body .plugin-card { border:0; border-bottom:1px solid var(--border); border-radius:0; background:transparent; padding:20px 0; margin:0; }
.utility-body .plugin-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.utility-body .plugin-instance { display:flex; flex-wrap:wrap; gap:16px; align-items:center; border-bottom:1px solid var(--border); padding:20px 0; }
.utility-body .plugin-manager > .btn { margin:0 8px 16px 0; }
.utility-body .plugin-manager > p { margin:12px 0 20px; color:var(--dim); }
.utility-body .plugin-package-review { padding:20px 0; }
.utility-body .plugin-package-review label { margin:16px 0; }
@media(max-width:900px) {
  .prov-row { grid-template-columns:minmax(0,1fr) auto; gap:12px; }
  .prov-label { grid-column:1/-1; }
  .utility-header,.directory-header { padding:18px 20px; }
  .utility-body,.directory-content { padding:20px; }
}
@media(max-width:600px) {
  .scheduler-resource-status { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #app:has(.utility-panel),#app:has(.directory-view) { grid-template-columns:minmax(0,1fr) !important; }
  #app.utility-layout { grid-template-rows:minmax(0,1fr) auto; }
  #app.utility-layout > #sidebar { display:flex; grid-row:2; }
  #app.utility-layout > #center { grid-row:1; }
  #app.utility-layout .side-foot { flex-direction:row; justify-content:space-around; padding:8px 4px; }
  #app.utility-layout .side-foot .workspace { display:none; }
  #app.utility-layout .foot-btn { flex-direction:column; gap:4px; font-size:11px; padding:6px 8px; }
  .utility-body .scheduler-panel .view-actions,.directory-content .scheduler-panel .view-actions { grid-template-columns:minmax(0,1fr); }
  .settings-tabs { gap:18px; }
}
.plugin-manager h3 { margin: 16px 0 8px; }
.plugin-manager p { color: var(--dim); line-height: 1.6; }
.plugin-card,.plugin-instance,.plugin-package-review { padding: 14px; margin: 12px 0; border: 1px solid var(--border); border-radius: 9px; }
.plugin-card h3 { margin-top: 0; }.plugin-card small { color: var(--dim); font-size: 12px; font-weight: normal; }
.plugin-actions { display:flex; gap:8px; flex-wrap:wrap; }
.plugin-instance { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.plugin-manager select { background:var(--bg); color:var(--text); border:1px solid var(--border); border-radius:5px; padding:5px; }
.plugin-manager pre { overflow:auto; font-size:11px; user-select:text; }

/* Workspace collections, scale and accessible editing. */
.workspace-tree { display:flex; flex-direction:column; overflow:hidden; }
.virtual-tree { flex:1; min-height:120px; overflow:auto; padding:0 6px; }
.virtual-tree .thing-row { box-sizing:border-box; }
.thing-row > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.thing-row input[type=checkbox] { width:13px; height:13px; flex:none; }
.tree-move { opacity:.55; }.thing-row:hover .tree-move,.thing-row:focus-within .tree-move { opacity:1; }
.thing-row[data-drop=before] { border-top:2px solid var(--accent); }.thing-row[data-drop=after] { border-bottom:2px solid var(--accent); }.thing-row[data-drop=inside] { outline:1px solid var(--accent); }
.view-actions,.bulk-actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin:8px 0; }
.collection-view button,.bulk-actions button,.view-settings button,.history-panel button,.property-editor button,.conflict-panel button { color:var(--text); background:var(--panel-2); border:1px solid var(--border); border-radius:5px; padding:6px 8px; cursor:pointer; }
.collection-view select,.collection-view input,.property-editor input,.property-editor select,.presence input { color:var(--text); background:var(--panel-2); border:1px solid var(--border); border-radius:4px; padding:5px; min-width:0; }
.view-settings { padding:12px; border:1px solid var(--border); border-radius:8px; display:flex; flex-direction:column; gap:8px; }
.filter-row { display:flex; gap:6px; }.view-settings label { display:flex; align-items:center; gap:8px; }
.virtual-table { height:480px; max-height:60vh; overflow:auto; }.virtual-table thead { position:sticky; top:0; background:var(--panel); z-index:2; }.virtual-table tr { height:48px; }.virtual-table td { box-sizing:border-box; height:48px; }.virtual-table td:first-child,.virtual-table th:first-child { min-width:35px; width:35px; }.virtual-table input[type=checkbox] { width:16px; }
.board-view { display:flex; gap:12px; overflow:auto; max-height:650px; }.board-view > section { min-width:230px; max-width:300px; flex:1; background:var(--panel); padding:12px; border:1px solid var(--border); border-radius:8px; }.board-view article,.calendar-view article { padding:8px; background:var(--panel-2); border:1px solid var(--border); margin:6px 0; border-radius:6px; }.board-view article small,.calendar-view article small { display:block; color:var(--dim); }
.calendar-view { display:grid; grid-template-columns:repeat(7,minmax(90px,1fr)); overflow:auto; border:1px solid var(--border); }.calendar-view > section { min-height:100px; border:1px solid var(--border); padding:5px; }.calendar-view article { font-size:11px; }
.timeline-view > div { display:grid; grid-template-columns:160px 1fr; gap:8px; margin:8px 0; }.timeline-track { background:var(--panel); min-width:200px; }.timeline-track span { display:block; background:var(--accent); color:#111; overflow:hidden; white-space:nowrap; padding:5px 0; border-radius:4px; }
.property-editor { padding:12px; border:1px solid var(--border); border-radius:8px; margin:12px 0; }.property-editor label { display:grid; grid-template-columns:150px 1fr; align-items:center; gap:12px; margin:8px 0; }.relation-values { display:flex; gap:4px; flex-wrap:wrap; max-height:70px; overflow:auto; }
.history-panel pre,.conflict-panel pre { white-space:pre-wrap; overflow:auto; max-height:200px; }.history-panel article { border-bottom:1px solid var(--border); padding:12px; }.history-panel small { display:block; color:var(--dim); }
.conflict-panel { background:#594619; padding:12px; border-radius:8px; }.presence { display:flex; gap:12px; align-items:center; font-size:11px; color:var(--dim); }.presence input { max-width:120px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media(pointer:coarse) { .workspace-tree button,.thing-editor button,.thing-picker button,.collection-view select,.property-editor input { min-height:44px; min-width:44px; }.virtual-tree .thing-row button { min-height:32px; min-width:32px; }.virtual-tree input[type=checkbox] { width:22px;height:22px; } }
@media(max-width:700px) { #workspace-view { grid-template-columns:1fr!important; height:auto; min-height:100vh; }#workspace-view > .resize-handle { display:none; }.workspace-tree { padding-top:36px; height:320px; }.thing-editor { padding:16px; min-height:450px; }.thing-editor > header { flex-wrap:wrap; }.thing-editor > header > div { flex-wrap:wrap; }.thing-picker { width:calc(100vw - 24px); max-height:90vh; }.calendar-view { grid-template-columns:repeat(7,minmax(85px,1fr)); }.thing-chat { position:fixed; inset:0; width:100%!important; z-index:20; } }
.schema-designer,.dependency-view { margin:12px 0; padding:10px; border:1px solid var(--border); border-radius:6px; }.schema-field { display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:8px 0; border-bottom:1px solid var(--border); }.schema-field small { color:var(--dim); }.dependency-view [role=listitem] { display:flex; align-items:center; gap:14px; padding:8px; }.dependency-view button,.dependency-view strong { color:var(--text); background:var(--panel); padding:8px; border:1px solid var(--border); border-radius:6px; }
.thing-editor > header { gap:12px; flex-wrap:wrap; }.thing-editor > header > div { flex-wrap:wrap; }.thing-editor > header .hdr-btn { width:auto; min-width:30px; height:auto; min-height:30px; padding:5px 8px; margin-left:0; font-size:12px; white-space:nowrap; }

.scheduler-panel{padding:16px;max-height:65vh;overflow:auto;border:1px solid var(--border);margin:12px 0}.scheduler-panel article{padding:10px;border-bottom:1px solid var(--border)}.scheduler-panel input[type=number]{width:110px}.scheduler-panel .view-actions{display:flex;flex-wrap:wrap;gap:10px}.file-presenter{position:fixed;right:16px;top:65px;bottom:32px;width:min(720px,90vw);z-index:1000;background:#171b24;border:1px solid #687086;padding:16px;overflow:auto;box-shadow:0 10px 50px #0009}.file-presenter header{display:flex;justify-content:space-between;gap:12px}.file-preview pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:45vh;overflow:auto;padding:12px;background:#10131a}.workspace-files nav{display:flex;gap:8px}

.fleet-offline{position:sticky;top:0;z-index:100;background:#593b12;color:#fff;padding:12px;}
[aria-label="Fleet connections"] article{padding:12px 0;border-bottom:1px solid #333;}
[aria-label="Fleet connections"] label{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0;align-items:center;}
[aria-label="Fleet connections"] input,[aria-label="Fleet connections"] textarea,[aria-label="Fleet connections"] select{max-width:100%;min-height:44px;}
[aria-label="Fleet connections"] textarea{width:100%;}
[aria-label="Fleet connections"] pre{white-space:pre-wrap;overflow-wrap:anywhere;}
.fleet-credential{margin:12px 0 18px;padding:14px;border:1px solid #5e8f73;border-radius:6px;background:#14251d;}
.fleet-credential p{margin:6px 0 10px;}
.fleet-credential textarea{display:block;width:100%;margin:0 0 10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}
.fleet-readiness{margin:12px 0 18px;padding:14px;border:1px solid #9a693c;border-radius:6px;background:#2b2117;}
.fleet-readiness p{margin:8px 0 0;color:#f0d6bc;}
@media(max-width:600px){[aria-label="Fleet connections"] .btn{min-height:44px;margin:4px;}[aria-label="Fleet connections"] label{display:block;}[aria-label="Fleet connections"] code{overflow-wrap:anywhere;}}
.worker-settings { min-width: 0; }
.worker-toolbar .btn,.worker-row .btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:36px; }
.worker-toolbar,.worker-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:12px 0; }
.worker-toolbar label { display:flex; flex-direction:column; gap:6px; flex:1 1 160px; min-width:0; }
.worker-toolbar .worker-toggle { flex-direction:row; align-items:center; }
.worker-toolbar input,.worker-toolbar select { width:100%; }
.worker-toggle input { width:auto; }
.worker-row strong { flex:1 1 180px; overflow-wrap:anywhere; }
.worker-memory-layout { display:grid; grid-template-columns:200px minmax(0,1fr); gap:24px; margin:20px 0; }
.worker-document-list { display:flex; flex-direction:column; gap:4px; }
.worker-document-list button:not(.icon-btn) { text-align:left; display:flex; flex-direction:column; padding:10px; border:0; border-bottom:1px solid var(--border); background:transparent; color:inherit; }
.worker-document-list button.active { background:var(--surface-2,#282c31); }
.worker-editor { display:flex; flex-direction:column; gap:16px; margin:20px 0; min-width:0; }
.worker-editor label,.worker-settings>label { display:flex; flex-direction:column; gap:8px; }
.worker-editor textarea,.worker-settings textarea { width:100%; box-sizing:border-box; resize:vertical; padding:12px; line-height:1.6; }
.worker-list { margin-top:24px; }
.worker-list article { border-top:1px solid var(--border); padding:16px 0; }
.worker-list pre,.worker-settings pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; line-height:1.6; }
.worker-list details a { display:block; overflow-wrap:anywhere; margin:8px 0; }
.worker-code { font-family:monospace; font-size:12px; }
.worker-deliverable { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:10px 0; }
.worker-deliverable small { flex-basis:100%; }
.worker-settings code { overflow-wrap:anywhere; }
.verified { color:#69cc9c; }
@media(max-width:650px) { .worker-memory-layout { grid-template-columns:minmax(0,1fr); gap:16px; } .worker-document-list { max-height:180px; overflow:auto; } }
.worker-media-image{display:block;max-width:100%;width:480px;height:auto;object-fit:contain;margin:12px 0;}
