/* Nine Agent — builds on the tokens and base components in app.css */
:root {
  --c-run: #3b82f6;
  --c-ok: #22a06b;
  --c-bad: #e5484d;
  --c-wait: #e0a21b;
  --c-review: #a855f7;
  --c-idle: #8b8c9d;
}

.ag { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100dvh; }
.ag-nav { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; background: var(--sidebar); border-right: 1px solid var(--border); min-width: 0; }
.ag-nav .brand { padding: 4px 6px 10px; }
.nav-list { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px;
  font-size: 14px; color: var(--text-2); text-align: left; white-space: nowrap;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--active); color: var(--text); font-weight: 600; }
.nav-item .badge { margin-left: auto; }
.back-chat { border-top: 1px solid var(--border); border-radius: 0; padding-top: 12px; text-decoration: none; }

.ag-main { display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.ag-top { display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.ag-top .spacer { flex: 1; }
.sel {
  height: 36px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-elev);
  font-weight: 600; max-width: 240px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px; background-repeat: no-repeat;
}
.search-pill {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border-radius: 10px;
  background: var(--hover); color: var(--text-3); font-size: 13.5px; min-width: 200px;
}
.search-pill kbd { margin-left: auto; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); }
.btn.stop { background: var(--c-bad); border-color: transparent; color: #fff; font-weight: 700; letter-spacing: .02em; }
.btn.stop:hover { background: #d63c41; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }

.ag-view { flex: 1; overflow-y: auto; padding: 22px 24px 40px; scrollbar-gutter: stable; }
.ag-view > .wrap { max-width: 1240px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.view-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.view-head p { margin: 4px 0 0; color: var(--text-3); font-size: 14px; }
.view-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h2 .muted { font-weight: 400; font-size: 13px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.empty-state { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 14px; }
.empty-state b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

/* pills / badges */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill.run, .pill.running, .pill.working, .pill.planning, .pill.verifying { color: var(--c-run); background: color-mix(in srgb, var(--c-run) 12%, transparent); border-color: color-mix(in srgb, var(--c-run) 30%, transparent); }
.pill.completed, .pill.ok, .pill.pass, .pill.approved, .pill.approved_always, .pill.low { color: var(--c-ok); background: color-mix(in srgb, var(--c-ok) 12%, transparent); border-color: color-mix(in srgb, var(--c-ok) 30%, transparent); }
.pill.failed, .pill.error, .pill.fail, .pill.rejected, .pill.high, .pill.denied { color: var(--c-bad); background: color-mix(in srgb, var(--c-bad) 12%, transparent); border-color: color-mix(in srgb, var(--c-bad) 30%, transparent); }
.pill.waiting, .pill.paused, .pill.awaiting_approval, .pill.warn, .pill.medium, .pill.pending, .pill.blocked { color: var(--c-wait); background: color-mix(in srgb, var(--c-wait) 14%, transparent); border-color: color-mix(in srgb, var(--c-wait) 35%, transparent); }
.pill.reviewing, .pill.planned, .pill.modified { color: var(--c-review); background: color-mix(in srgb, var(--c-review) 12%, transparent); border-color: color-mix(in srgb, var(--c-review) 30%, transparent); }
.pill.running::before, .pill.working::before, .pill.planning::before, .pill.verifying::before, .pill.reviewing::before { animation: pulse 1.1s ease-in-out infinite; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--c-bad); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font: 500 11.5px var(--mono); background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-2); }

/* hero / composer */
.hero {
  position: relative; overflow: hidden; padding: 22px 22px 18px; border-radius: 20px; margin-bottom: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--bg-elev)), var(--bg-elev) 55%, color-mix(in srgb, var(--accent-2) 10%, var(--bg-elev)));
  border: 1px solid var(--border);
}
.hero h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.hero p { margin: 4px 0 14px; color: var(--text-2); font-size: 14px; }
.hero textarea { width: 100%; min-height: 84px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--bg-elev); resize: vertical; outline: none; font-size: 15px; }
.hero textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .16); }
.hero .row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.hero .hint { flex: 1; min-width: 180px; font-size: 13px; color: var(--text-3); }
.notice-bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; background: color-mix(in srgb, var(--c-wait) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c-wait) 35%, transparent); }
.notice-bar.bad { background: color-mix(in srgb, var(--c-bad) 10%, transparent); border-color: color-mix(in srgb, var(--c-bad) 30%, transparent); }

