/* tessallite-bot — chat page and configuration pages.
   Tessallite identity: Corporate Green for primary actions and active states,
   Premium Gold sparingly for highlights, Charcoal text, Soft Mint surfaces,
   accessible #8A94A6 boundaries, Inter and JetBrains Mono, 10 px button and
   14 px card radii (brand package 02_colour_palette, 03_typography,
   05_website_ui_kit).  One centred conversation column, one prominent input,
   minimal chrome, light and dark.  Fonts are used when installed on the host;
   there is no external request, so the pages work on an isolated network. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: local("Inter"), local("Inter-Regular"), local("Inter Variable");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: local("JetBrains Mono"), local("JetBrainsMono-Regular"), local("JetBrains Mono NL");
}

:root {
  --topbar-h: 57px;
  /* brand package: 02_colour_palette/palette.tokens.css */
  --tess-brand-green: #006c35;
  --tess-brand-green-hover: #005a2c;
  --tess-brand-green-pressed: #004a24;
  --tess-brand-gold: #d4af37;
  --tess-charcoal: #333333;
  --tess-white: #ffffff;
  --tess-mint: #f2f7f4;
  --tess-text-muted: #666666;
  --tess-border: #cbd5e1;
  --tess-border-accessible: #8a94a6;

  /* 03_typography and 05_website_ui_kit/ui-tokens.json */
  --font-sans: "Inter", Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius-button: 10px;
  --radius-card: 14px;
  --radius-badge: 6px;
  --radius: var(--radius-card);
  --radius-small: var(--radius-button);
  --radius-input: var(--radius-card);
  --column: 780px;

  /* light (default): the brand scheme */
  --bg: var(--tess-white);
  --surface: var(--tess-mint);
  --surface-2: #e4eee8;
  --border: var(--tess-border);
  --border-strong: var(--tess-border-accessible);
  --text: var(--tess-charcoal);
  --text-2: #4c5a54;
  --muted: var(--tess-text-muted);
  --primary: var(--tess-brand-green);
  --primary-hover: var(--tess-brand-green-hover);
  --primary-text: var(--tess-white);
  --accent: var(--tess-brand-gold);
  --focus: var(--tess-brand-green);
  --terminal-bg: #f7faf8;
  --state-queued: #64748b;
  --state-running: #0369a1;
  --state-done: var(--tess-brand-green);
  --state-blocked: #b45309;
  --state-failed: #b91c1c;
  --state-stopped: #6b7280;
  --shadow: 0 1px 2px rgba(0, 108, 53, 0.05), 0 6px 18px rgba(0, 108, 53, 0.06);
}

/* dark: the same identity on a deep green-charcoal canvas */
:root[data-theme="dark"] {
  --bg: #0c1511;
  --surface: #132019;
  --surface-2: #1a2b22;
  --border: #25392e;
  --border-strong: #46604f;
  --text: #edf3ef;
  --text-2: #b4c4ba;
  --muted: #84978b;
  --primary: var(--tess-brand-green);
  --primary-hover: #00804a;
  --primary-text: var(--tess-white);
  --accent: var(--tess-brand-gold);
  --focus: #3fae73;
  --terminal-bg: #0f1a14;
  --state-queued: #9aa8b5;
  --state-running: #6aa7ea;
  --state-done: #4fbf82;
  --state-blocked: #e0a43c;
  --state-failed: #f07a6e;
  --state-stopped: #9aa3a0;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1511;
    --surface: #132019;
    --surface-2: #1a2b22;
    --border: #25392e;
    --border-strong: #46604f;
    --text: #edf3ef;
    --text-2: #b4c4ba;
    --muted: #84978b;
    --primary: var(--tess-brand-green);
    --primary-hover: #00804a;
    --primary-text: var(--tess-white);
    --accent: var(--tess-brand-gold);
    --focus: #3fae73;
    --terminal-bg: #0f1a14;
    --state-queued: #9aa8b5;
    --state-running: #6aa7ea;
    --state-done: #4fbf82;
    --state-blocked: #e0a43c;
    --state-failed: #f07a6e;
    --state-stopped: #9aa3a0;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
code, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- top bar ----------------------------------------------------------- */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 28px; width: auto; }
.brand-name { font-weight: 600; font-size: 15px; white-space: nowrap; color: var(--text-2); padding-left: 10px; border-left: 1px solid var(--border); }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline; }
}
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.ghost {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  padding: 6px 10px;
  border-radius: var(--radius-small);
  cursor: pointer;
  text-decoration: none;
}
.ghost:hover { background: var(--surface); color: var(--text); }
.ghost[aria-current="page"] { color: var(--primary); font-weight: 600; }
:root[data-theme="dark"] .ghost[aria-current="page"],
:root[data-theme="dark"] .settings nav a[aria-current="page"],
:root[data-theme="dark"] .settings nav a[aria-current="step"] { color: var(--focus); box-shadow: inset 3px 0 0 var(--focus); }
:root[data-theme="dark"] .ghost[aria-current="page"] { box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ghost[aria-current="page"] { color: var(--focus); }
  :root:not([data-theme="light"]) .settings nav a[aria-current="page"],
  :root:not([data-theme="light"]) .settings nav a[aria-current="step"] { color: var(--focus); box-shadow: inset 3px 0 0 var(--focus); }
}

.token-pop {
  display: none;
  position: absolute;
  right: 18px;
  top: 48px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  width: 300px;
}
.token-pop.open { display: block; }

