/* Agent board: dark, three columns, as the reference screenshot (24/11/2026). */
:root {
  --bg: #0b0b0c;
  --panel: #111113;
  --line: #26262a;
  --hover: #1a1a1e;
  --text: #ececee;
  --muted: #8b8b93;
  --orange: #e8900c;
  --orange-soft: rgba(232, 144, 12, 0.18);
  --blue: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
button:focus-visible, textarea:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted, .handle { color: var(--muted); }
.handle, .time { font-family: var(--mono); font-size: 12px; }

.app { display: grid; grid-template-columns: 252px 1fr 440px; height: 100vh; }
.app.no-thread { grid-template-columns: 252px 1fr; }
.app.collapsed { grid-template-columns: 56px 1fr 440px; }
.app.collapsed.no-thread { grid-template-columns: 56px 1fr; }
.app.collapsed .nav-label, .app.collapsed .ws-name, .app.collapsed .section-row, .app.collapsed .channel-list, .app.collapsed .me-name, .app.collapsed .me-row .handle { display: none; }

.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg); padding: 12px 8px; min-width: 0; }
.ws-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 16px; }
.ws-name { font-weight: 600; }
.icon-button { color: var(--muted); padding: 2px 8px; border-radius: 6px; font-size: 16px; }
.icon-button:hover { background: var(--hover); color: var(--text); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 6px; text-align: left; }
.nav-item:hover, .nav-item.active { background: var(--hover); }
.nav-icon { width: 16px; text-align: center; color: var(--muted); }
.nav-label { flex: 1; }
.count { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--orange); color: #111; font-size: 12px; font-weight: 700; text-align: center; }
.section-row { display: flex; justify-content: space-between; padding: 20px 8px 6px; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }
.section-plus { font-size: 16px; }
.channel-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.channel-link { display: flex; align-items: center; width: 100%; padding: 6px 12px; border-radius: 6px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.channel-link span:first-child { flex: 1; }
.channel-link:hover { background: var(--hover); }
.channel-link.active { background: var(--hover); color: var(--text); }
.channel-link.unread { color: var(--text); font-weight: 700; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.me-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; }
.me-name { font-weight: 600; }
.settings { color: var(--muted); }

.center, .thread-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-panel { border-left: 1px solid var(--line); background: var(--panel); }
.center-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.center-head h2 { margin: 0; font-size: 15px; font-family: var(--mono); font-weight: 700; }
.thread-panel .center-head h2 { font-family: var(--sans); }
.thread-panel .center-head .muted { font-family: var(--mono); font-size: 12px; font-weight: 400; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.pill-button { padding: 3px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; background: var(--hover); }
.pill-button:hover { color: var(--text); }
.toggle { color: var(--muted); font-size: 13px; display: flex; gap: 4px; align-items: center; }
.scroll { flex: 1; overflow-y: auto; padding: 8px 0; }

.message { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 10px 20px 10px 28px; }
.message:hover { background: rgba(255, 255, 255, 0.02); }
.message.unread::before { content: ""; position: absolute; left: 12px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.message-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.author { font-weight: 700; }
.tag { padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; color: var(--muted); }
.body { white-space: pre-wrap; overflow-wrap: anywhere; }
.body code { font-family: var(--mono); font-size: 13px; background: var(--hover); padding: 1px 4px; border-radius: 4px; }
.mention { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(232, 144, 12, 0.45); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention.me { background: rgba(232, 144, 12, 0.32); }

.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 700; color: #fff; flex: none; }
.avatar.human { background: var(--orange); }
.avatar.agent { background: var(--blue); }
.avatar.agent::after { content: "+"; position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; color: #111; border: 2px solid var(--bg); font-size: 11px; line-height: 11px; text-align: center; }
.avatar.small { width: 20px; height: 20px; font-size: 10px; margin-right: -6px; border: 2px solid var(--bg); }
.avatar.small::after { display: none; }
.me-row .avatar { width: 32px; height: 32px; }

.replies { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; padding: 2px 6px 2px 0; border-radius: 6px; }
.replies:hover { background: var(--hover); }
.replies .faces { display: inline-flex; padding-right: 6px; }
.replies strong { color: var(--text); }
.resolved-mark { color: var(--green); font-size: 13px; margin-top: 4px; }
.reactions { display: flex; gap: 6px; margin-top: 4px; }
.reaction { padding: 0 8px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--muted); }
.reaction.mine { border-color: var(--blue); color: var(--text); }
.reaction-add { opacity: 0; }
.message:hover .reaction-add, .reaction-add:focus-visible { opacity: 1; }
.divider { display: flex; align-items: center; gap: 12px; padding: 4px 20px; color: var(--muted); font-size: 13px; }
.divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.composer { padding: 8px 20px 12px; }
.composer-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px 8px 8px 14px; }
.composer-box textarea { flex: 1; resize: none; border: 0; background: transparent; outline: none; min-height: 44px; }
.send { width: 34px; height: 34px; border-radius: 8px; background: #f2f2f2; color: #111; }
.hint { margin: 6px 0 0; color: var(--muted); font-family: var(--mono); font-size: 11px; }

.list-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 20px; text-align: left; }
.list-row:hover { background: var(--hover); }
.status { font-size: 12px; font-family: var(--mono); }
.status.online { color: var(--green); }
.status.offline { color: var(--muted); }
.status.stalled { color: var(--red); }
.empty { padding: 24px 20px; color: var(--muted); }

.login { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { width: min(360px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.login-card h1 { margin: 0; font-size: 18px; }
.login-card p { margin: 0; color: var(--muted); font-size: 13px; }
.login-card input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.login-card button { padding: 8px; border-radius: 8px; background: #f2f2f2; color: #111; font-weight: 600; }
.login-error { color: var(--red) !important; min-height: 1em; }

@media (max-width: 900px) {
  .app, .app.no-thread { grid-template-columns: 56px 1fr; }
  .app .nav-label, .app .ws-name, .app .section-row, .app .channel-list, .app .me-name, .app .me-row .handle { display: none; }
  .thread-panel { position: fixed; inset: 0; z-index: 2; }
}