.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; border-radius: 14px; background: var(--bg-elev); border: 1px solid var(--border); min-width: 0; }
.stat .k { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--text-3); }
.bar { height: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.bar.ok > i { background: var(--c-ok); }
.bar.bad > i { background: var(--c-bad); }

/* run list */
.run-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 140px auto; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; cursor: pointer; }
.run-row:hover { background: var(--hover); }
.run-row.active { background: var(--active); }
.run-row .goal { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-row .sub { font-size: 12px; color: var(--text-3); }
.run-row .bar { margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* team room */
.run-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.run-head h1 { margin: 6px 0 4px; font-size: 19px; letter-spacing: -.01em; line-height: 1.4; }
.run-head .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.run-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.run-picker { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.run-picker select { flex: 1; max-width: 100%; }
.team { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.agent-col { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.agent-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--bg-elev); border: 1px solid var(--border); }
.agent-card.on { border-color: color-mix(in srgb, var(--c-run) 45%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-run) 10%, transparent); }
.agent-card.wait { border-color: color-mix(in srgb, var(--c-wait) 55%, var(--border)); }
.av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; background: var(--av, var(--accent)); }
.agent-card .nm { display: flex; align-items: center; gap: 6px; justify-content: space-between; font-size: 14px; font-weight: 600; }
.agent-card .nm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-card .rl { font-size: 12px; color: var(--text-3); }
.agent-card .ct { font-size: 12.5px; color: var(--text-2); margin-top: 4px; overflow-wrap: anywhere; }
.agent-card .tl { margin-top: 4px; }

.feed { display: flex; flex-direction: column; gap: 2px; }
.fi { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 12px; }
.fi:hover { background: var(--hover); }
.fi .av { width: 30px; height: 30px; font-size: 12.5px; border-radius: 9px; }
.fi .hd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.fi .hd b { font-weight: 600; }
.fi .hd .to { color: var(--text-3); }
.fi .hd time { margin-left: auto; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.fi .bd { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; margin-top: 2px; }
.fi.tool .bd { font: 12.5px var(--mono); color: var(--text-2); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; }
.fi.ERROR .bd { color: var(--c-bad); }
.fi.WARNING .bd { color: color-mix(in srgb, var(--c-wait) 80%, var(--text)); }
.type { font: 700 10.5px var(--mono); letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-2); }
.type.RESULT, .type.ANSWER { color: var(--c-ok); }
.type.ERROR { color: var(--c-bad); }
.type.WARNING, .type.QUESTION { color: var(--c-wait); }
.type.REVIEW, .type.HANDOFF { color: var(--c-review); }
.type.TASK { color: var(--c-run); }

.report { margin-top: 16px; }
.report .verdict { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; font-weight: 700; margin-bottom: 12px; }
.report .verdict.pass { background: color-mix(in srgb, var(--c-ok) 13%, transparent); color: var(--c-ok); }
.report .verdict.fail { background: color-mix(in srgb, var(--c-bad) 12%, transparent); color: var(--c-bad); }
.report ul { margin: 0; padding-left: 20px; font-size: 14px; }
.report li { margin: 3px 0; }
.check-list { list-style: none; padding: 0 !important; }
.check-list li { display: flex; gap: 8px; align-items: baseline; }
.check-list li::before { content: "✓"; color: var(--c-ok); font-weight: 700; }
.check-list li.no::before { content: "✗"; color: var(--c-bad); }

/* board */
.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 16px; padding: 10px; min-height: 160px; transition: border-color .15s, background .15s; }
.col.over { border-color: var(--accent); background: var(--active); }
.col h3 { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px 10px; font-size: 13px; color: var(--text-2); }
.tcard { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow-sm); }
.tcard[draggable=true] { cursor: grab; }
.tcard:hover { border-color: var(--border-strong); }
.tcard .tk { display: flex; align-items: center; gap: 6px; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.tcard .tt { font-size: 14px; font-weight: 600; margin: 4px 0; line-height: 1.4; }
.tcard .tn { font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.tcard .tn.err { color: var(--c-bad); }

/* plan / dag */
.dag-wrap { position: relative; overflow-x: auto; padding: 6px 2px 10px; }
.dag { position: relative; display: flex; gap: 48px; align-items: flex-start; min-width: max-content; }
.dag-col { display: flex; flex-direction: column; gap: 14px; }
.dag-col .lv { font-size: 11.5px; color: var(--text-3); font-weight: 600; letter-spacing: .03em; }
.dag-node { width: 230px; padding: 10px 12px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--border); position: relative; z-index: 1; cursor: pointer; }
.dag-node.completed { border-color: color-mix(in srgb, var(--c-ok) 50%, var(--border)); }
.dag-node.running, .dag-node.reviewing { border-color: color-mix(in srgb, var(--c-run) 60%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-run) 12%, transparent); }
.dag-node.failed, .dag-node.cancelled { border-color: color-mix(in srgb, var(--c-bad) 50%, var(--border)); }
.dag-node .tt { font-size: 13.5px; font-weight: 600; margin: 4px 0 6px; }
.dag-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.dag-svg path { fill: none; stroke: var(--border-strong); stroke-width: 1.6; }
.plan-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.plan-lists ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); }