/* ---- main screen: chat (40%) beside the live agent network (60%) --------- */
.shell {
  display: grid;
  grid-template-columns: minmax(360px, 40fr) minmax(0, 60fr);
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
}
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--border); }
.chat-pane.empty { justify-content: center; }
.chat-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.chat-pane.empty .chat-scroll { flex: 0 0 auto; overflow: visible; }
.chat {
  max-width: var(--column);
  margin: 0 auto;
  padding: 8px 20px 24px;
}
.welcome { margin: 0 0 20px; }
.welcome h1 { font-size: 34px; font-weight: 700; margin: 10px 0 10px; letter-spacing: -0.03em; line-height: 1.12; }
.welcome p { color: var(--text-2); margin: 0; max-width: 460px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  border-radius: var(--radius-button);
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chip:hover { background: var(--surface); color: var(--primary); border-color: var(--primary); }

.msg { margin: 18px 0; }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user .bubble {
  background: var(--surface-2);
  border-radius: var(--radius-card);
  padding: 9px 15px;
  max-width: 80%;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-bot .text { white-space: pre-wrap; margin-bottom: 8px; }
.msg-bot .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.msg-error .text { color: var(--state-failed); }

/* ---- composer ----------------------------------------------------------- */
.composer-dock {
  flex: 0 0 auto;
  background: var(--bg);
  padding: 10px 20px 12px;
}
.prompt-chips { max-width: var(--column); margin: 8px auto 0; display: flex; flex-wrap: wrap; gap: 6px; }
.prompt-chips .chip { font-size: 12.5px; padding: 4px 10px; }
.composer {
  max-width: var(--column);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  background: var(--bg);
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow);
}
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 108, 53, 0.12); }
.composer textarea {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  max-height: 240px;
  padding: 7px 0;
}
.send {
  height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  border: 0;
  background: var(--primary);
  color: var(--primary-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.send:hover:not(:disabled) { background: var(--primary-hover); }
.send:disabled { opacity: 0.4; cursor: default; }
.statusline {
  max-width: var(--column);
  margin: 8px auto 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: 1px; }
.dot.offline { background: var(--state-failed); }

/* ---- cards -------------------------------------------------------------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg);
  padding: 14px 16px;
  margin: 10px 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-title { font-weight: 600; font-size: 14px; color: var(--text); }
.card-sub { color: var(--muted); font-size: 12.5px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: var(--radius-small);
  cursor: pointer;
}
.btn:hover { background: var(--surface); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active { background: var(--tess-brand-green-pressed); }
.btn-danger { color: var(--state-failed); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.stat { background: var(--surface); border-radius: var(--radius-small); padding: 8px 10px; }
.stat-label { color: var(--muted); font-size: 11.5px; }
.stat-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.rows th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.rows td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rows tr:last-child td { border-bottom: 0; }
.rows .link { cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.table-wrap { overflow-x: auto; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1px 7px;
  border-radius: var(--radius-badge);
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badge-queued { color: var(--state-queued); }
.badge-running { color: var(--state-running); }
.badge-done, .badge-ok { color: var(--state-done); }
.badge-planner { color: var(--text); background: rgba(212, 175, 55, 0.22); border-color: var(--accent); }
.badge-blocked, .badge-waiting { color: var(--state-blocked); }
.badge-failed { color: var(--state-failed); }
.badge-stopped, .badge-off { color: var(--state-stopped); }

.job { border-top: 1px solid var(--border); padding: 8px 0; }
.job:first-child { border-top: 0; }
.job-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.job-id { font-family: var(--font-mono); font-weight: 600; }
.job-where { color: var(--text-2); font-size: 13px; }
.job-note { color: var(--text-2); font-size: 13px; margin-top: 3px; white-space: pre-wrap; }
.job-error { color: var(--state-failed); font-size: 13px; margin-top: 3px; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

details summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
pre.block, .terminal {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 10px;
  overflow: auto;
  max-height: 420px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 6px 0 0;
}
.terminal-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.terminal-bar input[type="search"], .terminal-bar select { width: auto; }
.ansi-bold { font-weight: 700; }
.ansi-red { color: var(--state-failed); }
.ansi-green { color: var(--state-done); }
.ansi-yellow { color: var(--state-blocked); }
.ansi-blue { color: var(--state-running); }
.ansi-magenta { color: #9b51b8; }
.ansi-cyan { color: #1f8a99; }
.ansi-gray { color: var(--muted); }
mark { background: rgba(212, 175, 55, 0.35); color: inherit; border-radius: 2px; }

/* ---- forms (helper and configuration pages) ------------------------------ */
.field { margin: 10px 0; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 3px; }
.field .issue { color: var(--state-failed); font-size: 12.5px; margin-top: 3px; }
.field .warn { color: var(--state-blocked); font-size: 12.5px; margin-top: 3px; }
input[type="text"], input[type="number"], input[type="password"], input[type="search"], select, textarea.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 6px 9px;
}
textarea.input { min-height: 90px; resize: vertical; }
textarea.code { font-family: var(--font-mono); font-size: 12.5px; min-height: 60vh; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.issues { margin: 8px 0; padding: 8px 12px; border-radius: var(--radius-small); background: var(--surface); font-size: 13px; }
.issues ul { margin: 4px 0 0; padding-left: 18px; }
.notice { font-size: 13px; padding: 8px 12px; border-radius: var(--radius-small); background: var(--surface); margin: 8px 0; }
.notice-error { color: var(--state-failed); }
.notice-ok { color: var(--state-done); }

/* ---- configuration pages ------------------------------------------------- */
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; max-width: 1100px; margin: 0 auto; padding: 8px 20px 60px; }
.settings nav { position: sticky; top: 60px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.settings nav a { padding: 7px 10px; border-radius: var(--radius-small); text-decoration: none; color: var(--text-2); font-size: 14px; }
.settings nav a:hover { background: var(--surface); color: var(--text); }
.settings nav a[aria-current="page"],
.settings nav a[aria-current="step"] { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.page-intro { color: var(--text-2); margin: 0 0 14px; }
.section { margin: 18px 0 30px; }
.section h2 { font-size: 16px; margin: 0 0 6px; }
.entry { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 8px 0; }
.entry-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-name { font-weight: 600; font-family: var(--font-mono); }
.entry-facts { color: var(--text-2); font-size: 13px; }

@media (max-width: 700px) {
  .settings { grid-template-columns: 1fr; }
  .settings nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .grid-2 { grid-template-columns: 1fr; }
  .chat { padding: 8px 12px 200px; }
  .welcome { margin-top: 10vh; }
  .msg-user .bubble { max-width: 92%; }
}

/* ---- top bar: logo, project, settings gear ---------------------------------- */
.project-picker { width: auto; max-width: 240px; padding: 7px 10px; font-size: 13.5px; font-weight: 600; }
.gear {
  display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border);
  border-radius: var(--radius-button); color: var(--text-2); background: var(--bg);
}
.gear:hover, .gear[aria-current="page"] { color: var(--primary); border-color: var(--primary); }
.gear svg { width: 19px; height: 19px; }

/* ---- plan card (compact) --------------------------------------------------- */
.progress { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 2px 0 10px; }
.progress span { display: block; height: 100%; background: var(--primary); }
.job-line.plain { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; }
.job-line.plain > span:not(.badge) { flex: 1 1 auto; min-width: 0; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.job-line.plain .btn { margin-left: auto; }

/* ---- Live execution: a calm, high-clarity Bot workspace ----------------- */
.network-pane {
  min-width: 0; min-height: 0; overflow-y: auto; background: var(--surface);
  padding: clamp(18px, 2.5vw, 36px); display: flex; flex-direction: column; gap: 12px;
}
.net-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.net-head h2 { margin: 5px 0 0; font-size: 21px; font-weight: 650; letter-spacing: -0.025em; }
.net-head-actions { display: flex; align-items: center; gap: 12px; }
.net-demo {
  background: transparent; color: var(--text-2); border: 0; border-bottom: 1px solid var(--border-strong);
  font: inherit; font-size: 12px; padding: 4px 0; cursor: pointer;
}
.net-demo:hover { color: var(--primary); border-color: var(--primary); }
.net-badge { font-size: 11px; color: var(--state-blocked); font-weight: 650; }
.net-stats { color: var(--text-2); font-size: 12.5px; letter-spacing: 0; padding-bottom: 2px; }
.net-canvas {
  position: relative; flex: 1 0 430px; min-height: 430px;
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  background: var(--bg); box-shadow: 0 4px 16px rgba(15, 45, 29, .035);
  padding: clamp(16px, 2vw, 28px);
}
.flow-content {
  min-height: 100%; display: grid; grid-template-columns: minmax(132px, 21%) minmax(0, 1fr);
  gap: clamp(35px, 5vw, 72px); align-items: center; position: relative; z-index: 1;
}
.automation-hub {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  color: var(--text); text-decoration: none; padding: 18px 14px; min-height: 174px;
  justify-content: center; transition: background .18s, border-color .18s, box-shadow .18s;
}
.automation-hub:hover, .automation-hub:focus-visible {
  background: var(--surface-2); border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,108,53,.075);
}
.automation-icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface-2); color: var(--tess-brand-green);
  margin-bottom: 5px;
}
.automation-icon img { display: block; width: 32px; height: 32px; object-fit: contain; }
.automation-overline { font-size: 10px; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.automation-hub strong { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.automation-sub { font-size: 11px; line-height: 1.45; color: var(--text-2); }
.automation-link { color: var(--primary); font-size: 11px; font-weight: 650; margin-top: 4px; }
.bot-lanes { display: flex; flex-direction: column; gap: 16px; padding: 12px 0; min-width: 0; }
.bot-lane {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(28px, 3.7vw, 54px); align-items: stretch; min-width: 0;
}
.bot-card, .branch-card {
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
  min-width: 0; min-height: 112px;
}
.bot-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 12px;
  color: var(--text); cursor: pointer; font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.bot-card:hover { background: var(--surface); border-color: var(--border-strong); }
.bot-card:focus-visible, .bot-card[aria-pressed="true"] {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,108,53,.08);
}
.bot-card[data-status="Working"] { border-left: 3px solid var(--primary); }
.bot-portrait { flex: 0 0 48px; }
.bot-avatar { position: relative; display: grid; place-items: center; width: 48px; height: 48px; flex: none; }
.bot-avatar > .avatar { width: 48px; height: 48px; border-radius: 13px; background: var(--surface-2); }
.bot-avatar > .avatar svg { width: 29px; height: 29px; }
.bot-avatar-image {
  display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 12px;
  position: absolute; inset: 0; background: var(--surface); border: 1px solid var(--border);
}
.bot-identity { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.bot-headline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; line-height: 1.3; }
.bot-headline strong { font-size: 15px; letter-spacing: -.01em; }
.bot-state { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.bot-state-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--state-queued); }
.bot-card[data-status="Working"] .bot-state-dot { background: var(--primary); }
.bot-card[data-status="Waiting"] .bot-state-dot { background: var(--state-blocked); }
.bot-card[data-status="Blocked"] .bot-state-dot, .bot-card[data-status="Unknown"] .bot-state-dot { background: var(--state-failed); }
.bot-runtime { display: flex; gap: 6px; min-width: 0; flex-wrap: wrap; align-items: center; color: var(--text-2); font-size: 12px; }
.bot-machine { font-weight: 600; }
.bot-separator { color: var(--border-strong); }
.bot-harness { color: var(--text-2); }
.bot-tools { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-attitude { font-size: 11px; font-style: italic; color: var(--text-2); line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.automation-activity { color: var(--primary); font-weight: 600; }
.branch-card {
  display: flex; flex-direction: column; justify-content: center; padding: 12px 13px; gap: 5px;
  background: var(--surface);
}
.branch-label { font-size: 9.5px; letter-spacing: .09em; font-weight: 700; color: var(--muted); }
.branch-title { font-size: 12.5px; line-height: 1.3; overflow-wrap: anywhere; }
.branch-summary { font-size: 11px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.branch-counters { font-size: 10.5px; color: var(--primary); font-weight: 650; }
.net-connections { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.net-connection { fill: none; stroke-width: 1.5; stroke: var(--border-strong); opacity: .36; }
.net-connection.moving { stroke: var(--primary); opacity: .58; stroke-width: 1.8; }
.net-moving-dot { fill: var(--tess-brand-green); opacity: .92; filter: drop-shadow(0 0 2px rgba(0,108,53,.22)); }
.net-no-bots {
  padding: 22px; background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: 12px; color: var(--text-2); font-size: 13px;
}
.net-no-bots strong { color: var(--text); }
.net-no-bots p { margin: 7px 0; }
.net-no-bots a { display: inline-block; margin-top: 5px; color: var(--primary); font-weight: 650; }
.net-canvas.demo { border-color: rgba(212,175,55,.65); }
.net-status {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px;
  color: var(--text-2); min-height: 34px; padding: 2px 0;
}
.net-status.error { color: var(--state-failed); }
.net-detail-link {
  font: inherit; font-weight: 650; color: var(--primary); border: 0;
  background: transparent; text-decoration: underline; text-underline-offset: 3px;
  padding: 0; cursor: pointer;
}
a.net-detail-link { text-decoration: underline; }
.chat-bot-portrait { display:inline-flex; align-items:center; flex:0 0 29px; vertical-align:middle; }
.chat-bot-portrait .bot-avatar,
.chat-bot-portrait .bot-avatar > .avatar { width:28px; height:28px; border-radius:8px; }
.chat-bot-portrait .bot-avatar > .avatar svg { width:18px; height:18px; }
.chat-bot-portrait .bot-avatar-image { border-radius:8px; }
.bot-profile .entry-head { gap: 16px; }
.bot-profile .bot-avatar { width: 52px; height: 52px; }
.bot-profile .bot-avatar > .avatar { width: 52px; height: 52px; }
.bot-profile .entry-name { font-family: var(--font-sans); font-size: 16px; }
.bot-profile .entry-facts { font-size: 12px; }
.bot-profile .entry { border-color: var(--border); }
.bot-profile .bot-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bot-avatar-upload {
  display: inline-flex; align-items: center; font: inherit; font-size: 12.5px; font-weight: 650;
  padding: 7px 11px; border-radius: 9px; background: var(--tess-brand-green);
  color: white; cursor: pointer; min-height: 34px;
}
.bot-avatar-upload:hover { background: var(--tess-brand-green-hover); }
.bot-avatar-upload input { display: none; }
.bot-profile .bot-profile-head { display: flex; align-items: center; gap: 13px; }
.bot-profile .bot-profile-head > div { min-width: 0; }
:root[data-theme="dark"] .network-pane { background: #111c16; }
:root[data-theme="dark"] .automation-hub, :root[data-theme="dark"] .branch-card { background: #15271d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .network-pane { background: #111c16; }
  :root:not([data-theme="light"]) .automation-hub, :root:not([data-theme="light"]) .branch-card { background: #15271d; }
}
@media (prefers-reduced-motion: reduce) {
  .net-moving-dot { display: none; }
  .bot-card, .automation-hub { transition: none; }
}
@media (max-width: 1250px) and (min-width: 951px) {
  .flow-content { gap: 24px; grid-template-columns: minmax(120px, 23%) minmax(0,1fr); }
  .bot-lane { gap: 25px; }
  .bot-card { gap: 8px; padding: 10px 8px; }
  .bot-portrait, .bot-avatar, .bot-avatar > .avatar { width: 40px; height: 40px; flex-basis: 40px; }
}
@media (max-width: 950px) {
  .shell { display: flex; flex-direction: column; height: auto; }
  .chat-pane { min-height: 55vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-scroll { max-height: 70vh; }
  .network-pane { overflow: visible; }
  .net-canvas { flex-basis: 420px; }
}
@media (max-width: 610px) {
  .net-head h2 { font-size: 19px; }
  .net-stats { font-size: 11px; }
  .net-canvas { padding: 14px; min-height: 430px; }
  .flow-content { grid-template-columns: 1fr; gap: 20px; align-content: start; }
  .automation-hub { min-height: 92px; display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; padding: 10px 14px; }
  .automation-icon { grid-row: span 3; margin-bottom: 0; }
  .automation-hub strong { font-size: 15px; }
  .automation-link { margin-top: 1px; }
  .automation-sub { display: none; }
  .bot-lanes { padding: 0; gap: 12px; }
  .bot-lane { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .bot-card, .branch-card { min-height: 84px; }
  .branch-card { padding: 10px 14px; }
  .bot-tools { white-space: normal; }
  .branch-summary { display: none; }
  .net-connections { opacity: .3; }
}

/* ---- settings: this browser's access token and theme ---------------------- */
.browser-settings { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; }
.browser-settings .field { margin: 0; }


/* Scenario editor: a single approachable event→task→tool→outcome canvas. */
.automation-top-links {display:flex;align-items:center;gap:15px;font-size:12.5px;}
.automation-top-links a {text-decoration:none;color:var(--text-2);}
.automation-top-links a:hover {color:var(--primary);}
.automation-setup {max-width:1270px;margin:0 auto;padding:32px clamp(16px,3vw,38px) 80px;}
.automation-intro {max-width:850px;margin:0 0 26px;}
.automation-intro h1 {font-size:clamp(24px,3vw,32px);line-height:1.15;margin:6px 0 10px;letter-spacing:-.03em;}
.automation-intro p {color:var(--text-2);font-size:14px;line-height:1.6;margin:0;}
.scenario-queue {background:var(--bg);border:1px solid var(--border);border-radius:16px;padding:22px;margin:20px 0;}
.scenario-enroll,.scenario-queue-header {display:flex;align-items:end;gap:11px;flex-wrap:wrap;}
.scenario-enroll label {flex:1;min-width:190px;color:var(--text-2);font-size:12px;font-weight:600;display:grid;gap:5px;}
.scenario-enroll button {margin-bottom:1px;}
.scenario-queue h2 {font-size:18px;margin:4px 0 17px;}
#scenarioRuns {font-size:12.5px;color:var(--text-2);margin-top:20px;}
.scenario-run {display:grid;grid-template-columns:1fr 1.4fr auto;gap:12px;padding:12px 0;border-top:1px solid var(--border);}
.scenario-run strong {font-weight:650;color:var(--text);}
.scenario-state {font-size:11px;text-transform:uppercase;color:var(--primary);font-weight:700;letter-spacing:.08em;}

/* Routine editor: routine list, flow canvas, side panel for the selected step. */
.routine-studio {display:grid;grid-template-columns:200px minmax(0,1fr) 320px;gap:16px;align-items:start;margin:16px 0;}
.routine-list,.routine-board,.routine-inspector {background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-card);}
.routine-list {padding:10px;display:grid;gap:8px;}
.routine-pick {display:grid;gap:2px;text-align:left;width:100%;padding:9px 10px;border:1px solid transparent;border-radius:var(--radius-button);background:transparent;color:var(--text);cursor:pointer;font:inherit;}
.routine-pick span {font-size:11.5px;color:var(--muted);}
.routine-pick:hover {background:var(--surface);}
.routine-pick.is-current {border-color:var(--primary);background:var(--surface);}
.routine-empty {font-size:12.5px;color:var(--muted);margin:4px;}
.routine-board {min-width:0;}
.routine-toolbar {display:flex;align-items:end;gap:10px;flex-wrap:wrap;padding:12px 14px;border-bottom:1px solid var(--border);}
.routine-toolbar label {display:grid;gap:4px;font-size:12px;font-weight:600;color:var(--text-2);}
.routine-toolbar-gap {flex:1;}
.routine-flow {padding:6px;}
.routine-inspector {padding:14px 16px;display:grid;gap:12px;}
.routine-inspector h2 {font-size:16px;margin:0;}
.routine-hint {font-size:12.5px;color:var(--muted);margin:0;}
.routine-field {display:grid;gap:5px;font-size:12px;font-weight:600;color:var(--text-2);}
.routine-field > small {font-weight:400;color:var(--muted);line-height:1.45;}
.routine-field textarea {resize:vertical;min-height:70px;}
.routine-field .check, .routine-advanced .check {font-weight:400;font-size:13px;}
.routine-field textarea.code-small {font-family:var(--font-mono);font-size:12px;min-height:140px;}
.routine-advanced > summary {cursor:pointer;font-size:12px;color:var(--text-2);margin-bottom:8px;}
.routine-advanced {display:grid;gap:10px;}
.outcome-row {display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"name remove" "lead lead" "target target";
  gap:4px 6px;align-items:center;font-weight:400;padding:8px;border:1px solid var(--border);border-radius:var(--radius-button);}
.outcome-row [data-outcome-name] {grid-area:name;}
.outcome-row [data-outcome-remove] {grid-area:remove;}
.outcome-row > span {grid-area:lead;font-size:11.5px;color:var(--muted);}
.outcome-row [data-outcome-target] {grid-area:target;}
.routine-step-actions {display:flex;gap:8px;flex-wrap:wrap;}
@media(max-width:1100px){.routine-studio {grid-template-columns:minmax(0,1fr);}}
@media(max-width:600px){
 .automation-top-links {gap:7px;font-size:11px;}
 .automation-top-links a:nth-child(2),.automation-top-links a:nth-child(3){display:none;}
 .scenario-queue {padding:16px;}
}

/* Flow drawing (flow.js): shared by the routine card and the Automation page. */
.routine-card-flow {margin:6px 0;max-height:520px;overflow:auto;border:1px solid var(--border);border-radius:var(--radius-button);background:var(--surface);}
.flow-scroll {overflow:auto;max-width:100%;}
.flow-canvas {position:relative;margin:0 auto;}
.flow-edges {position:absolute;inset:0;pointer-events:none;overflow:visible;}
.flow-edge {fill:none;stroke:var(--border-strong);stroke-width:1.6;}
.flow-edge-back {stroke-dasharray:5 4;}
#flowArrow path {fill:var(--border-strong);}
.flow-edge-label {font-size:11px;fill:var(--text-2);paint-order:stroke;stroke:var(--bg);stroke-width:4px;}
.flow-box {position:absolute;display:flex;flex-direction:column;gap:3px;padding:9px 11px;text-align:left;overflow:hidden;
  background:var(--bg);border:1px solid var(--border-strong);border-radius:var(--radius-button);color:var(--text);font:inherit;}
button.flow-box {cursor:pointer;}
button.flow-box:hover {border-color:var(--primary);}
.flow-box.is-selected {border-color:var(--primary);box-shadow:0 0 0 2px var(--primary);}
.flow-box.is-start {border-left:4px solid var(--primary);}
.flow-box-head {display:flex;flex-wrap:wrap;align-items:center;gap:0 6px;font-size:13px;}
.flow-start {flex-basis:100%;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--primary);}
.flow-tool {font-size:11.5px;color:var(--primary);font-weight:600;}
.flow-task {flex-shrink:0;font-size:11.5px;color:var(--text-2);line-height:1.35;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.flow-ends {display:flex;gap:4px;flex-wrap:nowrap;overflow:hidden;margin-top:auto;flex-shrink:0;}
.flow-end {white-space:nowrap;font-size:10.5px;padding:1px 6px;border-radius:var(--radius-badge);background:var(--surface);color:var(--text-2);}
.flow-end-blocked {color:var(--state-failed);}
.flow-end-done {color:var(--state-done);}

/* Tools: the only extra UI is a closed-by-default section in Automation. */
.tool-library {margin-top:20px;border-top:1px solid var(--border);padding-top:13px;}
.tool-library > summary {display:flex;align-items:center;gap:12px;cursor:pointer;font-weight:650;font-size:13px;list-style:none;}
.tool-library > summary::-webkit-details-marker {display:none;}
.tool-library > summary::before {content:"▸";color:var(--primary);font-size:11px;}
.tool-library[open] > summary::before {content:"▾";}
.tool-muted {font-weight:400;color:var(--muted);font-size:11px;}
.tool-library-list {margin:14px 0 10px;color:var(--muted);font-size:12.5px;}
.tool-library-row {display:flex;justify-content:space-between;align-items:center;gap:14px;padding:10px 0;border-bottom:1px solid var(--border);}
.tool-library-row strong {color:var(--text);font-size:13px;}
.tool-library-row p {font-size:12px;margin:3px 0;color:var(--text-2);}
.tool-library-row small {color:var(--muted);font-size:11px;}
.tool-library-row-actions {display:flex;align-items:center;gap:9px;color:var(--muted);font-size:11px;white-space:nowrap;}
.tool-library-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;}
.tool-editor {padding:15px;margin-top:16px;border:1px solid var(--border);background:var(--surface);border-radius:12px;}
.tool-editor[hidden] {display:none;}
.tool-edit-header,.tool-edit-footer {display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px;}
.tool-edit-header strong {font-size:14px;}
.tool-edit-fields {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px;}
.tool-edit-fields label,.tool-advanced > label {display:grid;gap:5px;font-size:12px;color:var(--text-2);font-weight:550;}
.tool-description {grid-column:1/-1;}
.tool-edit-fields textarea {resize:vertical;}
.tool-hint {font-size:12px;color:var(--muted);line-height:1.5;margin:10px 0;}
.tool-advanced {margin:10px 0 14px;border-top:1px solid var(--border);padding-top:10px;}
.tool-advanced > summary {cursor:pointer;font-size:12px;color:var(--text-2);margin-bottom:10px;}
.tool-json {width:100%;min-height:100px;font-family:var(--font-mono);font-size:12px;}
.tool-enabled {display:flex;align-items:center;gap:7px;color:var(--text-2);font-size:12px;}
.tool-edit-footer {justify-content:flex-start;margin-bottom:0;}
.tool-edit-footer .btn-danger {margin-left:auto;}
@media(max-width:600px){.tool-edit-fields {grid-template-columns:1fr;}.tool-library-row{align-items:start;}}


/* ─── 2026 Chief-of-Staff workspace: conversation first, team always present ───
   The large network is intentionally not the home screen. Work details stay
   available through one narrative conversation and the Automation studio. */
.shell.team-workspace {
  display: grid;
  grid-template-columns: minmax(200px, 20fr) minmax(440px, 54fr) minmax(275px, 26fr);
  height: calc(100dvh - var(--topbar-h));
  min-height: 470px;
  background: var(--bg);
}
.team-pane, .live-pane, .team-workspace .chat-pane {min-width:0;min-height:0;}
.team-pane {
  display:flex;flex-direction:column;gap:0;overflow-y:auto;
  border-right:1px solid var(--border);padding:30px 14px 18px;
  background:var(--surface);
}
.team-side-heading {display:flex;align-items:center;justify-content:space-between;gap:7px;padding:0 10px 22px;}
.team-side-heading .eyebrow {font-size:10px;letter-spacing:.10em;}
.team-count {font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;}
.chief-profile {
  display:flex;align-items:center;gap:10px;padding:13px 10px;
  border:1px solid var(--border);border-radius:12px;
  background:var(--bg);margin-bottom:22px;
}
.chief-profile > img {width:40px;height:40px;object-fit:contain;flex-shrink:0;}
.chief-profile > div,.conversation-identity > div {display:flex;flex-direction:column;min-width:0;line-height:1.4;gap:3px;}
.chief-profile strong {font-size:13px;font-weight:700;line-height:1.3;}
.chief-profile span {font-size:11px;color:var(--text-2);}
.team-divider {border-top:1px solid var(--border);margin-bottom:10px;padding:15px 10px 3px;}
.team-divider span {font-size:10px;letter-spacing:.10em;color:var(--muted);font-weight:700;}
.team-roster {display:flex;flex-direction:column;gap:3px;}
.member-row {
  display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  font:inherit;color:var(--text);border:1px solid transparent;border-radius:10px;
  padding:10px 9px;background:transparent;cursor:pointer;min-height:62px;
  transition:background .15s,border-color .15s;
}
.member-row:hover, .member-row[aria-pressed="true"] {
  background:var(--bg);border-color:var(--border);
}
.member-row:focus-visible {outline:2px solid var(--focus);}
.member-portrait {display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;position:relative;}
.member-portrait .bot-avatar,.member-portrait .bot-avatar>.avatar {width:44px;height:44px;border-radius:50%;}
.member-portrait .bot-avatar>.avatar svg {width:25px;height:25px;}
.member-portrait .bot-avatar-image {border-radius:50%;border:1px solid var(--border);}
.member-labels {flex:1;display:flex;flex-direction:column;gap:3px;min-width:0;}
.member-name {font-size:14px;line-height:1.2;}
.member-role {font-size:10.5px;color:var(--muted);line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.member-update {
  color:var(--text-2);font-size:11.5px;line-height:1.35;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.member-state-dot {flex-shrink:0;width:7px;height:7px;border-radius:50%;background:var(--state-queued);}
.member-row[data-status="Working"] .member-state-dot {background:var(--state-done);box-shadow:0 0 0 3px rgba(0,108,53,.10);}
.member-row[data-status="Completed"] .member-state-dot {background:var(--state-done);}
.member-row[data-status="Blocked"] .member-state-dot {background:var(--state-failed);}
.member-row[data-status="Waiting"] .member-state-dot {background:var(--state-blocked);}
.team-empty {font-size:12px;line-height:1.55;color:var(--text-2);padding:8px 11px;}
.team-empty a {color:var(--primary);display:block;margin-top:5px;}
.team-footer {margin-top:auto;padding:18px 11px 6px;font-size:12px;}
.team-footer a {color:var(--primary);text-decoration:none;font-weight:650;}
.team-footer a:hover {text-decoration:underline;}
/* The conversation is the main work surface, not a narrow console column. */
.team-workspace .chat-pane {
  display:flex;flex-direction:column;overflow:hidden;
  background:var(--bg);border-right:1px solid var(--border);
}
.team-workspace .chat-pane.empty {justify-content:initial;}
.conversation-top {
  display:flex;align-items:center;min-height:76px;
  border-bottom:1px solid var(--border);padding:12px clamp(18px,4vw,44px);
}
.conversation-identity {display:flex;align-items:center;gap:10px;max-width:700px;width:100%;margin:auto;}
.conversation-identity img {width:35px;height:35px;object-fit:contain;}
.conversation-identity strong {font-size:15px;letter-spacing:-.01em;}
.conversation-identity span {font-size:12px;color:var(--muted);}
.team-workspace .chat-scroll {flex:1 1 auto;overflow-y:auto;min-height:0;}
.team-workspace .chat-pane.empty .chat-scroll {
  flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;overflow-y:auto;
}
.team-workspace .chat {max-width:760px;width:100%;padding:25px clamp(18px,4vw,44px) 50px;}
.team-workspace .welcome {max-width:610px;margin:0;}
.team-workspace .welcome h1 {font-size:clamp(26px,3vw,34px);line-height:1.18;}
.team-workspace .welcome p {font-size:15px;line-height:1.7;max-width:580px;}
.team-workspace .composer-dock {position:relative;padding:14px clamp(18px,3vw,40px) 12px;background:var(--bg);border-top:1px solid var(--border);}
.team-workspace .composer {max-width:760px;margin:auto;}
.team-workspace .statusline {max-width:760px;margin:9px auto 0;font-size:11px;}
.chat-suggestions {max-width:760px;margin:7px auto 0;}
.chat-suggestions summary {font-size:11px;color:var(--muted);cursor:pointer;list-style:none;width:max-content;}
.chat-suggestions summary:before {content:"+";font-weight:bold;color:var(--primary);margin-right:5px;}
.chat-suggestions[open] summary:before {content:"−";}
.chat-suggestions .prompt-chips {justify-content:flex-start;max-height:110px;overflow-y:auto;}
.message-byline {display:flex;align-items:center;gap:7px;font-size:12.5px;font-weight:700;color:var(--text-2);margin:0 0 6px;}
.message-byline img {width:26px;height:26px;object-fit:contain;flex-shrink:0;}
.team-workspace .msg {margin:21px 0;}
.team-workspace .msg-bot .text {font-size:14.5px;line-height:1.7;max-width:660px;}
.team-workspace .msg-user .bubble {font-size:14px;line-height:1.65;max-width:85%;padding:11px 15px;}
/* Right side: real events, brief context, no repeated empty branch rectangles. */
.live-pane {
  overflow-y:auto;padding:29px clamp(15px,2vw,27px) 24px;background:var(--bg);
}
.live-panel-head {display:flex;justify-content:space-between;align-items:center;gap:9px;margin-bottom:18px;}
.live-panel-head h2 {font-size:19px;line-height:1.3;font-weight:680;margin:6px 0 0;letter-spacing:-.022em;}
.live-panel-head .eyebrow {font-size:10px;letter-spacing:.10em;}
.live-automation-link {font-size:12px;color:var(--primary);text-decoration:none;font-weight:680;white-space:nowrap;}
.live-automation-link:hover {text-decoration:underline;}
.live-overview {
  border:1px solid var(--border);border-radius:11px;padding:15px;
  background:var(--surface);margin-bottom:21px;font-size:12px;color:var(--text-2);
}
.live-headline {display:flex;align-items:center;gap:9px;color:var(--text);font-size:14px;}
.live-indicator {display:inline-block;width:8px;height:8px;background:var(--state-queued);border-radius:50%;}
.live-indicator.is-active {background:var(--state-done);animation:subtle-work-pulse 2.2s ease-in-out infinite;}
@keyframes subtle-work-pulse {0%,100%{box-shadow:0 0 0 0 rgba(0,108,53,.15);}50%{box-shadow:0 0 0 5px rgba(0,108,53,0);}}
.live-secondary {margin:8px 0 0;font-size:11.5px;line-height:1.6;}
.live-section {margin-bottom:20px;padding-top:2px;}
.live-section h3 {font-size:12px;color:var(--text-2);font-weight:720;letter-spacing:.01em;margin:0 0 7px;}
.live-feed {font-size:12.5px;color:var(--text);line-height:1.48;}
.live-empty {font-size:12px;color:var(--muted);margin:2px 0 0;line-height:1.6;}
.live-item {border-bottom:1px solid var(--border);padding:9px 0;}
.live-item:last-child {border-bottom:0;}
.live-item strong {display:block;font-size:12.5px;font-weight:680;line-height:1.4;overflow-wrap:anywhere;}
.live-item p {margin:4px 0;color:var(--text-2);overflow-wrap:anywhere;font-size:11.8px;}
.live-item-meta {font-size:11px;color:var(--muted);}
.live-item.urgency {border-left:3px solid var(--state-blocked);padding-left:9px;margin-bottom:5px;}
.text-link {padding:0;border:0;background:transparent;color:var(--primary);cursor:pointer;font:inherit;font-size:11px;font-weight:700;margin-top:5px;}
.event-row {display:flex;align-items:flex-start;gap:10px;padding:8px 0;border-bottom:1px solid var(--border);}
.event-row:last-child {border:0;}
.event-row p {margin:0;font-size:11.7px;color:var(--text-2);line-height:1.5;overflow-wrap:anywhere;}
.event-pin {flex:0 0 6px;width:6px;height:6px;border-radius:50%;background:var(--border-strong);margin-top:6px;}
.focus-heading {display:flex;gap:9px;align-items:center;margin:7px 0 12px;}
.focus-heading strong {font-size:13px;}
.focus-subtitle {font-size:11px;color:var(--muted);line-height:1.4;}
.focus-fact {display:grid;grid-template-columns:70px minmax(0,1fr);gap:7px;font-size:11.5px;margin:6px 0;overflow-wrap:anywhere;}
.focus-key {color:var(--muted);}
.focus-personality {font-style:italic;color:var(--text-2);font-size:12px;line-height:1.6;margin:10px 0;}
.focus-edit {display:inline-block;font-size:12px;color:var(--primary);font-weight:680;text-decoration:none;margin-top:6px;}
/* Work objects: human-readable statements. IDs/timestamps only in technical details. */
.work-progress {font-size:11.5px;color:var(--muted);}
.technical-details {margin:10px 0;font-size:12px;color:var(--muted);}
.technical-details summary {cursor:pointer;color:var(--text-2);font-weight:600;}
.technical-details>.card-sub,.technical-details>.kv {margin-top:8px;}
.briefing-points p {font-size:13px;margin:5px 0;line-height:1.5;}
.briefing-points details {margin-top:10px;}
@media (max-width:1280px) {
  .shell.team-workspace {grid-template-columns:minmax(174px,20fr) minmax(390px,53fr) minmax(255px,27fr);}
  .team-pane {padding-left:10px;padding-right:10px;}
  .live-pane {padding-left:14px;padding-right:14px;}
}
@media (max-width:1050px) {
  .shell.team-workspace {display:grid;grid-template-columns:190px minmax(0,1fr);grid-template-rows:minmax(560px,1fr) auto;}
  .team-pane {grid-column:1;grid-row:1 / span 2;overflow-y:auto;}
  .team-workspace .chat-pane {grid-column:2;grid-row:1;min-height:550px;}
  .live-pane {grid-column:2;grid-row:2;overflow:visible;border-top:1px solid var(--border);padding:22px;}
}
@media (max-width:720px) {
  .shell.team-workspace {display:flex;flex-direction:column;height:auto;min-height:0;}
  .team-pane {width:100%;display:block;overflow:visible;border-right:0;border-bottom:1px solid var(--border);padding:9px 13px;}
  .team-side-heading,.team-divider,.team-footer {display:none;}
  .chief-profile {display:none;}
  .team-roster {display:flex;flex-direction:row;gap:8px;overflow-x:auto;}
  .member-row {min-width:148px;max-width:190px;padding:7px;min-height:60px;}
  .member-portrait {flex-basis:35px;width:35px;height:35px;}
  .member-portrait .bot-avatar,.member-portrait .bot-avatar>.avatar {width:35px;height:35px;}
  .member-portrait .bot-avatar>.avatar svg {width:20px;height:20px;}
  .member-name {font-size:12.5px;}
  .member-update {font-size:10px;}
  .team-workspace .chat-pane {min-height:65vh;border-right:0;}
  .conversation-top {padding:12px 18px;min-height:64px;}
  .live-pane {padding:22px 17px;max-height:none;overflow:visible;}
}
@media (prefers-reduced-motion: reduce) {
  .live-indicator.is-active {animation:none;}
  .member-row {transition:none;}
}


/* Narrated Chief-of-Staff proposals — no internal job IDs in the conversation. */
.proposal-step {padding:13px 0;border-top:1px solid var(--border);}
.proposal-step:first-child {border-top:0;}
.proposal-step-head {display:flex;align-items:flex-start;gap:10px;}
.proposal-step-number {
  width:21px;height:21px;flex:0 0 21px;display:grid;place-items:center;
  font-size:11px;font-weight:700;border-radius:50%;
  color:var(--primary);background:var(--surface-2);
}
.proposal-step-head strong {font-size:13.5px;line-height:1.45;font-weight:650;}
.proposal-route {margin:6px 0 0 31px;font-size:12px;color:var(--text-2);line-height:1.5;}
.proposal-note {margin:3px 0 0 31px;color:var(--muted);font-size:11.5px;}

/* ---------------------------------------------------------------- conversation (spec 3.2) */
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md code { font-family: 'JetBrains Mono', monospace; font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.event-chip {
  display: flex; flex-wrap: nowrap; align-items: baseline; gap: 8px;
  margin: 6px auto; max-width: 92%; padding: 6px 12px;
  color: var(--text-2); font-size: 13px; line-height: 1.4;
}
.event-chip .event-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex: none; }
.event-chip .event-text { flex: 1 1 auto; min-width: 0; }
.event-chip .event-time { flex: none; }
.event-chip .event-time { color: var(--muted); font-size: 12px; }
.entry-details { margin-top: 6px; font-size: 12px; color: var(--muted); }
.entry-details summary { cursor: pointer; width: fit-content; }
.entry-details-body { margin-top: 4px; font-family: 'JetBrains Mono', monospace; word-break: break-all; }
.entry-details-body .k { color: var(--text-2); }
.msg-decision .decision-actions { display: flex; gap: 8px; margin-top: 10px; }
.msg-decision .decision-done { margin-top: 8px; font-size: 13px; color: var(--muted); }
.msg-thinking .text { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: 0.6; } }

/* ---------------------------------------------------------------- team and routines (spec 3.1, 3.3) */
.role-badge { display: inline-block; width: fit-content; max-width: 100%; padding: 1px 7px; border: 1px solid var(--border); border-radius: 6px; font-size: 10.5px; color: var(--text-2); }
.member-update strong { font-weight: 600; color: var(--text); }
.routine-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.routine-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.routine-title { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.routine-state { font-size: 12px; color: var(--muted); }
.routine-error { display: block; font-size: 12px; color: var(--state-failed); }
.switch { position: relative; flex: none; width: 38px; height: 22px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 11px; background: var(--border-strong); transition: background 0.15s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: 0.45; }

/* ---------------------------------------------------------------- Tessallite Bot identity */
.brand .brand-mark { height: 28px; width: 28px; object-fit: contain; }
.brand-title { font-weight: 650; font-size: 16px; letter-spacing: 0.01em; color: var(--text); white-space: nowrap; }
.chief-profile { text-decoration: none; color: inherit; position: relative; }
.chief-profile:hover { border-color: var(--border-strong); }
.chief-portrait .bot-avatar, .chief-portrait .avatar { width: 40px; height: 40px; }
.conversation-identity .chief-portrait .bot-avatar, .conversation-identity .chief-portrait .avatar { width: 34px; height: 34px; }
.chief-edit { margin-left: auto; font-size: 11px; color: var(--primary); }
.message-byline .bot-avatar, .message-byline .avatar { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- live network (spec 3.3) */
.live-network { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 6px; }
.net-svg { display: block; width: 100%; height: auto; }
.net-edge { fill: none; stroke: var(--border-strong); stroke-width: 1.2; opacity: 0.55; }
.net-edge.is-active { stroke: var(--primary); stroke-width: 2; opacity: 1; }
.net-edge.is-dim { opacity: 0.22; }
.net-node.is-dim { opacity: 0.38; }
.net-node.is-active .net-tile-text, .net-node.is-active .net-label { font-weight: 700; }
.net-large .net-label, .net-large .net-tile-text { font-size: 11px; }
.live-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.net-dialog { width: min(1040px, 94vw); max-height: 90vh; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg); color: var(--text); }
.net-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.net-dialog-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.net-dialog-note { flex: 1; font-size: 12px; color: var(--muted); }
.net-dialog .live-network { overflow: auto; max-height: calc(90vh - 80px); }
.net-dot { fill: var(--accent); }
.net-ring { fill: var(--bg, #fff); stroke: var(--border-strong); stroke-width: 1.4; }
.net-node.is-active .net-ring { stroke: var(--primary); stroke-width: 2.2; }
.net-node.is-chief .net-ring { stroke: var(--accent); stroke-width: 2; }
.net-node.is-attention .net-ring { stroke: #b7791f; stroke-width: 2; }
.net-node.is-done .net-ring { stroke-dasharray: 3 2; }
.net-node.is-integration .net-ring { stroke-width: 2.2; }
.net-initials { font-size: 10px; font-weight: 700; fill: var(--text-2); }
.net-label { font-size: 9px; fill: var(--text-2); }
.net-tile-text { font-size: 9px; font-weight: 600; fill: var(--text); }
.net-empty { font-size: 10px; fill: var(--muted); }
.net-node.pulse .net-ring { animation: net-pulse 1.6s ease-out 1; }
@keyframes net-pulse { 0% { stroke-width: 6; stroke-opacity: 0.35; } 100% { stroke-opacity: 1; } }
.live-tag { margin-left: 6px; font-size: 10px; font-weight: 500; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { .net-node.pulse .net-ring { animation: none; } }
