:root {
  color-scheme: dark;
  font: 15px/1.5 'Segoe UI Variable', 'Segoe UI', sans-serif;
  color: #e9eee9;
  background: #101514;
  --canvas: #101514;
  --rail: #151c1a;
  --panel: #18211e;
  --card: #1c2723;
  --edge: #34443d;
  --muted: #a6b6ad;
  --accent: #b7e5c4;
  --accent-dark: #19362a;
  --error: #ffb6a9;
  --radius: 12px;
  --scope: #b7e5c4;
  --scope-bg: #223b2e;
  --scope-edge: #466e57;
  --scope-text: #12281c;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--edge); border-radius: 9px; background: var(--card); padding: 8px 12px; white-space: nowrap; }
button:hover { background: #293a32; }
button:disabled { opacity: .6; cursor: wait; }
button.primary { background: var(--accent); color: #12281c; border-color: transparent; font-weight: 650; }
button.primary:hover { background: #d3efdc; }
input, textarea, select { background: #101715; border: 1px solid var(--edge); border-radius: 9px; padding: 9px 10px; min-width: 0; }
input:not([type=checkbox],[type=range],[type=file]), textarea, select { width: 100%; }
input[type=range], input[type=checkbox] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); text-underline-offset: .2em; }
.error { color: var(--error); font-size: .86rem; }
.error:empty, .panel-message:empty { display: none; }
.login { width: min(420px, calc(100% - 32px)); margin: min(17vh, 132px) auto; }
.login-brand, .brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--accent); border: 1px solid #476858; background: #20362b; font-size: 1.28rem; font-weight: 760; }
.login-brand { margin: 0 0 18px; }
.login h1 { font-size: 1.95rem; }
.login-form { display: grid; gap: 14px; padding: 24px; border: 1px solid var(--edge); border-radius: 16px; background: var(--rail); }
.login-form h2 { font-size: 1.12rem; margin-bottom: 4px; }
.login-form label { display: grid; gap: 5px; }
.shell { height: 100dvh; min-height: 480px; display: grid; grid-template-columns: 248px minmax(0, 1fr); overflow: hidden; }
.shell.panel-open { grid-template-columns: 248px minmax(0, 1fr) 330px; }
.shell[data-workspace=private] { --scope: #c3d6ff; --scope-bg: #222f46; --scope-edge: #495e86; --scope-text: #162640; }
.shell[data-workspace=shared] { --scope: #b7e5c4; --scope-bg: #223b2e; --scope-edge: #466e57; --scope-text: #12281c; }
.shell .primary { color: var(--scope-text); background: var(--scope); }
.shell a { color: var(--scope); }
.shell :focus-visible { outline-color: var(--scope); }
.shell input[type=range], .shell input[type=checkbox], .shell input[type=radio] { accent-color: var(--scope); }
.sidebar, .panel { background: var(--rail); min-width: 0; }
.sidebar { display: flex; flex-direction: column; padding: 18px 14px 14px; gap: 11px; border-right: 1px solid var(--edge); }
.brand { margin: 0 3px 8px; }
.brand h1 { font-size: 1.25rem; line-height: 1.18; letter-spacing: -.02em; }
.brand p, .account small { color: var(--muted); font-size: .79rem; }
.workspace-switch, .history-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.workspace-switch button { background: transparent; padding: 6px 6px; font-size: .85rem; display: flex; align-items: center; justify-content: center; gap: 5px; }
.workspace-switch i { width: 6px; height: 6px; flex: none; background: #8fafef; border-radius: 50%; }
.workspace-switch [data-workspace=shared] i { background: #78cc9e; }
.workspace-switch button[aria-pressed=true] { border-color: var(--scope-edge); background: var(--scope-bg); color: var(--scope); }
.new-chat { width: 100%; text-align: left; font-weight: 620; background: var(--scope-bg); border-color: var(--scope-edge); color: var(--scope); }
.new-chat span { margin-right: 5px; }
.history-switch { margin-top: 3px; }
.history-switch button { background: transparent; padding: 5px 7px; color: var(--muted); font-size: .84rem; }
.history-switch button[aria-pressed=true] { border-color: var(--scope-edge); background: var(--scope-bg); color: var(--scope); }
.history-filter { font-size: .87rem; }
.history-nav { display: grid; align-content: start; gap: 3px; overflow: auto; flex: 1; min-height: 0; }
.history-nav button { display: flex; gap: 9px; align-items: center; max-width: 100%; text-align: left; background: transparent; border-color: transparent; padding: 7px 8px; }
.history-nav button span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-nav button:hover, .history-nav button[aria-current=true] { background: var(--card); }
.history-nav button[aria-current=true] { color: var(--scope); border-color: var(--scope-edge); background: var(--scope-bg); }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px; min-width: 0; }
.history-item .chat-menu { align-self: center; padding: 3px 6px; color: var(--muted); }
.chat-kind { color: #92ae9e; font-size: .84rem; width: 15px; flex: none; }
.invite { padding-top: 7px; }
.invite button { width: 100%; }
.invite label { display: block; color: var(--muted); font-size: .77rem; margin-top: 8px; }
.account { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--edge); }
.avatar { width: 31px; height: 31px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--accent-dark); color: var(--accent); font-weight: 650; }
.account div { min-width: 0; flex: 1; }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; }
.account button { padding: 4px 7px; font-size: .78rem; }
.conversation { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--edge); min-height: 67px; }
.shell:not(.monitor-open) .top { box-shadow: inset 0 2px var(--scope-edge); }
.header-title { min-width: 0; }
.title-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.chat-action { flex: none; color: var(--muted); background: transparent; padding: 1px 5px; border-color: transparent; font-size: .94rem; }
#manageChat { border-color: var(--edge); padding: 3px 6px; font-size: .75rem; }
.chat-action:hover { color: var(--scope); border-color: var(--edge); }
.header-title h2 { font-size: 1.12rem; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-weight: 680; }
.header-title p { color: var(--muted); font-size: .78rem; }
.header-title .scope-pill { display: inline-block; margin-top: 2px; padding: 0 7px; color: var(--scope); background: var(--scope-bg); border-radius: 1em; }
.top-actions { display: flex; gap: 5px; }
.top-actions button { background: transparent; border-color: transparent; color: var(--muted); padding: 7px 8px; font-size: .86rem; }
.top-actions button:hover, .top-actions button[aria-pressed=true] { color: var(--scope); border-color: var(--edge); background: var(--card); }
.mobile-nav { display: none; }
.messages { overflow: auto; }
.message-list { width: min(100%, 900px); margin-inline: auto; padding: 24px clamp(15px, 4vw, 52px); display: grid; gap: 21px; }
.empty { max-width: 400px; margin: min(17vh, 124px) auto 0; text-align: center; color: var(--muted); }
.empty h3 { margin: 0 0 7px; font-size: 1.35rem; color: #dce7df; }
.empty button { margin-top: 13px; }
.archive-notice { margin: 0 auto; padding: 8px; max-width: 720px; text-align: center; color: var(--muted); }
.turn { display: grid; gap: 11px; min-width: 0; }
.prompt { justify-self: end; max-width: 85%; border-radius: 13px 13px 4px 13px; padding: 10px 13px; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--scope-bg); border: 1px solid var(--scope-edge); }
.turn-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.turn-actions button { padding: 3px 5px; color: var(--scope); font-size: .74rem; background: transparent; }
.actor { display: block; color: var(--muted); font-size: .76rem; margin-bottom: 4px; line-height: 1.3; }
.answer { min-width: 0; }
.answer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--accent); font-weight: 650; }
.answer-head::before { content: ''; width: 8px; height: 8px; background: #83c8a4; border-radius: 3px; }
.status, .stats, .sources { color: var(--muted); font-size: .84rem; }
.stats { margin-top: 8px; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.copy { padding: 3px 7px; border-color: transparent; color: var(--muted); background: transparent; font-size: .8rem; }
.reasoning { margin: 7px 0; border-left: 2px solid var(--scope-edge); padding: 4px 11px; color: var(--muted); }
.reasoning summary { cursor: pointer; font-size: .84rem; }
.reasoning-text { margin-top: 7px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .88rem; }
.md { overflow-wrap: anywhere; font-size: .98rem; }
.md p, .md ul, .md ol, .md table, .md blockquote, .md pre { margin: 0 0 .72rem; }
.md h1, .md h2, .md h3 { font-size: 1.15rem; margin: 1.15rem 0 .5rem; }
.md > :last-child { margin-bottom: 0; }
.md table { display: block; width: max-content; max-width: 100%; overflow: auto; border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--edge); padding: .35rem .65rem; }
.md th { background: var(--card); text-align: left; }
.md blockquote { border-left: 3px solid #527660; color: #c4d2c8; padding-left: 12px; }
.md pre { background: #0c1110; border: 1px solid var(--edge); border-radius: 9px; padding: 10px 12px; overflow: auto; }
.md code { background: #222f29; border-radius: 4px; padding: 1px 3px; font-size: .91em; }
.md pre code { background: transparent; padding: 0; }
.sources { margin: 7px 0 0; padding: 8px 10px 8px 26px; border: 1px solid var(--edge); border-radius: 8px; width: fit-content; max-width: 100%; }
.compose { width: min(100%, 900px); justify-self: center; padding: 8px clamp(15px, 4vw, 52px) 12px; }
.compose form { background: var(--panel); border: 1px solid var(--scope-edge); border-radius: 14px; padding: 9px; }
.edit-notice { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--scope); font-size: .8rem; }
.edit-notice button { padding: 4px 7px; }
.compose textarea { display: block; background: transparent; border: 0; resize: vertical; outline-offset: -2px; min-height: 50px; max-height: 34dvh; padding: 7px; }
.compose-actions, .compose-footer { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.compose-actions > span, .compose-footer { color: var(--muted); font-size: .75rem; padding-left: 7px; }
.compose-footer { margin-top: 6px; min-height: 18px; }
.model-status { white-space: nowrap; }
.model-status i { display: inline-block; vertical-align: middle; margin-right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #78887e; }
.model-status[data-ready=true] i { background: #8cdbad; }
.panel { overflow: auto; border-left: 1px solid var(--edge); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--edge); padding: 14px; min-height: 67px; }
.panel-head h2 { font-size: 1.05rem; }
.icon-button { background: transparent; padding: 1px 8px; font-size: 1.2rem; line-height: 1.45; }
.panel-content { padding: 14px; }
.panel-message { color: var(--muted); padding: 0 14px 14px; font-size: .85rem; }
.panel-message[data-error=true] { color: var(--error); }
.folder-header { display: flex; align-items: center; gap: 9px; padding: 10px; background: var(--scope-bg); border: 1px solid var(--scope-edge); border-radius: 10px; }
.folder-icon { color: var(--scope); font-size: 1.2rem; }
.folder-header p { color: var(--muted); font-size: .79rem; }
.breadcrumbs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin: 13px 0 8px; color: var(--muted); }
.breadcrumbs button { color: var(--accent); padding: 3px 6px; background: transparent; font-size: .78rem; white-space: normal; }
.field-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: .78rem; }
.file-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-actions button { padding: 6px 9px; font-size: .87rem; }
.drop-zone { border: 1px dashed var(--scope-edge); border-radius: 8px; margin-top: 9px; text-align: center; padding: 6px; color: var(--muted); font-size: .79rem; }
.drop-zone.over { background: var(--scope-bg); color: var(--scope); }
.file-selection { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 6px; margin-top: 13px; color: var(--muted); font-size: .8rem; }
.file-selection label { display: flex; align-items: center; gap: 5px; }
.file-selection button { padding: 4px 7px; }
#selectedCount { grid-column: 1 / -1; min-height: 1.15em; }
.danger-button { color: var(--error); border-color: #81584f; background: #352623; padding: 4px 8px; }
.danger-button:hover { background: #4a2d28; }
.file-list { list-style: none; margin: 11px 0 0; padding: 0; }
.file-list > li { display: flex; align-items: center; gap: 5px; }
.file-list > li + li { border-top: 1px solid var(--edge); }
.file-list button { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; text-align: left; padding: 8px 3px; border: 0; border-radius: 0; background: transparent; text-decoration: none; }
.file-list .file-download { text-decoration: none; padding: 4px 6px; border-radius: 5px; line-height: 1.2; }
.file-list a:hover, .file-list button:hover { color: var(--accent); background: var(--card); }
.file-list .name { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.file-list .type, .file-list .size { flex: none; color: var(--muted); font-size: .72rem; }
.file-list .type { width: 36px; }
.settings-form { display: grid; gap: 13px; }
.mcp-panel { display: grid; gap: 12px; font-size: .88rem; }
.mcp-panel section, .mcp-panel details { padding: 10px; border: 1px solid var(--edge); border-radius: 9px; }
.mcp-panel h3 { margin: 0 0 7px; font-size: .94rem; }
.mcp-panel :is(ol,ul) { padding-left: 1.2em; margin: 6px 0 8px; }
.mcp-panel li + li { margin-top: 5px; }
.mcp-panel :is(pre,code) { overflow-wrap: anywhere; white-space: pre-wrap; }
.mcp-panel pre { margin: 7px 0 0; background: #101715; padding: 7px; border-radius: 6px; }
.copy-field { margin-top: 4px; display: flex; gap: 5px; }
.copy-field button, .mcp-keys button { font-size: .77rem; padding: 4px 6px; }
#mcpSecret { margin-top: 8px; }
.mcp-panel .mcp-keys { list-style: none; padding: 0; }
.mcp-keys li { display: flex; gap: 7px; align-items: center; justify-content: space-between; overflow-wrap: anywhere; }
.settings-form section { display: grid; gap: 10px; padding: 11px; border: 1px solid var(--edge); border-radius: 11px; background: #141d1a; }
.settings-form h3 { margin: 0; font-size: .96rem; }
.settings-form fieldset { margin: 0; padding: 0; border: 0; }
.settings-form legend { padding: 0 0 4px; }
.reasoning-options { display: flex; flex-wrap: wrap; gap: 3px; }
.reasoning-options label { position: relative; display: block; padding: 4px 5px; border-radius: 6px; font-size: .78rem; border: 1px solid var(--edge); cursor: pointer; }
.reasoning-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.reasoning-options label:has(input:checked) { color: var(--scope); background: var(--scope-bg); border-color: var(--scope-edge); }
.reasoning-options label:has(input:focus-visible) { outline: 2px solid var(--scope); }
.settings-numbers, .settings-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.settings-form label { display: grid; gap: 5px; }
.settings-form label > span { display: flex; justify-content: space-between; }
.settings-form output { color: var(--accent); }
.settings-form .switch-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { min-width: 0; padding: 9px; border: 1px solid var(--edge); background: var(--card); border-radius: 10px; }
.metric strong { display: block; font-size: 1.05rem; overflow-wrap: anywhere; }
.metric span { color: var(--muted); font-size: .77rem; }
.hardware { display: grid; gap: 10px; margin-top: 15px; }
.hardware h3 { margin: 0; font-size: .96rem; }
.hardware label { display: grid; gap: 4px; color: var(--muted); font-size: .83rem; }
.hardware meter { width: 100%; height: 7px; }
dialog { color: inherit; background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; width: min(340px, calc(100% - 24px)); }
dialog::backdrop { background: #080d0bc7; }
dialog h2 { margin-bottom: 10px; font-size: 1.1rem; }
dialog form > div { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; margin-top: 12px; }
#chatActionsName, #deleteChatSummary { overflow-wrap: anywhere; }
.preview-dialog { width: min(940px, calc(100vw - 24px)); max-height: 92dvh; padding: 0; }
.preview-dialog header, .preview-dialog footer { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 11px 15px; border-bottom: 1px solid var(--edge); }
.preview-dialog header h2 { overflow-wrap: anywhere; margin: 0; }
.preview-dialog footer { border-bottom: 0; border-top: 1px solid var(--edge); justify-content: end; }
.preview-content { padding: 14px; max-height: 75dvh; overflow: auto; }
.preview-content img { display: block; max-width: 100%; max-height: 68dvh; margin-inline: auto; }
.preview-content iframe { display: block; width: 100%; height: 68dvh; border: 0; background: #101413; }
.preview-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

.monitor-view, .owner-view { grid-row: 2 / -1; overflow: auto; }
.owner-view { display: grid; grid-template-columns: minmax(195px, 260px) minmax(0, 1fr); overflow: hidden; }
.owner-browser { display: flex; flex-direction: column; min-height: 0; gap: 8px; padding: 18px 13px; border-right: 1px solid var(--edge); }
.owner-browser label { color: var(--muted); font-size: .82rem; }
.owner-browser .history-nav button { display: block; min-width: 0; }
.owner-browser .history-nav button span { display: block; }
.owner-browser .history-nav button small { display: block; font-size: .74rem; color: var(--muted); }
.owner-reader { min-width: 0; min-height: 0; overflow: auto; }
.owner-reader header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 18px 20px; border-bottom: 1px solid var(--edge); }
.owner-reader header h3 { overflow-wrap: anywhere; }
.owner-reader > .status { margin: 15px 20px; }
.owner-reader > .status:empty, .owner-browser > .status:empty { display: none; }
.owner-reader .message-list { padding-top: 15px; }
.owner-archive { border: 1px solid var(--edge); border-radius: 12px; padding: 0 7px; color: var(--muted); font-size: .76rem; }
@media (max-width: 700px) {
  .owner-view { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .owner-browser { border-right: 0; border-bottom: 1px solid var(--edge); padding: 8px 13px; }
  .owner-browser .history-nav { max-height: 21vh; }
}
.monitor-content { width: min(100%, 1540px); margin-inline: auto; padding: 16px clamp(11px, 2.8vw, 37px) 25px; display: grid; gap: 12px; }
.monitor-state, .monitor-card { border: 1px solid var(--edge); background: var(--rail); border-radius: 13px; padding: 13px; min-width: 0; }
.monitor-state { padding: 13px 15px; }
.monitor-state-head, .monitor-state-foot, .state-queue { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.monitor-state-foot { justify-content: space-between; color: var(--muted); font-size: .82rem; margin-top: 8px; }
.monitor-state progress { width: 100%; height: 8px; accent-color: #78d7ae; }
.monitor-state h2, .monitor-card h2 { font-size: 1.03rem; }
.state-queue { margin-left: auto; color: var(--muted); font-size: .8rem; gap: 12px; }
.monitor-pill { display: inline-block; padding: 2px 6px; background: #25322c; color: #bfd0c5; border-radius: 15px; font-size: .74rem; white-space: nowrap; }
.monitor-pill.reading { color: #b5cfff; background: #25334b; }
.monitor-pill.generating, .monitor-pill.running { color: #b9efc8; background: #284534; }
.monitor-pill.queued { color: #f1cf9d; background: #423321; }
.monitor-pill.error, .monitor-pill.unloaded { color: #ffc0b7; background: #412925; }
.monitor-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.monitor-card h3 { font-size: .81rem; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.stat-value { display: block; font-size: clamp(1.05rem, 1.65vw, 1.5rem); line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.model-card .stat-value { font-size: .88rem; line-height: 1.3; }
.stat-sub { color: var(--muted); font-size: .78rem; margin-top: 6px; }
.spark { display: block; width: 100%; height: 26px; margin-top: 7px; }
.monitor-detail { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr); gap: 10px; }
.context-card { align-self: start; }
.context-chart { width: 98px; height: 98px; margin: 12px auto; display: grid; place-items: center; border-radius: 100%;
  background: conic-gradient(#84d9af 0 var(--cached), #a6c4f6 var(--cached) var(--read), #e3c194 var(--read) var(--used), #2b3832 var(--used)); }
.context-caption { display: grid; place-content: center; text-align: center; width: 83px; height: 83px; border-radius: 50%; background: var(--rail); }
.context-caption span, .context-card p { color: var(--muted); font-size: .76rem; }
.context-legend { display: grid; grid-template-columns: 1fr auto; gap: 4px; color: var(--muted); font-size: .83rem; }
.context-legend dt::before { content: ''; width: 6px; height: 6px; display: inline-block; margin: 0 6px 2px 0; background: #38473e; border-radius: 1px; }
.context-legend dt.cached::before { background: #84d9af; }
.context-legend dt.read::before { background: #a6c4f6; }
.context-legend dt.answer::before { background: #e3c194; }
.context-legend dd { text-align: end; margin: 0; }
.context-card meter { width: 100%; height: 8px; }
.request-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.request-title h2 { margin-right: auto; }
.request-title :is(select,button) { width: auto; padding: 4px 6px; font-size: .77rem; }
.request-table-scroll { width: 100%; overflow: auto; }
.request-table { border-collapse: collapse; width: 100%; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .77rem; }
.request-table :is(td,th) { padding: 7px 5px; border-bottom: 1px solid var(--edge); }
.request-table th { color: var(--muted); font-weight: 550; }
.request-table :is(td,th):first-child { text-align: left; }
@media (max-width: 1150px) {
  .shell.panel-open { grid-template-columns: 224px minmax(0, 1fr) 294px; }
  .top { padding-inline: 12px; }
  .monitor-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 940px) {
  .shell, .shell.panel-open { grid-template-columns: 215px minmax(0, 1fr); }
  .panel { position: fixed; inset: 0 0 0 auto; width: min(340px, 100vw); z-index: 4; box-shadow: -12px 0 70px #050907a0; }
  .monitor-detail { grid-template-columns: minmax(0, 1fr); }
  .monitor-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 675px) {
  .shell, .shell.panel-open { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: min(260px, 88vw); z-index: 5; box-shadow: 12px 0 65px #050907a0; }
  .sidebar.shown { display: flex; }
  .top { flex-wrap: wrap; gap: 4px 10px; padding: 7px 10px; }
  .mobile-nav { display: inline-block; flex: none; padding: 5px 8px; }
  .header-title { flex: 1; }
  .top-actions { width: 100%; justify-content: end; flex-wrap: wrap; }
  .top-actions button { padding: 3px 7px; }
  .message-list { padding-top: 14px; gap: 16px; }
  .compose { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .compose textarea { min-height: 44px; }
  .monitor-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt { max-width: 94%; }
}