/* approvals */
.apr { border-left: 4px solid var(--c-wait); }
.apr.high { border-left-color: var(--c-bad); }
.apr .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.apr .reason { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.apr pre { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--code-bg); color: #e6e8ef; font: 12.5px/1.55 var(--mono); max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.apr .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.apr textarea { width: 100%; min-height: 70px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); margin: 8px 0; font: 13px var(--mono); }

/* tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.tbl tr:hover td { background: var(--hover); }
.tbl .mono { font-family: var(--mono); font-size: 12px; }
.tbl .nowrap { white-space: nowrap; }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }

/* agents */
.agent-tile { display: flex; flex-direction: column; gap: 8px; }
.agent-tile .hd { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.agent-tile .av { width: 38px; height: 38px; }
.agent-tile .nm { font-weight: 600; font-size: 14.5px; }
.agent-tile .rl { font-size: 12.5px; color: var(--text-3); }
.agent-tile .tools { display: flex; flex-wrap: wrap; gap: 4px; }
.agent-tile .foot { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.agent-tile.off { opacity: .55; }

/* memory */
.mem { display: flex; flex-direction: column; gap: 8px; }
.mem .ct { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mem .mt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.mem .mt input[type=range] { width: 110px; accent-color: var(--accent); }
.mem.pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.inline-form input, .inline-form select, .inline-form textarea, .field-inline { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); outline: none; min-width: 0; }
.inline-form textarea { height: 38px; padding-top: 8px; resize: vertical; }

/* files */
.files { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.tree { max-height: 70vh; overflow: auto; font: 13px var(--mono); }
.tree button { display: block; width: 100%; text-align: left; padding: 4px 8px; border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.tree button:hover { background: var(--hover); color: var(--text); }
.tree button.active { background: var(--active); color: var(--text); }
.tree button.dir { color: var(--text-3); }
.viewer pre { margin: 0; max-height: 70vh; overflow: auto; padding: 12px 14px; border-radius: 12px; background: var(--code-bg); color: #e6e8ef; font: 12.5px/1.6 var(--mono); white-space: pre; }
.viewer .vh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font: 13px var(--mono); color: var(--text-2); }

/* forms in dialogs */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field select { width: 100%; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); }
.tool-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; font-size: 13px; }
.tool-checks label { display: flex; gap: 6px; align-items: center; font-family: var(--mono); font-size: 12.5px; }
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog .dialog-body { padding: 4px 22px 22px; overflow-y: auto; }
.dialog .dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--border); }
.md-out { font-size: 14px; }
.md-out pre { background: var(--code-bg); color: #e6e8ef; padding: 10px 12px; border-radius: 10px; overflow-x: auto; font: 12.5px var(--mono); }
.md-out :not(pre) > code { font: .88em var(--mono); padding: .1em .35em; border-radius: 5px; background: var(--bg-soft); border: 1px solid var(--border); }
.md-out p { margin: 0 0 .6em; }
.md-out > :last-child { margin-bottom: 0; }
.section-title { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }

/* palette + bell */
.palette { position: fixed; inset: 0; z-index: 80; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: rgba(8, 8, 16, .45); backdrop-filter: blur(3px); }
.palette-box { width: min(620px, 100%); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .14s ease-out; }
.palette-box .pop-search { padding: 14px 16px; }
.palette-box .pop-search input { font-size: 15px; }
.palette-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette-list h4 { margin: 8px 10px 4px; font-size: 11.5px; color: var(--text-3); letter-spacing: .03em; }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; font-size: 14px; }
.pal-item small { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pal-item:hover, .pal-item.kb { background: var(--hover); }
.bell-wrap { position: relative; }
.bell-wrap .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--c-bad); box-shadow: 0 0 0 2px var(--bg); }
.bell-menu { left: auto; right: 0; width: min(380px, calc(100vw - 24px)); max-height: 60vh; overflow-y: auto; padding: 6px; }
.bell-item { padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.bell-item:hover { background: var(--hover); }
.bell-item b { display: block; font-size: 13.5px; }
.bell-item time { font-size: 11.5px; color: var(--text-3); }
.toast.success { background: var(--c-ok); color: #fff; }
.toast.warn { background: var(--c-wait); color: #1b1b1f; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .team { grid-template-columns: minmax(0, 1fr); }
  .agent-col { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 760px) {
  .ag { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ag-nav { flex-direction: row; align-items: center; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; gap: 4px; }
  .ag-nav .brand-name, .back-chat span { display: none; }
  .ag-nav .brand { padding: 0 4px; }
  .nav-list { flex-direction: row; overflow: visible; }
  .nav-item { padding: 7px 10px; }
  .nav-item span:not(.badge) { display: none; }
  .nav-item.active span:not(.badge) { display: inline; }
  .back-chat { border: 0; padding: 7px; }
  .ag-main { height: auto; min-height: 0; }
  .ag { height: 100dvh; }
  .ag-top { height: auto; padding: 8px 12px; flex-wrap: wrap; }
  .search-pill { min-width: 0; flex: 1; }
  .search-pill kbd, #pauseAllBtn { display: none; }
  .sel { max-width: 50vw; }
  .ag-view { padding: 14px 14px 32px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-row { grid-template-columns: auto minmax(0, 1fr); }
  .run-row .bar, .run-row .sub.r { display: none; }
  .files { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .inline-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inline-form > :first-child { grid-column: 1 / -1; }
  .board { grid-template-columns: repeat(6, 240px); }
}
