:root {
  color-scheme: dark;
  font: 15px/1.5 system-ui, sans-serif;
  --bg: #10191f;
  --panel: #18252d;
  --panel-raised: #203039;
  --line: #34454e;
  --text: #f3f2eb;
  --muted: #b0bec3;
  --accent: #ffbe98;
  --accent-strong: #eb9e75;
  --green: #86dcc4;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 90% 0, #1d3238 0, transparent 47rem), var(--bg); color: var(--text); }
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); letter-spacing: -.05em; line-height: 1.15; }
h2 { font-size: 1.16rem; }
h3 { font-size: 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffdbc4; }
button, .button, input, select, textarea { font: inherit; }
button, .button {
  border: 1px solid var(--line); background: var(--panel-raised); color: var(--text); border-radius: 9px;
  padding: .5rem .85rem; cursor: pointer; display: inline-flex; gap: .45rem; align-items: center; justify-content: center;
}
button:hover, .button:hover { background: #30424c; color: var(--text); }
button:disabled { opacity: .55; cursor: default; }
.primary { color: #331f16; background: linear-gradient(135deg, #ffd1ab, #ffae8b); border-color: #ffcaab; font-weight: 680; }
.primary:hover { color: #331f16; background: #ffdbc4; }
.bare { padding: .25rem .4rem; border: 0; background: transparent; color: var(--muted); }
.danger { color: #ff9aab; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: .73rem; font-weight: 750; letter-spacing: .18em; }
kbd { color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: .7rem; }
.layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column;
  padding: 1.4rem 1rem .85rem; background: #131e25; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); font-weight: 750; padding: 0 .35rem; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
#nav-toggle, #compose-shortcut { display: none; }
.brand small { display: block; color: var(--muted); font-weight: 400; font-size: .72rem; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(145deg, #ffdcaa, #efa282); color: #3c2b26; box-shadow: inset 0 1px 0 #fff6;
}
.brand-mark svg { display: block; width: 27px; height: 27px; }
.nav-group { margin: 1.35rem 0 .3rem .6rem; color: var(--muted); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: .65rem; padding: .47rem .6rem; border-radius: 8px; color: #c0c5d5; }
.nav-link:hover { background: var(--panel-raised); }
.nav-link[aria-current] { color: #ffe2cc; background: #35302d; box-shadow: inset 3px 0 var(--accent); font-weight: 650; }
.nav-link .icon { width: 19px; height: 19px; }
.sidebar-foot { margin-top: auto; padding: 1rem .25rem 0; color: var(--muted); display: flex; align-items: center; gap: .45rem; font-size: .75rem; white-space: nowrap; }
.sidebar-foot button { margin-left: auto; }
.local-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 0 2rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.search { min-width: 190px; justify-content: space-between; color: var(--muted); }
#sync { white-space: nowrap; }
.content { max-width: 1500px; margin: auto; padding: 2rem; }
.hero { position: relative; overflow: hidden; padding: 1.8rem; border: 1px solid #342e4d; border-radius: 16px; background: radial-gradient(ellipse at 92% 20%, #31264b 0, transparent 63%), #191925; margin-bottom: 1.4rem; }
.hero .eyebrow { margin-bottom: .65rem; }
.hero p:not(.eyebrow) { max-width: 55ch; margin-top: .55rem; }
.hero .actions { margin-top: 1rem; }
.heading, .panel-heading, .dialog-header, .actions, .entry { display: flex; align-items: center; gap: .7rem; }
.heading, .panel-heading, .dialog-header, .entry { justify-content: space-between; }
.heading { margin-bottom: 1.25rem; flex-wrap: wrap; }
.heading p { margin-top: .35rem; }
.actions { flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.05rem; min-width: 0; box-shadow: 0 4px 14px #07111626; }
.panel-heading { margin-bottom: 1rem; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.stat { min-width: 0; }
.stat .label { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .83rem; }
.icon { width: 19px; height: 19px; flex: none; }
.icon-tile { display: inline-grid; place-items: center; color: var(--accent); background: #283842; padding: .48rem; border-radius: 10px; }
.icon-home, .icon-spark { --ink: #ffc29e; }
.icon-server, .icon-device, .icon-cpu { --ink: #99cbee; }
.icon-camera, .icon-folder, .icon-disk { --ink: #8cdac6; }
.icon-lock, .icon-user { --ink: #e8c38f; }
.icon-check, .icon-layers { --ink: #cbb8ed; }
:is(.icon-tile, .nav-link, .mini-metric) .icon { color: var(--ink, currentColor); fill: currentColor; fill-opacity: .09; }
.icon-tile:has(.icon-spark) { background: #40332e; }
.stat strong { font-size: 1.65rem; line-height: 1.3; display: block; margin: .55rem 0 .15rem; overflow-wrap: anywhere; }
.stat small { color: var(--muted); }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1rem; }
.catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr)); gap: .85rem; }
.tile { text-align: left; display: grid; justify-content: stretch; gap: .55rem; padding: 1rem; align-content: start; width: 100%; background: var(--panel); }
.tile strong, .entry strong { overflow-wrap: anywhere; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.view-option { border: 0; border-radius: 0; background: transparent; padding: .45rem .55rem; color: var(--muted); }
.view-option + .view-option { border-left: 1px solid var(--line); }
.view-option.active { background: #3b332f; color: #ffceab; }
.view-option .icon { width: 16px; height: 16px; }
.catalog.list { grid-template-columns: 1fr; gap: .25rem; }
.catalog.list .tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: .05rem .7rem; padding: .55rem .75rem; width: 100%; }
.catalog.list .tile-head { display: contents; }
.catalog.list .tile-head .icon-tile { grid-column: 1; grid-row: 1 / span 2; padding: .4rem; }
.catalog.list .tile-head > .icon:last-child { grid-column: 3; grid-row: 1 / span 2; color: var(--muted); }
.catalog.list .tile > strong { grid-column: 2; grid-row: 1; font-size: .88rem; }
.catalog.list .tile > small { grid-column: 2; grid-row: 2; }
.entry { width: 100%; text-align: left; padding: .65rem 0; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.entry > span:first-child { min-width: 0; }
.entry small { display: block; }
.entry .icon { color: var(--muted); }
.pill { border-radius: 999px; background: #263d40; color: #b0e1d7; padding: .18rem .55rem; font-size: .7rem; white-space: nowrap; }
.empty { padding: 1rem 0; color: var(--muted); }
.plot { position: relative; min-height: 160px; }
.plot svg { width: 100%; height: 150px; display: block; }
.plot-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: .73rem; }
.metric-note { color: var(--muted); font-size: .8rem; margin-top: .65rem; }
.progress-track { height: 5px; background: #272a38; border-radius: 99px; overflow: hidden; margin-top: .65rem; }
.progress-fill { height: 100%; background: var(--accent-strong); }
dialog { position: fixed; inset: 0; margin: auto; height: fit-content; }
.dialog { padding: 1.25rem; width: min(94vw, 590px); color: var(--text); background: var(--panel); border: 1px solid #3b3e50; border-radius: 13px; max-height: 90dvh; }
.dialog::backdrop { background: #080910b8; }
.dialog-header { margin-bottom: 1rem; }
.fields { display: grid; gap: .7rem; }
label { display: grid; gap: .3rem; font-size: .84rem; color: #cdd1e0; }
input, select, textarea { width: 100%; min-width: 0; background: #111f27; border: 1px solid #435761; border-radius: 10px; padding: .56rem .7rem; color: var(--text); }
input::placeholder, textarea::placeholder { color: #a5b3b8; }
textarea { min-height: 82px; resize: vertical; }
#edit-form .actions { justify-content: flex-end; margin-top: 1rem; }
.message { color: #ff9aab; margin-top: .5rem; }
.message:empty { display: none; }
.console { width: min(96vw, 1130px); }
.copy-dialog { width: min(94vw, 760px); }
.copy-text { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
#terminal { height: min(62dvh, 590px); padding: .6rem; background: #0e1016; border-radius: 8px; }
#console-message { font-size: .8rem; margin-top: .65rem; }
.detail-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem .8rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.secret-value { margin: 1rem 0; padding: .8rem; background: var(--bg); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-popover { position: fixed; z-index: 5; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid #3b3e50; border-radius: 13px; box-shadow: 0 18px 50px #000b; max-height: min(72vh, calc(100vh - 24px)); overflow: auto; animation: popover-in .12s ease-out; }
.telegram-status { margin-bottom: 1rem; }
.telegram-status-line { display: flex; align-items: center; gap: .55rem; font-size: .95rem; }
.telegram-activity { color: var(--muted); font-size: .78rem; margin-top: .35rem; }
.tg-history { display: grid; gap: .55rem; max-height: 62vh; overflow: auto; padding-right: .2rem; }
.tg-message { display: flex; }
.tg-message.user { justify-content: flex-end; }
.tg-bubble { max-width: min(80%, 760px); padding: .55rem .7rem; border-radius: 11px; background: var(--panel-raised); border: 1px solid var(--line); }
.tg-message.user .tg-bubble { background: #2a2342; border-color: #3e3560; }
.tg-bubble p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .86rem; }
.tg-bubble small { display: block; color: var(--muted); font-size: .65rem; margin-top: .25rem; }
.tg-role { color: var(--accent); font-size: .65rem; margin-bottom: .15rem; }
.storage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: .6rem; }
.storage-card { position: relative; display: flex; flex-direction: column; gap: .2rem; min-height: 100px; padding: .7rem; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 11px; color: var(--text); overflow: hidden; }
.storage-card:hover { border-color: #4a3f70; }
.storage-card > *:not(.storage-preview) { position: relative; z-index: 1; }
.storage-card-head { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .7rem; }
.storage-card strong { font-size: .9rem; }
.storage-card small { color: var(--muted); font-size: .7rem; }
.storage-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; }
.storage-card .storage-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); background: linear-gradient(145deg, #262a3c, #151720); }
.breadcrumbs { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: .6rem; font-size: .78rem; color: var(--muted); }
.crumb-sep { color: #5a5f73; }
.storage-section { margin-bottom: 1.1rem; }
.storage-section:last-child { margin-bottom: 0; }
.storage-section h2 { font-size: 1rem; margin-bottom: .5rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.photo-card { display: block; padding: 0; overflow: hidden; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.photo-card:hover { border-color: #4a3f70; }
.photo-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #0e1016; }
.photo-caption { padding: .5rem .6rem; }
.photo-caption strong { display: block; font-size: .78rem; overflow-wrap: anywhere; }
.photo-caption small { display: block; color: var(--muted); font-size: .66rem; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .55rem; }
.file-card { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; width: 100%; min-width: 0; padding: .6rem; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 9px; text-align: left; color: var(--text); }
.file-card:hover { border-color: #4a3f70; }
.file-card .storage-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #0e1016; margin-bottom: .25rem; }
.file-card .storage-fallback { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 6px; background: #0e1016; margin-bottom: .25rem; }
.file-card strong { font-size: .78rem; overflow-wrap: anywhere; }
.file-card small { color: var(--muted); font-size: .66rem; }
.photo-card-main, .file-card-main { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.photo-card-main { display: block; }
.photo-card-main:hover, .file-card-main:hover { background: none; color: inherit; }
.file-actions { display: flex; align-items: center; gap: .15rem; width: 100%; margin-top: .45rem; padding-top: .35rem; border-top: 1px solid var(--line); justify-content: space-between; }
.photo-card .file-actions { margin-top: .1rem; padding: .35rem .45rem .4rem; }
.file-actions .icon { width: 15px; height: 15px; }
.icon-action { display: inline-grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); }
.icon-action:hover { background: var(--panel); border-color: var(--line); color: var(--text); }
.icon-action.danger { color: #ff9aab; }
.photo-viewer { width: min(96vw, 1100px); }
.photo-viewer img { width: 100%; max-height: 68vh; object-fit: contain; background: #0e1016; border-radius: 8px; display: block; }
.photo-viewer #photo-meta { margin-top: .5rem; font-size: .76rem; }
.photo-viewer .actions { margin-top: .6rem; }
.vault-cat { color: var(--text); }
a.vault-cat { color: var(--text); }
a.vault-cat:hover { color: #d3c9ff; }
.simple-row .actions { margin-left: auto; }
.trash-list { display: grid; gap: .4rem; }
.trash-row { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 9px; }
.trash-thumb { width: 46px; height: 46px; flex: none; object-fit: cover; border-radius: 6px; background: #0e1016; }
.trash-icon { width: 46px; height: 46px; flex: none; }
.trash-main { flex: 1; min-width: 0; }
.trash-main strong { display: block; font-size: .82rem; overflow-wrap: anywhere; }
.trash-main small { display: block; color: var(--muted); font-size: .68rem; }
.trash-row .actions { flex: none; }
.trash-row .storage-fallback { width: 46px; height: 46px; flex: none; border-radius: 6px; }
@media (max-width: 600px) {
  .trash-row { flex-wrap: wrap; }
  .trash-row .actions { width: 100%; justify-content: flex-end; }
}
.drop-hint { font-size: .75rem; margin: -.5rem 0 .9rem; }
.drop-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: #080910cc; border: 2px dashed var(--accent); pointer-events: none; }
.drop-card { padding: 1.2rem 1.6rem; text-align: center; background: var(--panel); border: 1px solid #4a3f70; border-radius: 14px; }
.file-card.drop-target { border-color: var(--accent); background: #26203b; }
.uploads { position: fixed; right: 1rem; bottom: 1rem; z-index: 25; width: min(92vw, 380px); max-height: 60vh; overflow: auto; padding: .8rem; background: var(--panel); border: 1px solid #3b3e50; border-radius: 12px; box-shadow: 0 18px 50px #000b; }
.uploads-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.upload-row { margin-bottom: .6rem; font-size: .75rem; }
.upload-row:last-child { margin-bottom: 0; }
.upload-top { display: flex; justify-content: space-between; gap: .5rem; }
.upload-top strong { font-weight: 500; overflow-wrap: anywhere; }
.upload-percent { color: var(--muted); flex: none; }
.upload-status { display: block; color: var(--muted); font-size: .68rem; margin-top: .2rem; }
.upload-row.failed .upload-status { color: #ff9aab; }
.upload-row .progress-track { height: 4px; margin-top: .3rem; }
.detail-popover .dialog-header { margin-bottom: .8rem; }
.detail-body { min-width: 0; }
@keyframes popover-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tile.active, .simple-row.active, .camera-card.active, .project-item.active, .entry.active { border-color: #4a3f70; background: #26203b; }
.agent-compose {
  display: grid; gap: .85rem; margin-bottom: 1rem; padding: clamp(1rem, 2vw, 1.65rem);
  border-color: #51514c;
  background: linear-gradient(115deg, #292e30, var(--panel) 72%);
}
.agent-compose h2, .attention h2 { display: flex; align-items: center; gap: .55rem; }
.agent-compose h2 { font-size: 1.25rem; }
.attention h2 .icon { color: var(--green); }
.attention:has([data-level="warn"]) h2 .icon { color: #f0cd88; }
.agent-compose textarea { min-height: 4.5rem; }
.chat-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.chat-targets label { min-width: 0; }
.fixed-directory { align-self: end; padding: .6rem 0; color: var(--muted); font-size: .85rem; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.chat-context { color: #c3ccce; overflow-wrap: anywhere; font-size: .8rem; }
.attention {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .45rem 1rem; margin-bottom: 1rem;
  padding: .75rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.attention h2 { font-size: .9rem; }
.attention details, .attention > a { font-size: .85rem; }
.attention details { min-width: 0; }
.attention > a { margin-left: auto; }
.attention summary { cursor: pointer; color: var(--muted); }
.attention [data-level="warn"] summary { color: #f0cd88; }
.attention [data-level="ok"] summary { color: var(--green); }
.attention-list { margin: .5rem 0 0; padding-left: 1.2rem; overflow-wrap: anywhere; }
.overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.agents-overview { margin-bottom: 1rem; }
.agents-overview .agent-cards { grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr)); }
.server-row { justify-content: flex-start; }
.server-row .server-status.online { color: var(--green); }
.server-row .server-status.offline { color: #ff9aab; }
.server-focus-head a { flex: none; }
.server-focus-head > div { min-width: 0; overflow-wrap: anywhere; }
.session-list { display: grid; max-height: 430px; overflow: auto; }
.session-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.session-row:first-child { border-top: 0; }
.session-row > div:first-child { min-width: 0; }
.session-row strong { display: block; overflow-wrap: anywhere; }
.session-row small { display: block; color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.session-row .actions { flex: none; }
.file-picker { position: relative; cursor: pointer; }
.file-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-picker:focus-within { outline: 2px solid var(--accent); }
.login { display: grid; place-items: center; min-height: 100dvh; padding: 1rem; background: radial-gradient(ellipse at 32% 28%, #2d494b, transparent 50%), radial-gradient(ellipse at 74% 77%, #44392f, transparent 45%); }
.login-card { width: min(100%, 430px); padding: 1.6rem; display: grid; gap: .9rem; }
.login-card h1 { font-size: 1.75rem; }
#token-login { margin-top: .15rem; }
#token-login summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
#token-login label { margin-top: .55rem; }
#login-qr { justify-content: center; }
#toast { position: fixed; right: 1rem; bottom: 1rem; max-width: min(90vw, 460px); padding: .7rem 1rem; border-radius: 9px; color: var(--text); background: #29243b; border: 1px solid #4d4269; z-index: 3; }
#results { margin-top: .8rem; }
.topbar-actions { display: flex; align-items: center; gap: .55rem; }
.overview-head {
  position: relative; isolation: isolate; overflow: hidden; margin-bottom: 1rem;
  padding: 1.15rem 1.4rem; border: 1px solid #3b5358; border-radius: 18px;
  background: linear-gradient(105deg, #203238, #263d43 65%, #355058);
}
.overview-intro { position: relative; z-index: 1; width: 65%; }
.overview-head h1 { font-size: clamp(1.55rem, 2.6vw, 2.35rem); letter-spacing: -.042em; margin: .2rem 0; }
.overview-caption { font-size: .9rem; color: #c6d6d5; }
.home-scene { position: absolute; right: 0; bottom: 0; width: min(35%, 370px); height: auto; pointer-events: none; }
.search { gap: .55rem; justify-content: flex-start; }
.search kbd { margin-left: auto; }
.topbar-actions .icon, #nav-toggle .icon, .composer-footer .icon { width: 16px; height: 16px; }
.tile:hover, .agent-card:hover, .storage-card:hover { border-color: #65828a; background-color: #293943; }
.catalog:not(.list) .tile { border-radius: 14px; padding: 1.15rem; gap: .65rem; }
.mini-metric strong, .donut strong { font-variant-numeric: tabular-nums; }
.dash-row { display: grid; gap: 1rem; margin-bottom: 1rem; }
.row-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.server-split { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: .8rem; }
.server-list { display: grid; gap: .15rem; max-height: 330px; overflow: auto; align-content: start; }
.server-row { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; padding: .45rem .5rem; border: 1px solid transparent; background: none; border-radius: 8px; }
.server-row:hover { background: var(--panel-raised); }
.server-row.selected { background: #283c40; border-color: #46666b; }
.server-row div { min-width: 0; }
.server-row strong { display: block; font-size: .84rem; overflow-wrap: anywhere; }
.server-row small { display: block; color: var(--muted); font-size: .7rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #6b7085; flex: none; }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px #63dab522; }
.status-dot.offline { background: #ff7a8a; box-shadow: 0 0 0 3px #ff7a8a22; }
.status-dot.unknown { background: #c9a227; }
.status-dot.thinking { background: #b29dfc; animation: dot-pulse 1.4s infinite; }
.status-dot.working { background: var(--green); animation: dot-pulse 1.4s infinite; }
.status-dot.queued { background: #c9a227; animation: dot-pulse 1.4s infinite; }
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.server-focus { min-width: 0; }
.server-focus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .65rem; }
.server-focus-head .server-name { font-size: 1rem; }
.server-focus-head small { display: block; color: var(--muted); }
.mini-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.mini-metric { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: .5rem .55rem; min-width: 0; }
.mini-metric .label { display: flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .68rem; }
.mini-metric .label .icon { width: 14px; height: 14px; }
.mini-metric strong { display: block; font-size: 1rem; margin-top: .2rem; overflow-wrap: anywhere; }
.mini-metric small { color: var(--muted); font-size: .64rem; overflow-wrap: anywhere; }
.mini-metric .progress-track { margin-top: .35rem; height: 4px; }
.disk-list { display: grid; gap: .6rem; }
.disk-row { display: grid; gap: .1rem; min-width: 0; }
.disk-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; font-size: .78rem; }
.disk-head strong { overflow-wrap: anywhere; }
.disk-head span { color: var(--muted); }
.disk-row .progress-track { margin-top: .2rem; height: 5px; }
.disk-row small { color: var(--muted); font-size: .66rem; overflow-wrap: anywhere; }
.agent-cards { display: grid; gap: .45rem; }
.agent-card { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; padding: .55rem .6rem; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 10px; }
.agent-card div { min-width: 0; }
.agent-card strong { display: block; font-size: .84rem; }
.agent-card small { display: block; color: var(--muted); font-size: .7rem; }
.agent-card .status-dot { margin-left: auto; }
.monitor-alerts { display: grid; gap: .35rem; margin: .8rem 0; }
.monitor-alert { padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: .78rem; }
.monitor-alert.error { color: #ffb3c0; border-color: #5a2a35; background: #2a1820; }
.monitor-alert.warn { color: #f0d38a; border-color: #5a4a2a; background: #242015; }
.monitor-ok { color: var(--green); font-size: .78rem; margin: .8rem 0; }
.monitor-services { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: .5rem 0; }
.monitor-service { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .75rem; }
.quick-prompts { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.quick-prompts button { padding: .35rem .6rem; font-size: .75rem; }
.panel-sub { margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.panel-sub-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .2rem; }
.simple-list { display: grid; }
.simple-row { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; padding: .42rem 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.simple-row:first-child { border-top: 0; }
.simple-row div { min-width: 0; }
.simple-row strong { display: block; font-size: .8rem; overflow-wrap: anywhere; }
.simple-row small { display: block; color: var(--muted); font-size: .68rem; overflow-wrap: anywhere; }
.simple-row .status-dot, .simple-row .pill { margin-left: auto; }
.small-note { font-size: .75rem; padding: .3rem 0; }
.camera-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.camera-player { display: grid; gap: .8rem; margin-bottom: 1rem; }
.camera-screen { display: grid; place-items: center; background: #0c151b; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 65vh; }
.camera-screen > * { grid-area: 1 / 1; }
.camera-screen > svg { width: 44px; height: 44px; color: var(--muted); }
.camera-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #0c151b; }
.camera-card { position: relative; min-height: 82px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: .1rem; padding: .55rem; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, #262a3c, #151720); overflow: hidden; }
.camera-card .icon { position: absolute; top: .45rem; left: .5rem; color: var(--accent); opacity: .75; }
.camera-card strong { font-size: .76rem; overflow-wrap: anywhere; }
.camera-card small { color: var(--muted); font-size: .66rem; }
.camera-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; pointer-events: none; }
.camera-card.has-preview { min-height: 132px; }
.camera-card.has-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(8, 11, 16, .9)); pointer-events: none; }
.camera-card strong, .camera-card small { position: relative; z-index: 1; }
.vault-total { display: flex; align-items: baseline; gap: .4rem; margin-bottom: .45rem; }
.vault-total strong { font-size: 1.5rem; }
.vault-cats { display: grid; }
.vault-cat { display: flex; justify-content: space-between; gap: .5rem; padding: .34rem 0; border-top: 1px solid var(--line); font-size: .78rem; }
.vault-cat:first-child { border-top: 0; }
.vault-cat span:last-child { color: var(--muted); }
.sync-line { display: flex; align-items: center; gap: .4rem; margin-top: .55rem; color: var(--muted); font-size: .7rem; }
.donut-wrap { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.donut { width: 78px; height: 78px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative; background: conic-gradient(var(--green) calc(var(--value, 0) * 1%), #272a38 0); }
.donut::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel); }
.donut strong { position: relative; z-index: 1; font-size: .9rem; }
.project-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.project-col { min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: .55rem; }
.project-col h3 { display: flex; justify-content: space-between; gap: .4rem; color: var(--muted); font-size: .74rem; margin-bottom: .4rem; }
.project-col h3 span { color: var(--text); }
.project-item { display: block; width: 100%; text-align: left; padding: .42rem; margin-top: .3rem; background: var(--panel-raised); border: 1px solid transparent; border-radius: 7px; }
.project-item:first-of-type { margin-top: 0; }
.project-item:hover { border-color: var(--line); }
.project-item strong { display: block; font-size: .75rem; overflow-wrap: anywhere; }
.project-item small { display: block; color: var(--muted); font-size: .64rem; overflow-wrap: anywhere; }
.nav-count { margin-left: auto; background: #35304a; color: #d3caff; border-radius: 999px; padding: 0 6px; font-size: .68rem; }
.create-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.compact-dialog { width: min(94vw, 430px); }
@media (max-width: 1250px) {
  .row-main { grid-template-columns: 1fr; }
  .row-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-bottom { grid-template-columns: 1fr; }
  .mini-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .row-four { grid-template-columns: 1fr; }
  .mini-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-split { grid-template-columns: 1fr; }
  .server-list { max-height: 200px; }
  .project-columns { grid-template-columns: 1fr; }
  .overview-head { margin-bottom: .8rem; }
  .topbar-actions { flex-wrap: wrap; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1050px) {
  .layout { grid-template-columns: 195px minmax(0, 1fr); }
  .content, .topbar { padding-left: 1.2rem; padding-right: 1.2rem; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .7rem; }
  #nav-toggle, #compose-shortcut { display: inline-flex; }
  #nav-toggle { min-height: 40px; }
  .sidebar nav, .sidebar .sidebar-foot { display: none; }
  .sidebar.nav-open nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .65rem; }
  .sidebar.nav-open .sidebar-foot { display: flex; }
  .nav-group { display: none; }
  .nav-link { min-height: 42px; font-size: .88rem; padding: .4rem .6rem; gap: .45rem; }
  .sidebar-foot { padding-top: .35rem; }
  .topbar { height: auto; padding: .55rem 1rem; }
  #breadcrumbs, #sync, .search kbd { display: none; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .topbar-actions > * { flex: 1 1 auto; min-height: 40px; padding: .4rem .5rem; }
  .search { min-width: 0; justify-content: center; }
  .attention { display: grid; gap: .3rem; }
  .attention > a { margin-left: 0; }
  .chat-targets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-targets > :nth-child(n+3) { grid-column: 1 / -1; }
  .composer-footer button { min-height: 44px; }
  .content { padding: 1rem; }
  .work-grid { grid-template-columns: 1fr; }
  .overview-head { padding: .8rem 1rem; }
  .overview-intro { width: 100%; }
  .home-scene { width: 118px; opacity: .46; z-index: -1; }
  .overview-head h1 { font-size: clamp(1.32rem, 5vw, 1.7rem); }
  .overview-caption { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot, .detail-popover { animation: none; }
}
@media (max-width: 360px) {
  .home-scene, #search-open span { display: none; }
  #search-open { flex: 0 0 42px; }
}
