:root {
  color-scheme: dark;
  --bg: #080c0e;
  --panel: #0b1113;
  --panel-hi: #11191c;
  --line: #718086;
  --line-dim: #293438;
  --text: #eef2f0;
  --muted: #a9b3b7;
  --green: #43ec8d;
  --amber: #e5b749;
  --orange: #ef7640;
  --red: #fb666c;
  --blue: #70a8d9;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #536065 #0a0f11; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body {
  color: var(--text);
  font: 12px/1.35 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: .025em;
  background: radial-gradient(circle at 50% 10%, #1b272b55, transparent 36rem), #070b0d;
}
body::after { position: fixed; inset: 0; z-index: 100; pointer-events: none; content: ""; background: repeating-linear-gradient(0deg, transparent 0 3px, #0003 3px 4px); opacity: .45; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }

.app-frame { height: 100dvh; padding: 18px; }
.sidebar, .panel, .metric { border: 1px solid var(--line); background: linear-gradient(120deg, #0a1012f7, #080d0ff7); box-shadow: inset 0 0 0 3px #070b0d, inset 0 0 0 4px var(--line-dim); }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px currentColor; }
.status-dot.online { background: var(--green); color: var(--green); }
.status-dot.offline { background: var(--red); color: var(--red); }

.workspace { height: 100%; min-height: 0; display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 10px; }
.sidebar { min-height: 0; display: flex; flex-direction: column; }
.sidebar-brand { flex: 0 0 auto; display: flex; flex-direction: column; padding: 18px 14px 15px; border-bottom: 1px solid var(--line); }
.sidebar-brand-row { min-width: 0; display: flex; align-items: center; gap: 10px; }
.sidebar-brand h1 { font-size: 18px; line-height: 1.05; letter-spacing: .075em; text-transform: uppercase; text-shadow: 0 0 14px #fff2; }
.sidebar-mantra { margin-top: 12px; color: #bac5ca; font-size: 8px; line-height: 1.55; letter-spacing: .07em; }
.sidebar-health { min-width: 0; display: flex; align-items: center; gap: 6px; margin-left: auto; color: #c1cbd0; font-size: 7px; }
.sidebar-health .status-dot { width: 8px; height: 8px; }
.sidebar-context { margin-top: 10px; overflow-wrap: anywhere; color: #7f8d92; font-size: 7px; line-height: 1.45; letter-spacing: 0; }
.nav-items { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.nav-item { width: 100%; height: 57px; display: flex; align-items: center; gap: 20px; padding: 0 17px; border: 0; border-bottom: 1px solid var(--line-dim); background: transparent; color: #c1cbd0; letter-spacing: .045em; text-align: left; text-decoration: none; }
.nav-item:first-child { border-top: 1px solid var(--line-dim); }
.nav-item:hover { background: #26323780; color: white; }
.nav-item.active { background: linear-gradient(90deg, #303b3f, #242e32); color: #fff; box-shadow: inset 3px 0 0 #aeb9bd; }
.nav-icon { width: 22px; color: white; font-size: 22px; text-align: center; }

.main-content { min-width: 0; min-height: 0; display: grid; grid-template-columns: var(--main-left-width, minmax(540px, 1.68fr)) 10px minmax(400px, 1fr); grid-template-rows: minmax(300px, 1fr) 205px; column-gap: 0; row-gap: 10px; }

.operations-grid { display: contents; }
.office-panel { grid-column: 1; grid-row: 1; }
.right-column { min-width: 0; min-height: 0; grid-column: 3; grid-row: 1 / 3; display: grid; grid-template-rows: minmax(255px, 1fr) 155px 205px; gap: 10px; }
.panel-width-resizer { position: relative; z-index: 5; grid-column: 2; grid-row: 1 / -1; display: none; width: 10px; min-width: 10px; padding: 0; border: 0; outline: 0; background: transparent; cursor: col-resize; touch-action: none; }
.panel-width-resizer::before { position: absolute; inset: 0 4px; content: ""; background: var(--line-dim); transition: background .12s, box-shadow .12s; }
.panel-width-resizer span { position: absolute; top: 50%; left: 2px; width: 6px; height: 34px; border: 1px solid var(--line); background: #0b1113; transform: translateY(-50%); }
.panel-width-resizer:hover::before, .panel-width-resizer:focus-visible::before, .panel-width-resizer.is-dragging::before { background: var(--green); box-shadow: 0 0 7px #43ec8d77; }
body[data-page="dashboard"] .panel-width-resizer { display: block; }
body.is-resizing-panels { cursor: col-resize; user-select: none; }
.panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel-header { width: 100%; height: 43px; min-height: 43px; flex: 0 0 43px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 13px; background: #0a1012; }
.panel-header > div:first-child { display: flex; align-items: center; gap: 12px; }
.panel-header h2 { font-size: 13px; letter-spacing: .055em; white-space: nowrap; }
.header-icon { width: 21px; font-size: 18px; text-align: center; }
.panel-header-actions { min-width: 0; height: 100%; display: flex; align-items: center; gap: 10px; margin-left: auto; }
.panel-collapse-button { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-dim); background: transparent; color: var(--muted); }
.panel-collapse-button:hover { border-color: var(--line); background: #fff1; color: var(--text); }
.panel-collapse-button:focus-visible { outline: 1px solid var(--green); outline-offset: 1px; }
.panel-toggle-symbol { font-size: 16px; line-height: 1; transform: translateY(-1px); }
.panel.is-minimized { height: 43px; min-height: 43px !important; align-self: start; }
.panel.is-minimized > :not(.panel-header) { display: none !important; }
.panel.is-minimized > .panel-header { border-bottom: 0; }
.panel-meta, .streaming { color: #aab5b9; font-size: 10px; }
.header-action { height: 27px; padding: 0 10px; border: 1px solid var(--line); background: #11191c; color: var(--green); font-size: 9px; }
.header-action:hover { background: #1b272a; }
.header-action.icon-button { width: 29px; min-width: 29px; height: 29px; display: grid; place-items: center; padding: 0; }
.header-action.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: square; stroke-linejoin: miter; stroke-width: 1.5; }
.registry-header-actions { display: flex; align-items: center; gap: 10px; }
.registry-header-actions .panel-meta { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-registry-panel .panel-header > div:first-child { gap: 8px; }
.agent-registry-panel .panel-header h2 { font-size: 11px; }
.agent-registry-panel .registry-header-actions { gap: 6px; }
.panel-body { min-width: 0; min-height: 0; flex: 1 1 auto; background-color: #080e10; box-shadow: inset 0 0 0 1px #11191c; }

.office-panel { display: flex; flex-direction: column; }
.office { position: relative; flex: 1; min-height: 0; overflow: hidden; border: 4px solid #0b1012; background: #b6b3ae url("/assets/office/background.png") center / 100% 100% no-repeat; box-shadow: inset 0 0 0 1px #677277; image-rendering: pixelated; }
.agent-floor { position: absolute; z-index: 5; inset: 25% 5% 8%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); align-items: center; justify-items: center; gap: 2% 1%; }
.office-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; color: #8f9ba0; text-align: center; }
.office-empty strong { color: #dbe2e0; font-size: 14px; letter-spacing: .06em; }
.desk-agent { position: relative; width: min(100%, 205px); aspect-ratio: 1 / 1.05; padding: 0 0 22px; border: 0; outline: 0; background: transparent; cursor: pointer; color: var(--text); transition: transform .12s ease, filter .12s ease; }
.desk-agent:hover, .desk-agent:focus-visible { z-index: 2; transform: translateY(-3px) scale(1.03); }
.desk-agent:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.desk-sprite { width: 100%; height: calc(100% - 16px); display: block; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(5px 7px 2px #05070866); user-select: none; }
.desk-agent:not(.online) .desk-sprite { filter: grayscale(.55) brightness(.72) drop-shadow(5px 7px 2px #05070866); }
.desk-agent .nameplate { position: absolute; z-index: 6; right: 8%; bottom: 0; left: 8%; height: 27px; display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; border: 1px solid #718086; background: #0b1113ee; box-shadow: 0 3px 8px #0008; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.desk-agent .nameplate i { width: 8px; height: 8px; border-radius: 50%; background: #5c676b; }
.desk-agent.online .nameplate i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.desk-agent.active .nameplate i { background: var(--red); box-shadow: 0 0 8px var(--red); }
.desk-agent.selected .nameplate { border-color: var(--green); box-shadow: 0 0 0 1px #173d2a, 0 3px 8px #0008; }
.desk-agent.manager .nameplate { border-color: var(--green); }

.selected-panel { display: flex; flex-direction: column; }
.selected-body { display: flex; flex-direction: column; overflow: hidden; }
.agent-summary { min-height: 99px; display: grid; grid-template-columns: 83px minmax(0, 1fr); align-items: center; gap: 13px; padding: 10px; }
.portrait { width: 82px; height: 77px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(circle, #46535a, #141b1e 65%); box-shadow: inset 0 0 0 5px #111719; font-size: 30px; }
.portrait img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.agent-summary-copy { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.agent-summary-copy > strong { font-size: 14px; }
.agent-summary-copy > span { display: flex; align-items: center; gap: 9px; color: #c1cbd0; font-size: 10px; }
.agent-summary-copy > span i { width: 9px; height: 9px; background: var(--green); }
.agent-summary-copy > span i.empty { background: #5c676b; box-shadow: none; }
.agent-summary-copy > span b { font-weight: 400; }
.agent-summary-copy small { color: #a8b2b7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { height: 38px; min-height: 38px; flex: 0 0 38px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tabs button { min-width: 0; height: 100%; padding: 0 7px; overflow: hidden; border: 0; border-right: 1px solid var(--line-dim); background: transparent; color: #aab5ba; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.tabs button.active { color: white; background: #151d20; box-shadow: inset 0 -1px #dce4e2; }
.detail-table { margin: 7px 9px 9px; border: 1px solid var(--line-dim); overflow: auto; }
.detail-row { min-height: 25px; display: grid; grid-template-columns: 133px minmax(0, 1fr); border-bottom: 1px solid var(--line-dim); }
.detail-row:last-child { border-bottom: 0; }
.detail-row label, .detail-row span { padding: 5px 8px; overflow-wrap: anywhere; }
.detail-row label { border-right: 1px solid var(--line-dim); color: #a9b4b8; font-size: 9px; }
.detail-row .green { color: var(--green); }

.system-log { flex: 1; min-height: 0; overflow: auto; padding: 7px 10px; color: #b9c3c7; font-size: 10px; }
.log-line { display: grid; grid-template-columns: 75px 80px minmax(0, 1fr); gap: 7px; line-height: 1.5; }
.log-line time { color: #a0abb0; font-variant-numeric: tabular-nums; }
.log-line b { font-weight: 400; color: #d7dfdd; }
.log-line .success { color: var(--green); }.log-line .error { color: var(--red); }.log-line .tool { color: var(--blue); }

.bottom-grid { display: contents; }
.task-panel { grid-column: 1; grid-row: 3; }
.chat-panel { grid-column: 1; grid-row: 2; }
.route-page-panel { grid-column: 1 / -1; grid-row: 2 / 4; }
.operations-panel { grid-column: 1 / -1; grid-row: 2 / 4; }
.settings-panel { grid-column: 1 / -1; grid-row: 2 / 4; }
.knowledge-panel { grid-column: 1 / -1; grid-row: 2 / 4; }
.memory-panel { grid-column: 1 / -1; grid-row: 2 / 4; }
.shared-workspace-panel { grid-column: 1 / -1; grid-row: 2 / 4; }
.office-chat-page { grid-column: 1 / -1; grid-row: 1 / -1; }
.route-page-body { display: grid; place-content: center; gap: 10px; padding: 32px; text-align: center; color: var(--muted); }
.route-page-body strong { color: var(--text); font-size: 18px; letter-spacing: .05em; text-transform: uppercase; }
.route-page-body p { max-width: 620px; }
body[data-page="tasks"] .task-panel { grid-column: 1 / -1; grid-row: 1 / 3; }
body[data-page="dashboard"] .right-column { grid-template-rows: minmax(180px, 1.1fr) minmax(100px, .65fr) minmax(160px, .95fr) minmax(70px, .45fr); }
body:not([data-page="dashboard"]) .office-panel,
body:not([data-page="dashboard"]) .right-column,
body:not([data-page="dashboard"]) .chat-panel,
body:not([data-page="dashboard"]) .task-panel,
body:not([data-page="dashboard"]) .route-page-panel,
body:not([data-page="dashboard"]) .operations-panel,
body:not([data-page="dashboard"]) .settings-panel,
body:not([data-page="dashboard"]) .knowledge-panel,
body:not([data-page="dashboard"]) .memory-panel { grid-row: 1 / -1; }
body:not([data-page="dashboard"]) .shared-workspace-panel { grid-row: 1 / -1; }
.task-panel, .logs-panel { display: flex; flex-direction: column; }
.task-toolbar { flex: 0 0 35px; display: flex; padding: 4px 7px; border-bottom: 1px solid var(--line-dim); box-shadow: none; }
.task-toolbar button { min-width: 94px; padding: 0 12px; border: 0; border-right: 1px solid var(--line-dim); background: transparent; color: var(--muted); font-size: 8px; }
.task-toolbar button.active { color: var(--text); background: var(--panel-hi); box-shadow: inset 0 -1px var(--green); }
body:not([data-page="tasks"]) #add-task-button, body:not([data-page="tasks"]) .task-toolbar { display: none; }
.task-table-wrap { min-height: 0; flex: 1; overflow: auto; }
.task-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.task-table th, .task-table td { height: 27px; padding: 5px 9px; border-right: 1px solid var(--line-dim); border-bottom: 1px solid var(--line-dim); text-align: left; white-space: nowrap; }
.task-table th { color: #adb8bc; font-weight: 400; }
.task-table th:nth-child(2), .task-table td:nth-child(2) { width: 34%; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.task-table .status-running { color: var(--green); }.task-table .status-pending { color: #bcc6ca; }.task-table .status-completed { color: var(--green); }.task-table .status-failed, .task-table .status-cancelled { color: var(--red); }
.task-actions { display: flex; align-items: center; gap: 5px; }
.task-action-button { width: 25px; height: 23px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-dim); background: transparent; color: var(--muted); }
.task-action-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: square; stroke-linejoin: miter; stroke-width: 1.25; }
.task-action-button.stop-task { border-color: var(--orange); color: var(--orange); }
.task-action-button.delete-task { border-color: var(--red); color: var(--red); }
.task-action-button.stop-task:hover { background: #322116; }
.task-action-button.delete-task:hover { background: #35171a; }
.task-action-button:disabled { cursor: not-allowed; border-color: var(--line-dim); background: transparent; color: #536066; opacity: .45; }
.priority-high { color: var(--orange); }.priority-medium { color: var(--amber); }.priority-low { color: #b9c3c7; }
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress { width: 67px; height: 8px; display: block; border: 1px solid #465257; background: repeating-linear-gradient(90deg, #263135 0 7px, #0b1012 7px 9px); }
.progress i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--green) 0 7px, #2b9a5c 7px 9px); }
.empty-row td { color: #7f8b90; text-align: center; }
.delivered-work { min-width: 150px; }
.delivered-work a { display: block; max-width: 210px; overflow: hidden; color: var(--green); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.delivered-work a:hover { text-decoration: underline; }

.chat-panel { display: flex; flex-direction: column; }
.chat-messages { min-height: 0; overflow: auto; padding: 18px; }
.chat-empty { height: 100%; display: grid; place-content: center; gap: 7px; color: var(--muted); text-align: center; }
.chat-empty strong { color: var(--text); font-size: 13px; letter-spacing: .06em; }
.chat-message { max-width: min(78%, 720px); display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.chat-message.user { margin-left: auto; align-items: flex-end; }
.chat-message.agent { margin-right: auto; align-items: flex-start; }
.chat-message label { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.chat-message-content { min-width: 180px; padding: 11px 13px; border: 1px solid var(--line-dim); background: #101719; color: #dce5e2; line-height: 1.55; overflow-wrap: anywhere; }
.chat-message.user .chat-message-content { border-color: #37604b; background: #10231a; }
.chat-message.agent .chat-message-content { border-left: 2px solid var(--green); }
.chat-message.error .chat-message-content { border-color: var(--red); border-left-color: var(--red); color: #ffb2b5; }
.chat-composer { flex: 0 0 auto; min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) 92px; align-items: end; gap: 10px; padding: 10px; border-top: 1px solid var(--line); box-shadow: none; }
.chat-composer textarea { width: 100%; height: 36px; max-height: 160px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 0; outline: 0; overflow-y: hidden; resize: none; background: #05090a; line-height: 1.45; }
.chat-composer textarea:focus { border-color: var(--green); }
.chat-send-button { height: 36px; padding: 0 15px; border: 1px solid var(--green); background: #10231a; color: var(--green); }
.chat-send-button:hover:not(:disabled) { background: #183425; }
.chat-send-button:disabled { cursor: default; opacity: .35; }

.office-chat-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); overflow: hidden; }
.office-chat-sidebar { min-height: 0; padding: 13px 10px; border-right: 1px solid var(--line); background: #0b1214; }
.office-chat-channel { height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid #355245; background: #13231b; color: var(--text); }
.office-chat-channel span { color: var(--green); font-size: 16px; }
.office-chat-sidebar h3 { margin: 24px 10px 9px; color: var(--muted); font-size: 9px; font-weight: 400; letter-spacing: .1em; }
.office-chat-members { display: flex; flex-direction: column; gap: 2px; }
.office-chat-member { width: 100%; min-height: 39px; display: grid; grid-template-columns: 9px minmax(0, 1fr); align-items: center; column-gap: 9px; padding: 6px 10px; border: 0; background: transparent; color: var(--text); text-align: left; }
.office-chat-member:hover { background: #ffffff0a; }
.office-chat-member i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px #43ec8d77; }
.office-chat-member[data-status="busy"] i { background: var(--red); box-shadow: 0 0 6px #ff5d6377; }
.office-chat-member span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.office-chat-member strong { overflow: hidden; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.office-chat-member small { color: var(--muted); font-size: 8px; }
.office-chat-member-name { min-width: 0; display: flex !important; flex-direction: row !important; align-items: baseline; gap: 6px !important; }
.office-chat-member-name em { flex: 0 0 auto; color: var(--green); font-size: 8px; font-style: normal; animation: typing-pulse 1.1s steps(2) infinite; }
.office-chat-member-name em.busy { color: var(--red); animation: none; }
@keyframes typing-pulse { 50% { opacity: .45; } }
.office-chat-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: 58px minmax(0, 1fr) auto; }
.office-chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 18px; border-bottom: 1px solid var(--line-dim); }
.office-chat-heading > div { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.office-chat-heading strong { font-size: 13px; }
.office-chat-heading span { color: var(--muted); font-size: 9px; }
.office-board-messages { min-height: 0; overflow: auto; padding: 10px 0 18px; }
.dashboard-office-board-messages { padding-block: 4px 10px; box-shadow: inset 0 0 0 1px #11191c; }
.dashboard-office-board-messages .office-board-message { grid-template-columns: 30px minmax(0, 1fr); gap: 9px; padding: 8px 10px; }
.dashboard-office-board-messages .office-board-avatar { width: 30px; height: 30px; }
.dashboard-office-board-messages .human-avatar-icon { width: 19px; height: 19px; }
.dashboard-office-chat-composer { min-height: 50px; flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px; padding: 7px; border-top: 1px solid var(--line); box-shadow: none; }
.dashboard-office-chat-composer textarea { width: 100%; height: 34px; min-height: 34px; max-height: 96px; resize: none; overflow-y: hidden; border: 1px solid var(--line); outline: 0; padding: 8px 9px; background: #05090a; line-height: 1.45; }
.dashboard-office-chat-composer textarea:focus { border-color: var(--green); }
.dashboard-office-chat-composer .chat-send-button { height: 34px; }
.office-board-empty { height: 100%; display: grid; place-content: center; gap: 8px; color: var(--muted); text-align: center; }
.office-board-empty strong { color: var(--text); font-size: 13px; }
.office-board-message { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; padding: 10px 18px; }
.office-board-message:hover { background: #ffffff05; }
.office-board-avatar { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); background: #142024; color: var(--green); font-size: 13px; font-weight: 700; }
.agent-avatar-sprite { width: calc(100% - 4px); height: calc(100% - 4px); min-width: 0; min-height: 0; display: block; object-fit: contain; object-position: center; image-rendering: pixelated; }
.office-board-message.user .office-board-avatar { border-color: #65757b; background: #172126; color: #dfe8e5; }
.human-avatar-icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: square; stroke-linejoin: miter; stroke-width: 1.7; }
.office-board-message.manager .office-board-avatar { border-color: #3d7057; background: #10231a; }
.office-board-message-body { min-width: 0; }
.office-board-message-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.office-board-message-meta strong { font-size: 11px; }
.office-board-message-meta span { color: var(--muted); font-size: 8px; }
.office-board-message-text { color: #d6dfdc; line-height: 1.55; overflow-wrap: anywhere; }
.office-board-message-text mark { background: transparent; color: var(--green); font-weight: 700; }
.office-board-artifacts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.office-board-artifacts .chat-file-attachment { padding: 5px 8px; border: 1px solid #355245; color: var(--green); text-decoration: none; }
.office-board-artifacts .chat-file-attachment:hover { background: #13231b; }
.chat-image-attachment { width: min(100%, 480px); margin: 0; border: 1px solid #355245; background: #080d0f; }
.chat-image-attachment a { display: block; padding: 0; border: 0; }
.chat-image-attachment img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.chat-image-attachment figcaption { padding: 6px 8px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.chat-artifact-invalid { padding: 5px 8px; border: 1px solid var(--line-dim); color: var(--muted); }

.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 8px; white-space: normal; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 14px 0 7px; color: #eff7f4; line-height: 1.3; }
.markdown-body h1 { font-size: 16px; }.markdown-body h2 { font-size: 14px; }.markdown-body h3 { font-size: 12px; }.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 11px; }
.markdown-body ul, .markdown-body ol { margin: 6px 0 9px; padding-left: 22px; }
.markdown-body li { margin: 3px 0; }
.markdown-body blockquote { margin: 8px 0; padding: 5px 10px; border-left: 2px solid var(--green); background: #07100c; color: #aebbb7; }
.markdown-body pre { max-width: 100%; margin: 8px 0; padding: 10px 11px; overflow: auto; border: 1px solid var(--line-dim); background: #05090a; color: #c7f9d9; white-space: pre; }
.markdown-body code { padding: 1px 4px; background: #05090a; color: #86e9aa; font: 9px/1.5 "SFMono-Regular", Consolas, monospace; }
.markdown-body pre code { padding: 0; background: transparent; color: inherit; }
.markdown-body a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.markdown-body mark { background: transparent; color: var(--green); font-weight: 700; }
.markdown-body hr { height: 1px; margin: 10px 0; border: 0; background: var(--line-dim); }
.markdown-table-wrap { max-width: 100%; margin: 8px 0; overflow-x: auto; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: inherit; }
.markdown-body th, .markdown-body td { padding: 6px 8px; border: 1px solid var(--line-dim); text-align: left; vertical-align: top; }
.markdown-body th { background: #09110e; color: #dce8e3; font-weight: 700; }
.markdown-body tr:nth-child(even) td { background: rgb(255 255 255 / 2%); }
.markdown-body .markdown-align-center { text-align: center; }
.markdown-body .markdown-align-right { text-align: right; }
.markdown-image-link { display: block; margin: 8px 0; }
.markdown-image { display: block; max-width: min(100%, 680px); max-height: 520px; border: 1px solid #355245; object-fit: contain; }
.office-board-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; margin: 0 18px 18px; border: 1px solid var(--line); background: #080d0f; padding: 8px; }
.office-board-composer:focus-within { border-color: #4c6b5b; box-shadow: 0 0 0 1px #1c3c2b; }
.office-board-composer textarea { max-height: 130px; min-height: 31px; resize: none; overflow-y: auto; border: 0; outline: 0; padding: 8px 6px; background: transparent; line-height: 1.45; }

.operations-summary { flex: 0 0 48px; display: flex; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line-dim); box-shadow: none; color: var(--muted); font-size: 9px; }
.operations-summary strong { color: var(--green); font-size: 11px; }
.operations-table-wrap { overflow: auto; }
.operations-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.operations-table th, .operations-table td { height: 42px; padding: 7px 10px; border-right: 1px solid var(--line-dim); border-bottom: 1px solid var(--line-dim); text-align: left; vertical-align: middle; }
.operations-table th { height: 32px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.operations-table td:first-child { width: 24%; }
.operation-name { display: flex; flex-direction: column; gap: 3px; }
.operation-name strong { font-weight: 500; color: var(--text); }
.operation-name small { max-width: 330px; overflow: hidden; color: #849095; text-overflow: ellipsis; white-space: nowrap; }
.operation-state { color: var(--green); }
.operation-state.disabled { color: #7f8b90; }
.operation-state.failed { color: var(--red); }
.operation-actions { display: flex; gap: 5px; }
.operation-actions button { padding: 3px 7px; border: 1px solid var(--line-dim); background: transparent; font-size: 8px; }
.operation-actions .delete-operation { color: var(--red); }

.settings-tabs { flex: 0 0 39px; display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); box-shadow: none; scrollbar-width: thin; }
.settings-tabs button { min-width: 135px; height: 38px; padding: 0 18px; border: 0; border-right: 1px solid var(--line-dim); background: #080e10; color: var(--muted); font-size: 9px; }
.settings-tabs button:hover { background: #11191c; color: var(--text); }
.settings-tabs button.active { color: var(--green); background: #11191c; box-shadow: inset 0 -2px var(--green); }
.settings-view { flex: 1 1 auto; min-height: 0; }
.settings-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); overflow: hidden; }
.prompt-list { min-width: 0; overflow: auto; border-right: 1px solid var(--line); background: #080d0f; }
.prompt-list button { width: 100%; min-height: 58px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line-dim); background: transparent; color: var(--muted); text-align: left; }
.prompt-list button strong { color: var(--text); font-size: 10px; font-weight: 500; }
.prompt-list button small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.prompt-list button:hover { background: #11191c; }
.prompt-list button.active { background: #172126; box-shadow: inset 3px 0 var(--green); }
.prompt-editor { min-width: 0; min-height: 0; display: grid; grid-template-rows: 64px minmax(0, 1fr) 54px; padding: 12px 16px 14px; }
.prompt-editor-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-dim); }
.prompt-editor-heading span { color: var(--muted); font-size: 8px; }
.prompt-editor-heading strong { font-size: 13px; font-weight: 500; }
.prompt-editor-heading code { color: var(--green); font-size: 9px; }
#system-prompt-content { width: 100%; min-height: 0; padding: 16px; border: 1px solid var(--line); border-top: 0; border-radius: 0; outline: 0; resize: none; background: #05090a; color: #dce5e2; font: 11px/1.6 "SFMono-Regular", Consolas, monospace; }
#system-prompt-content:focus { border-color: var(--green); }
#system-prompt-content:disabled { color: #657176; }
.prompt-editor-actions { display: flex; align-items: end; justify-content: flex-end; gap: 8px; }
.prompt-editor-actions button { height: 32px; padding: 0 13px; border: 1px solid var(--line-dim); background: transparent; }
.prompt-editor-actions .primary { border-color: var(--green); color: var(--green); }
.prompt-editor-actions button:disabled { cursor: default; opacity: .35; }
.settings-section-intro { flex: 0 0 58px; display: flex; align-items: center; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line-dim); color: var(--muted); font-size: 9px; }
.settings-section-intro strong { color: var(--text); font-size: 11px; }
.tools-settings, .editor-settings, .provider-settings { overflow: hidden; }
.tools-settings, .editor-settings { display: flex; flex-direction: column; }
.tool-permissions { min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.tool-permission { min-height: 68px; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 18px; border-right: 1px solid var(--line-dim); border-bottom: 1px solid var(--line-dim); cursor: pointer; }
.tool-permission:hover { background: #11191c; }
.tool-permission input { width: 15px; height: 15px; accent-color: var(--green); }
.tool-permission span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tool-permission strong { color: var(--text); font-size: 10px; font-weight: 500; }
.tool-permission small { color: var(--muted); font-size: 8px; }
.editor-settings textarea { flex: 1 1 auto; min-height: 0; margin: 14px 16px 0; padding: 16px; border: 1px solid var(--line); outline: 0; resize: none; background: #05090a; color: #dce5e2; font: 11px/1.6 "SFMono-Regular", Consolas, monospace; }
.editor-settings textarea:focus { border-color: var(--green); }
.settings-actions { flex: 0 0 55px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 16px; }
.settings-actions button { height: 32px; padding: 0 13px; border: 1px solid var(--line-dim); background: transparent; }
.settings-actions .primary { border-color: var(--green); color: var(--green); }
.settings-actions button:disabled { cursor: default; opacity: .35; }
.provider-settings { display: flex; flex-direction: column; }
.settings-fields { width: min(760px, calc(100% - 32px)); display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 13px 18px; align-items: center; margin: 22px 16px; }
.settings-fields label { color: var(--muted); font-size: 9px; }
.settings-fields input, .settings-fields select { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 0; outline: 0; background: #070c0e; }
.settings-fields input:focus, .settings-fields select:focus { border-color: var(--green); }
.provider-settings .settings-actions { margin-top: auto; border-top: 1px solid var(--line-dim); }
.provider-model-status { margin-right: auto; color: var(--muted); font-size: 8px; }
.admin-settings { display: flex; flex-direction: column; overflow: auto; }
.danger-zone { width: min(820px, calc(100% - 32px)); display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 24px 16px; padding: 20px; border: 1px solid var(--red); background: #160d0f; }
.danger-zone-copy { min-width: 0; display: flex; align-items: flex-start; gap: 14px; }
.danger-zone-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border: 1px solid var(--red); color: var(--red); font-size: 16px; }
.danger-zone-copy div { display: flex; flex-direction: column; gap: 7px; }
.danger-zone-copy strong { color: #ff9ea5; font-size: 11px; }
.danger-zone-copy p { max-width: 610px; color: #bba8aa; font-size: 9px; line-height: 1.55; }
.danger-button { min-width: 128px; height: 34px; padding: 0 14px; border: 1px solid var(--red); background: transparent; color: #ff9ea5; }
.danger-button:hover { background: #321418; }
.danger-button:disabled { cursor: default; opacity: .5; }

.skills-summary { flex: 0 0 48px; display: flex; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line-dim); box-shadow: none; color: var(--muted); font-size: 9px; }
.skills-summary strong { color: var(--green); font-size: 11px; }
.skills-table-wrap { overflow: auto; }
.skills-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.skills-table th, .skills-table td { height: 43px; padding: 7px 11px; border-right: 1px solid var(--line-dim); border-bottom: 1px solid var(--line-dim); text-align: left; }
.skills-table th { height: 32px; color: var(--muted); font-weight: 400; }
.skills-table th:first-child, .skills-table td:first-child { width: 85px; text-align: center; }
.skill-toggle { width: 15px; height: 15px; accent-color: var(--green); }
.skill-name { color: var(--text); font-size: 10px; }
.skill-file { color: var(--green); }
.skill-delete { padding: 4px 8px; border: 1px solid var(--line-dim); background: transparent; color: var(--red); font-size: 8px; }
.skill-delete:hover { background: #251316; }

.memory-summary { flex: 0 0 48px; display: flex; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line-dim); box-shadow: none; color: var(--muted); font-size: 9px; }
.memory-summary strong { color: var(--green); font-size: 11px; }
.memory-table-wrap { overflow: auto; }
.memory-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.memory-table th, .memory-table td { min-height: 45px; padding: 9px 11px; border-right: 1px solid var(--line-dim); border-bottom: 1px solid var(--line-dim); text-align: left; vertical-align: top; }
.memory-table th { height: 32px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.memory-table td:nth-child(1) { width: 145px; white-space: nowrap; }
.memory-table td:nth-child(2), .memory-table td:nth-child(3) { width: 90px; text-transform: uppercase; }
.memory-table td:nth-child(4) { width: 145px; }
.memory-work { min-width: 320px; }
.memory-work strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 10px; }
.memory-work span { display: block; max-width: 660px; overflow: hidden; color: #aab5b9; text-overflow: ellipsis; white-space: nowrap; }
.memory-status-completed { color: var(--green); }.memory-status-failed, .memory-status-timed_out { color: var(--red); }
.memory-artifacts a { display: block; max-width: 230px; overflow: hidden; color: var(--green); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.memory-artifacts a:hover { text-decoration: underline; }
.shared-workspace-panel { display: flex; flex-direction: column; }
.shared-workspace-summary { flex: 0 0 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 14px; border-bottom: 1px solid var(--line-dim); box-shadow: none; }
.shared-workspace-summary > div { display: flex; flex-direction: column; gap: 4px; }
.shared-workspace-summary strong { color: var(--green); font-size: 11px; }
.shared-workspace-summary span, .shared-workspace-summary code { color: var(--muted); font-size: 9px; }
.shared-workspace-summary code { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-workspace-browser { min-height: 0; overflow: auto; padding: 10px; }
.workspace-folder { margin-bottom: 10px; border: 1px solid var(--line-dim); background: #0a1012; }
.workspace-folder > header { height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--line-dim); background: #11191c; }
.workspace-folder > header div { display: flex; align-items: center; gap: 9px; }
.workspace-folder > header span { color: var(--green); }
.workspace-folder > header strong { font-size: 10px; }
.workspace-folder > header small { color: var(--muted); font-size: 8px; }
.workspace-file { min-height: 35px; display: grid; grid-template-columns: 18px minmax(0, 1fr) 90px 150px 54px; align-items: center; gap: 7px; padding: 5px 12px; border-bottom: 1px solid var(--line-dim); color: var(--text); text-decoration: none; }
.workspace-file:last-child { border-bottom: 0; }
.workspace-file:hover { background: #14201b; }
.workspace-file > span, .workspace-file > b { color: var(--green); }
.workspace-file > strong { overflow: hidden; font-size: 9px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.workspace-file > small, .workspace-file > time, .workspace-file > b { color: var(--muted); font-size: 8px; font-weight: 400; }
.workspace-empty, .workspace-empty-folder { display: grid; place-content: center; gap: 8px; min-height: 180px; color: var(--muted); text-align: center; }
.workspace-empty strong { color: var(--text); font-size: 13px; }
.workspace-empty-folder { min-height: 60px; font-size: 8px; }

.registry-body { overflow: auto; }
.registry-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.registry-table th, .registry-table td { height: 31px; padding: 6px 9px; border-right: 1px solid var(--line-dim); border-bottom: 1px solid var(--line-dim); text-align: left; }
.registry-table th { color: var(--muted); font-weight: 400; }
.registry-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.registry-status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.registry-status.connected { color: var(--green); }
.registry-actions { display: flex; gap: 6px; }
.registry-actions button, .dialog-actions button, .dialog-close { border: 1px solid var(--line-dim); background: transparent; }
.registry-actions button { padding: 3px 7px; font-size: 8px; }
.registry-actions .delete-agent { color: var(--red); }
.agent-dialog { width: min(480px, calc(100% - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 0; background: #080e10; color: var(--text); box-shadow: inset 0 0 0 3px var(--bg), 0 18px 60px #000c; }
.agent-dialog::backdrop { background: #020506dd; backdrop-filter: blur(3px); }
.agent-dialog form { padding: 4px; }
.dialog-close { width: 28px; height: 28px; color: var(--muted); font-size: 18px; }
.agent-form-body { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 20px; align-items: center; }
.agent-form-body label { color: var(--muted); font-size: 10px; }
.agent-form-body input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 0; padding: 0 10px; outline: 0; background: #070b0d; }
.agent-form-body input:focus, .agent-form-body textarea:focus, .agent-form-body select:focus { border-color: var(--green); }
.agent-form-body input[readonly] { color: var(--muted); background: #0b1113; }
.agent-form-body p { grid-column: 2; color: #849095; font-size: 9px; }
.task-dialog { width: min(620px, calc(100% - 24px)); }
.task-form-body textarea, .task-form-body select { width: 100%; border: 1px solid var(--line); border-radius: 0; outline: 0; background: #070b0d; }
.task-form-body textarea { min-height: 122px; resize: vertical; padding: 10px; line-height: 1.5; }
.task-form-body select { height: 38px; padding: 0 10px; }
.operation-dialog { width: min(680px, calc(100% - 24px)); }
.operation-form-body textarea, .operation-form-body select { width: 100%; border: 1px solid var(--line); border-radius: 0; outline: 0; background: #070b0d; }
.operation-form-body textarea { min-height: 92px; padding: 10px; resize: vertical; line-height: 1.45; }
.operation-form-body select { height: 38px; padding: 0 10px; }
.interval-fields { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.enabled-field { height: 38px; display: flex; align-items: center; gap: 9px; color: var(--text) !important; }
.enabled-field input { width: 15px; height: 15px; accent-color: var(--green); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-dim); }
.dialog-actions button { height: 32px; padding: 0 13px; }
.dialog-actions .primary { border-color: var(--green); color: var(--green); }
.worker-token-dialog { width: min(680px, calc(100% - 24px)); }
.worker-token-body { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.worker-token-body p { color: var(--muted); line-height: 1.55; }
.worker-token-body label { color: var(--green); font-size: 9px; letter-spacing: .08em; }
.worker-token-body input { width: 100%; height: 38px; border: 1px solid var(--line); outline: 0; padding: 0 11px; background: #05090a; color: var(--text); }
.worker-token-body input:focus { border-color: var(--green); }
.worker-token-secret { display: flex; flex-direction: column; gap: 12px; }
.worker-token-secret[hidden] { display: none; }
.worker-token-body textarea { width: 100%; resize: none; border: 1px solid var(--line); outline: 0; padding: 11px; background: #05090a; color: var(--green); line-height: 1.5; overflow-wrap: anywhere; }
.worker-token-body textarea:focus { border-color: var(--green); }
.toast { position: fixed; z-index: 200; right: 22px; bottom: 22px; max-width: 430px; padding: 10px 14px; border: 1px solid var(--line); background: #11191c; box-shadow: 0 6px 24px #000a; transform: translateY(12px); opacity: 0; pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: var(--red); color: #ffc0c3; }

select {
  appearance: none;
  padding-right: 34px !important;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%) !important;
  background-position: calc(100% - 15px) 50%, calc(100% - 11px) 50% !important;
  background-repeat: no-repeat !important;
  background-size: 4px 4px !important;
}

@media (max-width: 1100px) {
  html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  .app-frame { height: auto; min-height: 100dvh; display: block; padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .workspace { display: block; }
  .sidebar { position: fixed; z-index: 90; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; height: 64px; min-height: 64px; display: block; overflow: hidden; background: #080d0ff2; box-shadow: inset 0 0 0 3px #070b0d, inset 0 0 0 4px var(--line-dim), 0 -8px 25px #000a; backdrop-filter: blur(8px); }
  .sidebar-brand { display: none; }
  .nav-items { height: 100%; display: flex; padding: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav-items::-webkit-scrollbar { display: none; }
  .nav-item { position: relative; width: auto; height: 54px; min-width: 72px; flex: 1 0 72px; flex-direction: column; justify-content: center; gap: 1px; padding: 0 5px; border: 0; border-right: 1px solid var(--line-dim); font-size: 7px; text-align: center; }
  .nav-item:first-child { border-top: 0; }
  .nav-item:last-child { border-right: 0; }
  .nav-icon { width: 28px; height: 28px; display: grid; place-items: center; font-size: 18px; line-height: 1; }
  .nav-item.active { background: #1e292d; box-shadow: inset 0 -3px var(--green); }
  .nav-item.active .nav-icon { color: var(--green); text-shadow: 0 0 9px #43ec8d66; }
  .main-content { display: flex; flex-direction: column; gap: 10px; }
  .panel-width-resizer { display: none !important; }
  .operations-grid, .bottom-grid { display: flex; flex-direction: column; gap: 10px; }
  .office-panel, .right-column, .chat-panel, .task-panel { width: 100%; grid-column: auto; grid-row: auto; }
  .right-column > .panel, .main-content > .panel { width: 100%; }
  .right-column { min-height: 0; display: flex; flex-direction: column; }
  .right-column > .panel:not(.is-minimized) { flex: none; }
  .selected-panel:not(.is-minimized) { min-height: 385px; }
  .logs-panel:not(.is-minimized) { min-height: 190px; }
  .agent-registry-panel:not(.is-minimized) { min-height: 220px; }
  .dashboard-office-chat-panel:not(.is-minimized) { min-height: 420px; }
  .office-panel:not(.is-minimized) { min-height: 500px; }
  .office { min-height: 455px; }
  .agent-floor { inset: 22% 3% 7%; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: space-around; gap: 14px 4px; }
  .desk-agent, .desk-agent:only-child, .desk-agent.manager:first-child, .desk-agent:nth-child(n) { position: relative; inset: auto; }
  .chat-panel:not(.is-minimized) { min-height: 560px; }
  body[data-page="dashboard"] .bottom-grid { order: -1; }
  body[data-page="tasks"] .task-panel:not(.is-minimized), .operations-panel:not(.is-minimized), .settings-panel:not(.is-minimized), .knowledge-panel:not(.is-minimized), .memory-panel:not(.is-minimized), .shared-workspace-panel:not(.is-minimized), .office-chat-page:not(.is-minimized) { min-height: calc(100dvh - 96px); }
  .settings-body { grid-template-columns: 220px minmax(0, 1fr); min-height: 600px; }
  .office-chat-layout { grid-template-columns: 190px minmax(0, 1fr); min-height: 650px; }
  body[data-page="chat"] { overflow: hidden; }
  body[data-page="chat"] .app-frame { height: 100dvh; min-height: 0; }
  body[data-page="chat"] .workspace { height: calc(100dvh - 96px); min-height: 0; }
  body[data-page="chat"] .main-content, body[data-page="chat"] .office-chat-page { height: 100%; min-height: 0 !important; }
  body[data-page="chat"] .office-chat-layout { height: calc(100% - 43px); min-height: 0; }
  body[data-page="chat"] .office-chat-main { min-height: 0; flex: 1 1 auto; }
  body[data-page="chat"] .office-board-messages { padding-bottom: calc(var(--office-board-composer-height, 66px) + 14px); overscroll-behavior: contain; }
  body[data-page="chat"] .office-board-composer { position: fixed; z-index: 89; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; margin: 0; box-shadow: 0 -8px 24px #000b; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 850px) {
  .panel-header { padding-inline: 11px; }
  .panel-header-actions { gap: 7px; }
}
@media (max-width: 600px) {
  .app-frame { padding: 8px 8px calc(78px + env(safe-area-inset-bottom)); }
  .sidebar { right: 6px; bottom: max(6px, env(safe-area-inset-bottom)); left: 6px; height: 62px; min-height: 62px; }
  .nav-item { min-width: 64px; flex-basis: 64px; }
  .panel-header h2 { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
  .panel-meta, .streaming { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agent-registry-panel .panel-meta { display: none; }
  .office-panel:not(.is-minimized) { min-height: 650px; }
  .office { min-height: 605px; }
  .agent-floor { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 2px; }
  .desk-agent { width: min(100%, 190px); }
  .desk-agent:only-child { grid-column: 1 / -1; justify-self: center; }
  .agent-summary { grid-template-columns: 65px 1fr; }.portrait { width: 64px; height: 66px; }
  .agent-form-body { grid-template-columns: 1fr; }.agent-form-body p { grid-column: 1; }
  .settings-body { display: flex; flex-direction: column; }.prompt-list { max-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }.prompt-editor { min-height: 520px; }
  .danger-zone { align-items: stretch; flex-direction: column; }.danger-button { width: 100%; }
  .office-chat-layout { display: flex; flex-direction: column; min-height: 720px; }.office-chat-sidebar { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }.office-chat-sidebar h3, .office-chat-members { display: none; }
  body[data-page="chat"] .workspace { height: calc(100dvh - 88px); }
  body[data-page="chat"] .office-chat-layout { height: calc(100% - 43px); min-height: 0; }
  body[data-page="chat"] .office-board-composer { right: 8px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 8px; }
}
@media (max-width: 380px) {
  .office-panel:not(.is-minimized) { min-height: 970px; }
  .office { min-height: 925px; }
  .agent-floor { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
