/* VVN Command Centre — Agent Team: the brief list, writing a brief, one brief,
   documents and the roster. Phone first: the list and the page it opens take turns;
   from 1024 px they sit side by side. Tokens and shared components are in base.css. */

.view-team { max-width: 1320px; }
.team-app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.team-side, .team-main { min-width: 0; }

/* ------------------------------------------------------------- side pane */
.team-side-head { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; }
.seg { display: flex; flex: 1; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg-item { display: grid; flex: 1; place-items: center; height: 34px; padding: 0 6px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.seg-item:hover { color: var(--text); text-decoration: none; }
.seg-item.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

.list-tools { display: grid; gap: 10px; padding: 2px 0 6px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text-3);
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search input { flex: 1; min-width: 0; height: 40px; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.search input:focus { background: transparent; box-shadow: none; }
.filters { display: flex; gap: 6px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  display: inline-flex; flex: none; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-2); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600;
}
.filter:hover { color: var(--text); }
.filter.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); }
.filter-n { min-width: 18px; padding: 1px 6px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); font-size: 11px; text-align: center; }

.brief-list, .file-list { display: grid; gap: 2px; }
.list-group { margin: 14px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.list-group:first-child { margin-top: 6px; }
.brief-row, .file-row {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 10px;
  padding: 11px 10px; border-radius: var(--r); color: var(--text);
}
.brief-row:hover, .file-row:hover { background: var(--hover); text-decoration: none; }
.brief-row.active, .file-row.active { background: var(--accent-soft); }
.row-status, .file-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.s-running { background: var(--info-soft); color: var(--info); }
.s-done { background: var(--ok-soft); color: var(--ok); }
.s-failed { background: var(--err-soft); color: var(--err); }
.s-cancelled { color: var(--text-3); }
.row-main { display: grid; gap: 3px; min-width: 0; }
.row-title, .row-snippet { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.brief-row.unseen .row-title { font-weight: 750; }
.row-snippet { font-size: 13px; color: var(--text-2); }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 2px; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.file-row > .i { align-self: center; color: var(--text-3); }
.mini {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.mini-warn { background: var(--warn-soft); color: var(--warn); }
.agent-chips { display: inline-flex; align-items: center; gap: 3px; }
.agent-chip {
  --c: var(--accent); display: inline-grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 24%, var(--surface)); color: var(--c); font-size: 9.5px; font-weight: 800;
  letter-spacing: -0.02em;
}
.agent-more { --c: var(--text-3); }
.unseen-dot { width: 9px; height: 9px; margin-top: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.load-more { margin: 10px 0 4px; }
.list-welcome { display: grid; gap: 12px; padding: 12px 6px; }

.fab {
  position: fixed; z-index: 25; right: 16px; bottom: calc(var(--tabbar-h) + 16px + var(--safe-bottom));
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border-radius: 26px;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 650; box-shadow: 0 14px 30px -10px rgba(79, 70, 229, 0.9);
}
.fab:hover { filter: brightness(1.06); text-decoration: none; }

/* ------------------------------------------------------- shared in panes */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 650; white-space: nowrap;
}
.pill-info, .pill-run { background: var(--info-soft); color: var(--info); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-err { background: var(--err-soft); color: var(--err); }
.pane-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.pane-head h2 { flex: 1; min-width: 0; font-size: 20px; }
.pane-back { margin-left: -8px; }
.pane-empty { display: grid; justify-items: center; gap: 12px; padding: 60px 20px; }
/* --c comes from the c-<colour> class on the same element; setting it here would override that. */
.tpl-ic {
  display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: color-mix(in srgb, var(--c, var(--accent)) 17%, transparent); color: var(--c, var(--accent));
}

.pane-home { display: grid; gap: 18px; }
.home-hero {
  display: flex; align-items: flex-start; gap: 16px; padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: radial-gradient(600px 200px at 0% 0%, rgba(99, 102, 241, 0.18), transparent 70%), var(--surface);
}
.home-ic { display: grid; flex: none; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: #fff; }
.home-hero h2 { margin-bottom: 6px; font-size: 22px; }
.tallies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tally { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; text-align: left; }
.tally b { font-size: 24px; color: var(--text); font-variant-numeric: tabular-nums; }
.tally:hover { border-color: var(--border-2); }
.home-sub { font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.tpl-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tpl-mini { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.tpl-mini:hover { border-color: var(--border-2); background: var(--surface-2); text-decoration: none; }
.tpl-mini-text { display: grid; gap: 2px; min-width: 0; }
.tpl-mini-text > span { font-size: 12.5px; color: var(--text-3); }

/* --------------------------------------------------------------- compose */
.compose { display: grid; gap: 14px; max-width: 780px; }
.compose-lead { color: var(--text-2); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tpl-card {
  display: grid; justify-items: start; gap: 6px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-align: left; transition: border-color 0.15s, transform 0.12s;
}
.tpl-card:hover { border-color: var(--accent); }
.tpl-card:active { transform: scale(0.99); }
.tpl-card .tpl-ic { width: 42px; height: 42px; margin-bottom: 4px; }
.tpl-card b { font-size: 15px; }
.tpl-card > span:last-child { font-size: 13px; color: var(--text-3); }
.compose-form { display: grid; gap: 14px; }
.tpl-picked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.tpl-picked > div { display: grid; min-width: 0; }
.tpl-picked > div > span { font-size: 12.5px; color: var(--text-3); }
.dictate { position: relative; display: block; }
.dictate textarea { min-height: 0; padding-right: 52px; }
.dictate-btn { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--text-2); }
.dictate-btn.on { background: #ef4444; color: #fff; animation: mic-pulse 1.3s infinite; }
.compose-options { display: grid; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.opt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.opt > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.preview summary { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); list-style: none; cursor: pointer; }
.preview summary::-webkit-details-marker { display: none; }
.brief-preview {
  margin: 10px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--border);
  font: 13px/1.55 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
.compose-bar {
  position: sticky; z-index: 6; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.plan { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.plan-head { display: flex; align-items: center; gap: 12px; }
.plan-head > .i { width: 26px; height: 26px; color: var(--accent); }
.plan-head > div { display: grid; }
.plan-head span { font-size: 12.5px; color: var(--text-3); }
.plan-deliverable { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); }
.plan-deliverable .i { margin-top: 3px; color: var(--accent); }
.plan-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.plan-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; gap: 10px; font-size: 14.5px; counter-increment: step; }
.plan-steps li::before {
  content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700;
}
.plan-agents { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.plan-questions { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.plan-questions h4 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.plan-questions h4 .i { color: var(--warn); }
.plan-questions > p, .plan-clear { font-size: 13px; color: var(--text-3); }

/* ---------------------------------------------------------------- brief */
.bd { display: grid; gap: 14px; min-width: 0; }
.bd-head { display: grid; gap: 8px; }
.bd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bd-when { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.bd-title { font-size: 21px; line-height: 1.3; }
.bd-title button { padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; overflow-wrap: anywhere; cursor: text; }
.bd-title button:hover { color: var(--accent); }
.bd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }

.live {
  display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--info) 35%, var(--border));
  background: radial-gradient(500px 160px at 0% 0%, rgba(96, 165, 250, 0.12), transparent 70%), var(--surface);
}
.live.is-queued { border-color: var(--border); background: var(--surface); }
.live-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--info); animation: live-info 1.8s infinite; }
.live-clock { font-weight: 650; color: var(--info); font-variant-numeric: tabular-nums; }
.live-note { flex-basis: 100%; font-size: 12.5px; color: var(--text-3); }
.live-now { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); font-size: 13.5px; overflow-wrap: anywhere; }
.live-now .i { margin-top: 2px; color: var(--info); }
.live-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.stat-chip b { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.checklist { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.checklist-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; }
.checklist-head span { margin-left: auto; font-weight: 500; color: var(--text-3); }
.checklist ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.checklist li > .i, .checklist li > .spinner { margin-top: 3px; }
.todo-completed { color: var(--text-3); }
.todo-completed span { text-decoration: line-through; text-decoration-color: var(--border-2); }
.todo-completed .i { color: var(--ok); }
.todo-in_progress { font-weight: 550; color: var(--text); }
.todo-in_progress .spinner { color: var(--info); }
.live-agents { display: grid; gap: 6px; }
.live-agent { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.live-agent-text { min-width: 0; overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.live-agent-text b { font-weight: 600; color: var(--text); }
.live-agent-n { font-size: 12px; color: var(--text-3); }

.bd-tabs {
  position: sticky; z-index: 8; top: calc(58px + var(--safe-top)); display: flex; gap: 2px; margin: 0 -12px; padding: 0 12px;
  overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
}
.bd-tabs::-webkit-scrollbar { display: none; }
.bd-tab { position: relative; display: inline-flex; flex: none; align-items: center; gap: 6px; height: 44px; padding: 0 12px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.bd-tab:hover { color: var(--text); text-decoration: none; }
.bd-tab.on { color: var(--text); }
.bd-tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad); }
.tab-n { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: 11px; text-align: center; }
.bd-tab.warn .tab-n { background: var(--warn-soft); color: var(--warn); }

.bd-panel { display: grid; align-content: start; gap: 14px; min-width: 0; min-height: 160px; }
.doc-callout {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.doc-callout:hover { border-color: var(--accent); text-decoration: none; }
.doc-callout > .i:first-child { color: var(--accent); }
.doc-callout > .i:last-child { color: var(--text-3); }
.doc-callout > span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.doc-callout > span > span { font-size: 12.5px; color: var(--text-3); }
.doc-callout.warn { border-color: color-mix(in srgb, var(--warn) 30%, var(--border)); }
.doc-callout.warn > .i:first-child { color: var(--warn); }

.ask {
  justify-self: end; max-width: min(620px, 92%); padding: 12px 14px; border-radius: 18px 18px 6px 18px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.ask-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-size: 12px; color: var(--text-3); }
.ask-head b { color: var(--text-2); }
.ask p, .ask summary { font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask summary { list-style: none; cursor: pointer; }
.ask summary::-webkit-details-marker { display: none; }
.ask summary b { font-size: 13px; color: var(--accent); }
.ask details[open] summary { display: none; }
.run-divider { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.run-divider::before, .run-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.run-divider span { display: inline-flex; align-items: center; gap: 6px; }
.run-state { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px dashed var(--border-2); font-size: 14px; color: var(--text-2); }
.older { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13.5px; text-align: left; }
.older span { flex: 1; }
.older b { font-size: 13px; color: var(--accent); }
.result { display: grid; gap: 12px; min-width: 0; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.result.latest { border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; }
.result-time { font-size: 12px; color: var(--text-3); }
.result-tools { display: flex; gap: 2px; margin-left: auto; }
.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.toc-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; font-size: 12px; font-weight: 650; color: var(--text-3); }
.toc-link {
  max-width: 100%; height: 28px; padding: 0 10px; overflow: hidden; border-radius: 999px; border: 1px solid var(--border-2);
  background: transparent; color: var(--text-2); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap;
}
.toc-link:hover { border-color: var(--accent); color: var(--text); }
.result-doc, .reader-doc { min-width: 0; font-size: 15.5px; line-height: 1.7; }
.result-doc :is(h2, h3, h4), .reader-doc :is(h2, h3, h4) { scroll-margin-top: 130px; }
.fail { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--err-soft); }
.fail > .i { margin-top: 2px; color: var(--err); }
.fail > div { display: grid; justify-items: start; gap: 6px; }
.fail p { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.fail .fail-hint { font-size: 13px; color: var(--text-3); }

.panel-intro { font-size: 14px; color: var(--text-2); }
.oi-group { margin-top: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.oi { display: grid; gap: 8px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.oi-q { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; gap: 10px; }
.oi-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700; }
.oi-q .doc { font-size: 14.5px; line-height: 1.55; }
.oi textarea { min-height: 0; font-size: 15px; }

.sources { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.sources a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 13.5px;
}
.sources a:hover { border-color: var(--border-2); text-decoration: none; }
.src-host { max-width: 45vw; overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.src-path { overflow: hidden; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.sources .i { color: var(--text-3); }

.log { display: grid; gap: 2px; min-width: 0; }
.log-run { margin: 12px 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.log-run:first-child { margin-top: 0; }
.lg { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 6px 4px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.lg .i { margin-top: 3px; color: var(--text-3); }
.lg time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lg.nested { padding-left: 16px; }
.lg-status .i { color: var(--ok); }
.lg-text { color: var(--text); }
.lg-agent { font-style: italic; color: var(--text-3); }
.lg-text span, .lg-agent span { white-space: pre-line; }
.lg-more { padding: 0 2px; border: 0; background: none; color: var(--accent); font: inherit; font-style: normal; font-weight: 600; cursor: pointer; }
.log-agent { margin: 4px 0; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); }
.log-agent summary { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 10px; font-size: 13px; list-style: none; cursor: pointer; }
.log-agent summary::-webkit-details-marker { display: none; }
.log-agent-text { min-width: 0; overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.log-agent-text b { color: var(--text); }
.log-count { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.log-agent summary time { font-size: 11.5px; color: var(--text-3); }
.log-children { padding: 0 10px 8px; border-top: 1px solid var(--border); }
.log-children .lg.nested { padding-left: 4px; }

.bd-bar {
  position: sticky; z-index: 7; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); display: grid; gap: 8px; margin: 0 -12px;
  padding: 10px 12px 12px; background: linear-gradient(to top, var(--bg) 78%, transparent);
}
.bd-bar:empty { display: none; }
.bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.bar-note { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.bar-line { display: flex; align-items: flex-end; gap: 8px; }
.bar-line .bar-form { flex: 1; min-width: 0; }
.bar-form { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-pop); }
.bar-form:focus-within { border-color: var(--accent); }
.bar-form textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 160px; padding: 9px 8px; border: 0; background: transparent; box-shadow: none; resize: none; font-size: 15px; line-height: 1.4; }
.bar-form textarea:focus { background: transparent; box-shadow: none; }
.bar-form .btn { height: 40px; border-radius: 20px; }
.bar-stop { height: 54px; border-radius: 22px; }
.bar-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.bar-chips::-webkit-scrollbar { display: none; }
.bar-chips .chip { flex: none; height: 32px; background: var(--surface-2); font-size: 12.5px; }

/* --------------------------------------------------------------- reader */
.reader { display: grid; gap: 14px; min-width: 0; }
.reader-title { display: grid; flex: 1; gap: 2px; min-width: 0; }
.reader-title h2 { font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.reader-title span { font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.reader-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mini-link {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; overflow: hidden; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap;
}
.mini-link:hover { color: var(--text); text-decoration: none; }
.versions { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; color: var(--text-3); }
.versions select { width: auto; max-width: 100%; height: 34px; min-height: 34px; padding: 0 10px; font-size: 13px; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.acc-next { margin: 4px 0 16px; }
.acc-next > div { display: grid; gap: 6px; justify-items: start; }
.acc-next .btn { margin-top: 4px; }
.reader-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.reader-toc { border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.reader-toc summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: 13.5px; font-weight: 650; list-style: none; cursor: pointer; }
.reader-toc summary::-webkit-details-marker { display: none; }
.reader-toc ol { display: grid; gap: 1px; margin: 0; padding: 0 8px 10px; list-style: none; }
.reader-toc button { width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; text-align: left; }
.reader-toc button:hover { background: var(--hover); color: var(--text); }
.toc-l2 button { padding-left: 20px; font-size: 12.5px; }
.reader-doc { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }

/* --------------------------------------------------------------- people */
.people { display: grid; gap: 14px; max-width: 900px; }
.people-lead { color: var(--text-2); }
.people-group { margin-top: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.people-note { display: block; font-size: 13px; color: var(--text-3); }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.agent-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.agent-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--c, var(--accent)) 20%, transparent); color: var(--c, var(--accent)); font-size: 13px; font-weight: 800; }
.agent-card-body { display: grid; gap: 4px; min-width: 0; }
.agent-card-head { display: flex; align-items: center; gap: 8px; }
.agent-card p { font-size: 13px; color: var(--text-2); }

/* --------------------------------------------------------------- layout */
@media (max-width: 1023px) {
  .team-app.show-main .team-side { display: none; }
  .team-app:not(.show-main) .team-main { display: none; }
  .team-app.show-main .fab { display: none; }
  .side-new { display: none; }
}
@media (max-width: 959px) {
  /* Room for the tab bar at the end, so a sticky bar stops above it instead of over the content. */
  .view-team { padding: 10px 12px calc(var(--tabbar-h) + var(--safe-bottom) + 12px); }
  .team-app:not(.show-main) .brief-list, .team-app:not(.show-main) .file-list { padding-bottom: 76px; }
  .compose-bar .btn { flex: 1; }
  .bd-title { font-size: 19px; }
  .reader-doc, .result { padding: 14px; }
}
@media (min-width: 960px) {
  .bd-tabs { top: 64px; margin: 0; padding: 0; }
  .bd-bar { bottom: 0; margin: 0; padding: 12px 0 16px; }
  .compose-bar { bottom: 0; }
  .fab { bottom: 24px; }
}
@media (min-width: 1024px) {
  .team-app { grid-template-columns: 350px minmax(0, 1fr); align-items: start; }
  .team-side {
    position: sticky; top: calc(64px + 20px); display: flex; flex-direction: column; height: calc(100dvh - 64px - 44px);
    overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
  }
  .team-side-head { padding: 12px 12px 8px; }
  .team-side-head .seg-item { font-size: 13px; }
  /* Four tabs share the side pane with the button, so the button keeps only its plus. */
  .side-new { width: 40px; padding: 0; }
  .side-new-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .team-side-body { flex: 1; min-height: 0; padding: 0 10px 12px; overflow-y: auto; overscroll-behavior: contain; }
  .team-side .list-tools { position: sticky; top: 0; z-index: 2; padding: 2px 2px 8px; background: var(--surface); }
  .fab, .pane-back { display: none; }
}
@media (min-width: 1280px) {
  .reader-body { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .reader-toc { position: sticky; top: calc(64px + 20px); max-height: calc(100dvh - 120px); overflow-y: auto; }
}

/* ======================================================= accounts and tax */
.tpl-group { margin: 18px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.acc { display: grid; gap: 14px; max-width: 960px; }
.acc-hero { display: flex; align-items: flex-start; gap: 16px; padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--border); background: radial-gradient(520px 200px at 0% 0%, color-mix(in srgb, #22c55e 14%, transparent), transparent 70%), var(--surface); }
.acc-hero-ic { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 16px; background: color-mix(in srgb, #22c55e 16%, transparent); color: #22c55e; }
.acc-hero h3 { font-size: 20px; letter-spacing: -0.02em; margin-bottom: 4px; }
.acc-hero p { color: var(--text-2); line-height: 1.55; }
.acc-steps { display: grid; gap: 8px; margin: 14px 0 4px; padding: 0; list-style: none; counter-reset: none; }
.acc-steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.acc-steps b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 12px; }

/* Files, on the page where the job is written: the accountant works from them. */
.cmp-give { display: grid; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.cmp-give-top { display: flex; align-items: flex-start; gap: 10px; }
.cmp-give-top > .i { margin-top: 2px; color: #22c55e; }
.cmp-give-top > div { display: grid; gap: 2px; min-width: 0; }
.cmp-give-top span { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.cmp-give-add { display: inline-flex; align-items: center; justify-self: start; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--surface-2); border: 1px dashed var(--border-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cmp-give-add:hover { border-color: var(--accent); color: var(--accent); }
.cmp-give-add.is-busy { opacity: 0.7; cursor: default; }
.cmp-give-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cmp-added { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cmp-added li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.cmp-added .i { color: var(--ok); }
.cmp-give-link { justify-self: start; font-size: 12.5px; color: var(--text-3); }

.acc-watch { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
.acc-watch-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); color: var(--text-3); }
.acc-watch-ic.is-on { background: var(--ok-soft); color: var(--ok); }
.acc-watch-text { display: grid; gap: 2px; flex: 1 1 320px; min-width: 0; }
.acc-watch-text > span { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.acc-watch-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.acc-files-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.acc-upload { display: grid; gap: 12px; padding: 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
.acc-upload-fields { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 12px; }
@media (max-width: 640px) { .acc-upload-fields { grid-template-columns: minmax(0, 1fr); } }
.acc-drop {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border-radius: var(--r);
  border: 1.5px dashed var(--border-2); background: var(--surface-2); text-align: center; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.acc-drop:hover, .acc-drop.is-over { border-color: #22c55e; background: color-mix(in srgb, #22c55e 7%, var(--surface-2)); }
.acc-drop.is-over { transform: scale(1.01); }
.acc-drop.is-busy { pointer-events: none; opacity: 0.7; }
.acc-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.acc-drop:focus-within { box-shadow: var(--ring); }
.acc-drop-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, #22c55e 15%, transparent); color: #22c55e; }
.acc-progress { display: grid; gap: 6px; }
.acc-progress[hidden] { display: none; }
.acc-progress-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.acc-progress-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #16a34a, #22c55e); transition: width 0.2s; }
.acc-progress > span { font-size: 12.5px; color: var(--text-2); }

.acc-group h4 { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.acc-group h4 span { padding: 1px 7px; border-radius: 999px; background: var(--surface-3); font-size: 11px; letter-spacing: 0; }
.acc-list { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.acc-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
.acc-file-ic { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.acc-file-ic i { position: absolute; bottom: -4px; right: -6px; padding: 0 4px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border-2); font-size: 9px; font-style: normal; font-weight: 700; text-transform: uppercase; color: var(--text-2); }
.acc-file-body { display: grid; gap: 2px; min-width: 0; }
.acc-file-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.acc-file-note { font-size: 12.5px; color: var(--text-2); }
.acc-empty { padding: 8px 0; }

.acc-work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .acc-work { grid-template-columns: minmax(0, 1fr); } }
.acc-work-col { display: grid; align-content: start; gap: 6px; min-width: 0; }
.acc-work-col .home-sub { margin-bottom: 2px; }
.acc-work-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.acc-work-row:hover { border-color: var(--border-2); background: var(--surface-2); text-decoration: none; }
.acc-work-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.acc-work-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.acc-work-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-3); }
.file-code { max-height: 70vh; overflow: auto; padding: 14px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
