/* Talqava: a black window with neon accents. The app has one accent
   (--accent, chosen under Settings); each bot glows in its own (--bot). */
:root {
  --bg: #0a0a0a;
  --top: #0a0a0a;
  --side: #0a0a0a;
  --panel: #141414;
  --field: #0a0a0a;
  --line: #262626;
  --line2: #3a3a3a;
  --text: #f2f2f2;
  --muted: #8c8c8c;
  --soft: #b8b8b8;
  --accent: #00d26a;
  --accent-glow: color-mix(in srgb, var(--accent) 45%, transparent);
  --bot: var(--text);
  --round: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line2); background: none; border-radius: 4px;
  padding: 6px 12px; min-height: 34px; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 0 14px var(--accent-glow); }
button.primary:hover { filter: brightness(1.15); box-shadow: 0 0 20px var(--accent-glow); }
button.danger { color: var(--text); border-style: dashed; }
button.plain { border: 0; background: none; color: var(--muted); padding: 4px 6px; min-height: 0; }
button.plain:hover { color: var(--text); }
button:disabled { opacity: 0.5; cursor: default; }
input, select, textarea {
  background: var(--field); border: 1px solid var(--line2); border-radius: 4px;
  padding: 8px 10px; width: 100%;
}
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow), 0 0 12px var(--accent-glow); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent-ink); }
code, pre, .mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 13px; margin: 6px 0; }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.banner { border-radius: 4px; padding: 10px 14px; margin: 10px 0; background: var(--panel); border: 1px solid var(--line2); }
.banner.error { border: 1px dashed var(--text); background: none; }
.banner.error::before { content: "✕  "; font-family: var(--mono); }
.label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}

/* ---------- the window ---------- */
#app { height: 100%; min-width: 960px; display: grid; grid-template-rows: auto 1fr; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: var(--top); border-bottom: 1px solid var(--line);
}
.brand { font: 700 15px/1 var(--mono); letter-spacing: 0.18em; color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; }
.brand .cursor { display: inline-block; width: 9px; height: 15px; margin-left: 5px; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: k-blink 1s step-end infinite; }
.repo {
  display: flex; align-items: center; gap: 6px; background: var(--field); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; font: 13px var(--mono); white-space: nowrap; height: 36px;
}
.repo select { background: none; border: 0; padding: 0; width: auto; max-width: 200px; font: inherit; cursor: pointer; }
.repo .on { color: var(--muted); }
.palette { position: relative; flex: 1; min-width: 200px; }
.palette input { height: 36px; background: var(--field); }
.palette .keys { position: absolute; right: 10px; top: 9px; color: var(--muted); font-size: 13px; pointer-events: none; }
.palette ul {
  position: absolute; left: 0; right: 0; top: 42px; z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow-l);
  max-height: 60vh; overflow-y: auto;
}
.palette li { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.palette li.on { background: var(--field); box-shadow: inset 2px 0 0 var(--accent); }
.palette li .what { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modelpick { width: auto; max-width: 280px; height: 32px; padding: 0 8px; font-size: 13px; background: var(--field); }
.ideas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px auto 14px; max-width: 620px; }
.ideas button { border-radius: 999px; font-size: 13px; }
.plain.link { text-decoration: underline; padding: 0; min-height: 0; color: var(--accent-ink); }
.spent { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.spent b { font: 500 13px var(--mono); color: var(--text); }

.body { min-height: 0; display: grid; }
.body.three { grid-template-columns: 250px 1fr 300px; }
.body.two { grid-template-columns: 250px 1fr; }
.body > * { min-height: 0; overflow-y: auto; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.logcol { background: var(--side); border-left: 1px solid var(--line); padding: 18px 16px; }
.center { padding: 24px 28px 30px; }
.body.three > .center { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 24px 24px; }
.center.flush { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.col { max-width: 820px; margin: 0 auto; }
@media (max-width: 1180px) {
  .body.three { grid-template-columns: 220px 1fr 250px; }
  .body.two { grid-template-columns: 220px 1fr; }
}

/* ---------- crew column ---------- */
.side-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 8px 8px; }
.side-head .label { margin: 0; }
.member {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; width: 100%;
  border: 0; background: none; text-align: left; min-height: 0; position: relative;
}
.member:hover { background: var(--panel); }
.member.on { background: var(--panel); outline: 1px solid var(--bot); box-shadow: 0 0 14px color-mix(in srgb, var(--bot) 25%, transparent); }
.member .who { flex: 1; min-width: 0; }
.member .who b { font-weight: 600; }
.member .type { color: var(--muted); font: 13px var(--mono); }
.member .status { display: block; font: 13px var(--mono); color: var(--muted); }
.member .status.wait { color: var(--bot-ink); }
.chip {
  flex: none; font-size: 13px; border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px;
  color: var(--muted); white-space: nowrap;
}
.chip { font-family: var(--mono); border-radius: 3px; }
.chip.bad { color: var(--text); border-style: dashed; }
.member .edit { position: absolute; right: 6px; bottom: 4px; display: none; font-size: 13px; }
.member:hover .edit, .member.on .edit { display: inline-block; }
.member:hover .chip, .member.on .chip { visibility: hidden; }
.hatch { margin-top: 8px; border: 1px dashed var(--line2); background: none; color: var(--muted); width: 100%; min-height: 40px; }
.hatch:hover { color: var(--text); }
.navlink { border: 0; background: none; color: var(--muted); padding: 6px 8px; min-height: 0; text-align: left; border-radius: 8px; }
.navlink:hover { color: var(--text); background: var(--panel); }
.navlink.on { color: var(--accent-ink); background: var(--field); text-shadow: 0 0 10px var(--accent-glow); }
.side .navlink { width: 100%; }

/* ---------- agents: department tiles, from the logo ---------- */
.keychar { display: inline-flex; flex: none; }
.keychar svg { display: block; overflow: visible; }
@keyframes k-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.25; } }
@keyframes k-march { to { stroke-dashoffset: -11.2; } }
@keyframes k-tick { from { stroke-dashoffset: 8; } to { stroke-dashoffset: 0; } }
@keyframes k-lift { from { transform: translateY(0); } to { transform: translateY(-1.5px); } }
/* Working: the cursor blinks once a second, like the wordmark's. Waiting on you: the amber frame moves. Done: the tick draws in once. */
.k-working .t-cursor { animation: k-blink 1s step-end infinite; }
.k-march { animation: k-march 1.2s linear infinite; }
.k-done .k-tick { animation: k-tick 0.6s ease-out 0.2s both; }
.k-asleep .t-symbol { opacity: 0.45; }
:is(.member, .mcard, .mfeat, .core-card, .additem):hover .keychar svg { animation: k-lift 0.18s ease-out forwards; }
/* An agent's colour as text: the bright one on dark grounds, the deeper one on light. */
[style*="--bot-l"] { --bot-ink: var(--bot); }
:root[data-theme="light"] [style*="--bot-l"] { --bot-ink: var(--bot-l); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .k-tick { stroke-dashoffset: 0; }
}

/* ---------- on the job ---------- */
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
h1, h2 { font-family: var(--round); }
.board-head h1 { margin: 0; font-size: 36px; letter-spacing: -0.03em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.qcard {
  position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px; cursor: pointer; display: grid; gap: 10px;
}
.qcard { border-top: 2px solid var(--bot); }
.qcard:hover { border-color: var(--bot-ink); box-shadow: 0 0 18px color-mix(in srgb, var(--bot) 20%, transparent); }
.qcard.waiting { border: 1px dashed var(--bot); border-top-width: 2px; }
.qcard .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.qcard .head b { font-size: 15px; }
.qcard .head { align-items: center; }
.scanline { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--line); overflow: hidden; }
.scanline span { display: block; width: 40%; height: 100%; background: var(--bot); box-shadow: 0 0 8px var(--bot); animation: k-scan 1.6s cubic-bezier(.4, 0, .2, 1) infinite; }
.qcard .now { color: var(--muted); font: 13px var(--mono); }
.qcard .now.wait { color: var(--bot-ink); }
.qcard pre, .approval pre {
  margin: 0; background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 150px; overflow: auto;
}
.caution { border-left: 2px solid var(--text); padding: 4px 0 4px 12px; font-size: 13px; color: var(--soft); }
.qcard .foot { color: var(--muted); font: 13px var(--mono); display: flex; flex-wrap: wrap; gap: 4px 10px; }

/* ---------- quest log ---------- */
.logitem {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 12px 2px; margin: 0; min-height: 0;
}
.logitem:hover { background: var(--panel); }
.logitem .head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.logitem .meta { color: var(--muted); font: 13px var(--mono); margin-top: 3px; }
.pill { font: 700 12px var(--mono); white-space: nowrap; color: var(--muted); }
.pill.loud { color: var(--text); }
.pill.solid { border: 1px solid var(--text); color: var(--text); border-radius: 999px; padding: 5px 12px; }
.pill.solid.loud { background: var(--accent); border-color: var(--accent-ink); color: var(--on-accent); }

/* ---------- a quest ---------- */
.questview { min-height: 0; display: grid; grid-template-rows: auto 1fr; }
.subhead {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.subhead h1 { margin: 0; font-size: 20px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subhead .sub { color: var(--muted); font-size: 13px; }
.subhead .titles { flex: 1; min-width: 0; }
.questcols { min-height: 0; display: grid; grid-template-columns: 240px 1fr 260px; }
.questcols > * { min-height: 0; overflow-y: auto; }
.questcols > .center.flush { overflow: hidden; }
.steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: baseline; }
.steps { font: 13px var(--mono); }
.steps .mark { flex: none; width: 14px; text-align: center; color: var(--text); }
.steps li { color: var(--soft); }
.steps .mark.now::before { content: "●"; animation: pulse 1.2s infinite; }
.steps .mark.wait::before { content: "◌"; }
@keyframes pulse { 50% { opacity: 0.3; } }
.steps code { font-size: 13px; }
.tabs { display: flex; gap: 8px; padding: 16px 20px 0; }
.tabs button { font-family: var(--mono); font-size: 13px; }
.tabs button.on { border-color: var(--accent-ink); color: var(--accent-ink); }
.tabpanel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabpanel[hidden] { display: none; }
.tabpanel.pad { overflow-y: auto; padding: 14px 20px 24px; }
.filediff { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 14px; background: var(--bg); }
.filediff .fhead { display: flex; gap: 8px; align-items: baseline; padding: 9px 12px; border-bottom: 1px solid var(--line); font: 13px var(--mono); }
.filediff .fhead .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filediff pre { margin: 0; padding: 6px 0; font-size: 13px; line-height: 1.55; overflow-x: auto; max-height: 460px; }
.filediff pre span { display: block; padding: 0 12px; white-space: pre; }
.filediff .add { background: var(--panel); color: var(--text); }
.filediff .del { color: var(--muted); text-decoration: line-through; }
.filediff .hunk { color: var(--muted); }
.plus { color: var(--text); } .minus { color: var(--muted); }
.decide { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; display: grid; gap: 12px; }
.ticks { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0; }
.ticks span { width: 5px; height: 16px; border-radius: 1px; background: var(--line); }
.ticks span.on { background: var(--accent); }
.panel-block { margin-bottom: 22px; }

/* ---------- conversations ---------- */
.convo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; overflow-y: auto; padding: 18px 20px; }
.chathead { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.chathead h1 { flex: 1; margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.chatlist { display: grid; gap: 2px; margin-top: 6px; }
.chatlist .navlink { display: flex; gap: 6px; align-items: center; }
.chatlist .navlink .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: none; animation: pulse 1.2s infinite; }
.dot.wait { background: none; border: 1px solid var(--accent); box-shadow: none; animation: none; }

.msg { margin: 0 0 16px; overflow-wrap: anywhere; }
.msg.user { background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 8px; padding: 10px 14px; margin-left: 15%; white-space: pre-wrap; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md pre, .tool pre { background: var(--bg); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.md code { background: var(--field); border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 10px; text-align: left; }
.md h1, .md h2, .md h3 { line-height: 1.25; margin: 1.1em 0 0.4em; }
.md h1 { font-size: 1.3em; } .md h2 { font-size: 1.15em; } .md h3 { font-size: 1.05em; }
.md blockquote { border-left: 3px solid var(--line2); margin: 0.6em 0; padding-left: 12px; color: var(--muted); }

details.think, details.tool { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: var(--panel); }
details > summary { cursor: pointer; padding: 7px 12px; display: flex; gap: 8px; align-items: center; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
summary .name { font-weight: 600; flex: none; }
summary .what { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 13px var(--mono); }
summary .state, .state { flex: none; font-size: 13px; color: var(--muted); }
.state.ok { color: var(--soft); } .state.bad { color: var(--text); text-decoration: underline dashed; }
details .body { padding: 0 12px 10px; }
details .body pre { margin: 6px 0; max-height: 320px; overflow: auto; white-space: pre-wrap; }
details.think summary { color: var(--muted); font-size: 13px; }
details.think .body { color: var(--muted); white-space: pre-wrap; font-size: 13.5px; }
details .label { font-size: 13px; margin: 6px 0 0; }

.approval { background: var(--panel); border: 1px dashed var(--text); border-radius: 6px; padding: 14px; margin: 10px 0; display: grid; gap: 10px; }
.approval strong { font-family: var(--mono); font-size: 13px; }
.approval strong::before { content: "◌  "; }
.working { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.compose { border-top: 1px solid var(--line); padding: 12px 20px 16px; }
.compose .col { display: flex; gap: 8px; align-items: flex-end; }
.compose textarea { min-height: 44px; max-height: 240px; resize: none; }
.empty { text-align: center; color: var(--muted); margin-top: 16vh; }
.empty h2 { color: var(--text); margin: 10px 0 6px; font-size: 22px; }

/* ---------- pages: memory, skills, schedules, settings ---------- */
.page h2 { margin: 0 0 4px; font-size: 22px; }
.page h3 { margin: 26px 0 8px; font-size: 15px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin: 8px 0; }
.card .row { justify-content: space-between; }
.card .grow { overflow-wrap: anywhere; }
.card .state.ok { color: var(--soft); } .card .state.bad { color: var(--text); }
.form { display: grid; gap: 8px; margin: 8px 0; }
.form label, .field { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.login { max-width: 320px; margin: 22vh auto 0; display: grid; gap: 10px; padding: 0 16px; }
.login .brand { margin-bottom: 8px; }

/* ---------- bot editor ---------- */
.editor { min-height: 0; display: grid; grid-template-columns: 280px 1fr; }
.editor > * { min-height: 0; overflow-y: auto; }
.portrait { text-align: center; padding: 26px 20px; border-right: 1px solid var(--line); }
.portrait h2 { margin: 10px 0 2px; font-size: 22px; }
.portrait .type { color: var(--muted); font: 13px var(--mono); }
.texture { display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 0; font: 13px var(--mono); color: var(--muted); }
.texture.on { border-color: var(--bot-ink); color: var(--text); }
.editcards { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; align-content: start; }
.editcards .card { margin: 0; padding: 16px; display: grid; gap: 10px; align-content: start; }
.editcards h3 { margin: 0; font-size: 15px; font-family: var(--sans); }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--text); font-size: 14px; }
.choice.on { border-color: var(--accent-ink); }
.power { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 14px; cursor: pointer; }
.checks { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.yes { color: var(--text); } .no { color: var(--muted); }
button.brand { color: var(--text); padding: 0; min-height: 0; }
button.brand:hover { color: var(--text); }

/* ---------- core quests and checks ---------- */
.core { margin-top: 30px; }
.core-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.core-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; min-height: 0;
}
.core-card:hover { border-color: var(--line2); }
.core-card.on { border-color: var(--accent-ink); }
.core-card .note { margin: 0; }
.core-form { margin-top: 12px; display: grid; gap: 10px; max-width: 640px; }
.checks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font: 13px var(--mono); }
.checks-list li { display: flex; gap: 10px; align-items: baseline; }
.checks-list .mark { flex: none; width: 14px; }
.checks-list pre { margin: 6px 0 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; font-size: 13px; white-space: pre-wrap; max-height: 220px; overflow: auto; color: var(--soft); }

/* Neon colour swatches (app accent in Settings, a bot's glow in its editor). */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.portrait .swatches { justify-content: center; }
.swatch { width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; background: var(--swatch); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line2); }
.swatch:hover { box-shadow: 0 0 0 1px var(--swatch), 0 0 12px var(--swatch); }
.swatch.on { box-shadow: 0 0 0 2px var(--swatch), 0 0 16px var(--swatch); }
.logitem { border-left: 2px solid var(--bot); }
.portrait .swatches { gap: 5px; }
.portrait .swatch { width: 20px; height: 20px; }

/* Spaces: the picker above the chat list, and the tabs on the Memory page. */
.sidelabel { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 2px 8px; }
.sidelabel select { margin-top: 5px; font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text); }
.spaceform { display: grid; gap: 6px; padding-bottom: 8px; }
.spacetabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; align-items: center; }
.spacetabs button[role="tab"] { border-radius: 999px; padding: 4px 12px; min-height: 30px; color: var(--muted); }
.spacetabs button.on { border-color: var(--accent-ink); color: var(--accent-ink); }
.spacetabs .count { margin-left: 7px; font: 13px var(--mono); opacity: 0.75; }
.spaceadd { margin: 0 0 10px; flex-wrap: nowrap; }
.spaceadd input { max-width: 320px; }

/* What the agent saved to memory, shown in the conversation. */
.memnote { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin: 8px 0; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--accent) 6%, transparent); font-size: 13px; }
.memnote .mmark { color: var(--accent-ink); font-size: 13px; line-height: 20px; }
.memnote .mlabel { display: block; font: 700 11px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.memnote .mtext, .card .mtext { white-space: pre-wrap; overflow-wrap: anywhere; }
.memnote .mactions { display: flex; gap: 2px; }
.memnote textarea { margin-top: 4px; }
.memnote.gone .mtext { text-decoration: line-through; color: var(--muted); }
.memnote.gone .mlabel, .memnote.gone .mmark { color: var(--muted); }

/* Hidden means hidden, whatever layout the element has. */
[hidden] { display: none !important; }

/* The chat list: pinned chats first, with pin and delete on each row. */
.projects { padding-bottom: 6px; }
.projects .sidelabel { padding-bottom: 6px; }
.newproject { width: 100%; min-height: 30px; padding: 4px 10px; font-size: 13px; color: var(--muted); border-style: dashed; }
.newproject:hover { color: var(--accent-ink); }
.spaceform .note { margin: 0; }
.listlabel { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 4px; }
.chatrow { position: relative; display: flex; align-items: center; border-radius: 8px; }
.chatrow .navlink { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: center; }
.chatrow .navlink .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow:hover .navlink, .chatrow:focus-within .navlink { padding-right: 52px; background: var(--panel); }

/* The marketplace: browse free bots and read a bot's instructions in full. */
.market { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding-bottom: 30px; }
.market h1 { margin: 6px 0 0; font-size: 36px; font-weight: 600; letter-spacing: -0.02em; }
.market h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.market .lead { margin: 0; color: var(--soft); font-size: 16px; max-width: 660px; }
.market input[type="search"] { height: 46px; font-size: 15px; background: var(--panel); }
.market .by { color: var(--muted); font-size: 13px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mpill { border-radius: 999px; padding: 6px 16px; min-height: 36px; color: var(--soft); border: 1px solid var(--line2); display: inline-flex; align-items: center; }
.mpill.on { background: var(--accent); border-color: var(--accent-ink); color: var(--on-accent); font-weight: 700; }
.msections { display: flex; flex-direction: column; gap: 28px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mcard { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.mcard:hover, .mcard:focus-visible { border-color: var(--bot-ink); box-shadow: 0 0 18px color-mix(in srgb, var(--bot) 18%, transparent); }
.mhead { display: flex; gap: 12px; align-items: center; }
.mhead b { font-weight: 600; font-size: 15px; }
.mdesc { margin: 0; flex: 1; color: var(--soft); font-size: 13px; }
.mfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.madd { min-width: 70px; font-weight: 600; }
.mfeatured { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mfeat { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.mfeat b { font-size: 16px; font-weight: 600; color: var(--bot-ink); }
.mfeat:hover { border-color: var(--bot-ink); box-shadow: 0 0 18px color-mix(in srgb, var(--bot) 18%, transparent); }
.back { align-self: flex-start; padding: 6px 0; }
.mtop { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.mtop .grow { flex: 999 1 460px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.mtop h1 { margin: 0; }
button.big { min-height: 46px; padding: 0 22px; font-size: 15px; }
.facts { flex: 1 1 300px; max-width: 400px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 4px 18px; }
.fact { display: flex; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.fact:last-child { border-bottom: 0; }
.fact b { flex: 0 0 104px; font-weight: 500; color: var(--muted); }
.minstr { border-top: 1px solid var(--line); padding-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.minstr h2 { margin: 0; }
.instructions { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 20px 24px; font-size: 15px; line-height: 1.6; max-width: 820px; }
.instructions p { margin: 0 0 14px; }
.instructions p:last-child { margin-bottom: 0; }
.willrow { display: flex; flex-wrap: wrap; gap: 12px; max-width: 820px; }
.willbox { flex: 1 1 260px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.willbox.will .label { color: var(--accent-ink); }
.willbox.wont { border-style: dashed; border-color: var(--line2); }
.willbox ul { margin: 0; padding-left: 18px; color: var(--soft); }

/* The inbox and the team page. */
.grouplabel { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 2px; }
.inbox, .team { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding-bottom: 30px; }
.team { max-width: 1160px; }
.inbox h1, .team h1 { margin: 6px 0 4px; font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.inbox .lead, .team .lead { margin: 0; color: var(--soft); font-size: 15px; }
.inbox section { display: flex; flex-direction: column; gap: 10px; }
.label.loud { color: var(--accent-ink); }
.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 150px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--panel); }
.stat .label { margin: 0 0 4px; display: block; }
.stat b { font: 700 20px var(--mono); }
.stat b.loud { color: var(--accent-ink); }
.track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.track span { display: block; height: 100%; }
.you { align-self: center; display: flex; gap: 14px; align-items: center; padding: 12px 22px; border: 1.5px solid var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.youmark { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font: 700 12px var(--mono); }
.depts { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.dept { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.dept h2 { margin: 0; font-size: 16px; font-weight: 600; }
.slot { border: 1px dashed var(--line2); color: var(--muted); min-height: 44px; }
.slot:hover { color: var(--accent-ink); }

/* The organization: the org chart, a member's role, and reports that come back into a conversation. */
.orgpick { width: auto; max-width: 260px; }
.tabs.flat { padding: 0; }
.outside { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.lookrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.look { padding: 3px; min-height: 0; border-color: var(--line); }
.look.on { border-color: var(--bot-ink); box-shadow: 0 0 10px color-mix(in srgb, var(--bot) 30%, transparent); }
.report { margin: 0 0 16px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--bot) 40%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--bot) 5%, transparent); }
.report .rhead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.report .rhead b { font-weight: 600; color: var(--bot-ink); }
.chathead .keychar { margin-right: -2px; }
.chatrow .keychar { flex: none; }
.mgrid.wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.tcard { cursor: default; }
.tbots { display: flex; flex-wrap: wrap; gap: 4px; }
.tbots button { padding: 2px; }

/* =====================================================================
   The look, second pass: one layout, one scale, and a calmer accent.
   A rail on the left carries all navigation; surfaces are layered in
   three quiet steps; the accent marks what is selected or primary and
   glows only where a bot is. Everything below refines the rules above.
   ===================================================================== */
:root {
  /* The official Talqava colours (see the Talqava Brand guide). */
  --bg: #0a0a0a;
  --top: #0a0a0a;
  --side: #0d0d0d;
  --panel: #141414;
  --raised: #1b1c1b;
  --field: #0f0f0f;
  --line: #262626;
  --line2: #333433;
  --text: #f2f2f2;
  --soft: #b8b8b8;
  --muted: #8c8c8c;
  --accent: #00d26a;
  --accent-glow: color-mix(in srgb, var(--accent) 28%, transparent);
  --r-s: 6px;
  --r-m: 8px;
  --r-l: 12px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --round: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}
body { font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; letter-spacing: -0.003em; }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
h1, h2, h3 { font-family: var(--round); }

/* ---------- layout: rail, top bar, page ---------- */
#app { grid-template-columns: 224px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.rail { background: var(--side); border-right: 1px solid var(--line); padding: 14px 10px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.rail .brand { align-self: flex-start; padding: 6px 10px 16px; font: 700 14px/1 var(--mono); letter-spacing: 0.2em; }
.brand .cursor { width: 8px; height: 14px; box-shadow: none; }
.raillabel { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.railgroup { display: flex; flex-direction: column; gap: 2px; }
.railend { margin-top: auto; padding-top: 12px; }
.railitem { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-m); background: none; color: var(--soft); text-align: left; font-weight: 500; }
.railitem:hover { background: var(--panel); color: var(--text); border: 0; }
.railitem.on { background: var(--raised); color: var(--text); }
.railitem.on .ico { color: var(--accent-ink); }
.railitem .ico { display: inline-flex; color: var(--muted); flex: none; }
.railitem .count { font: 600 11px var(--mono); background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 1px 7px; }
.top { min-height: 52px; padding: 8px 20px; gap: 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.palette { max-width: 720px; margin: 0 auto; }
.palette input { height: 34px; background: var(--panel); border-color: var(--line); }
.palette ul { top: 40px; background: var(--raised); border-color: var(--line2); border-radius: var(--r-l); box-shadow: var(--shadow-l); }
.palette li.on { background: var(--panel); box-shadow: none; }
.repo { height: 34px; background: var(--panel); border-color: var(--line); border-radius: var(--r-m); font: 13px var(--sans); padding: 0 10px; gap: 8px; }
.repo .repolabel { color: var(--muted); font-size: 13px; }
.repo select { font: 13px var(--sans); }
.spent { font-size: 13px; }
.body.two { grid-template-columns: 264px minmax(0, 1fr); }
.body.three { grid-template-columns: 272px minmax(0, 1fr) 300px; }
.side { background: var(--bg); border-right: 1px solid var(--line); padding: 14px 12px; gap: 3px; }
.logcol { background: var(--bg); border-left: 1px solid var(--line); }
.center { padding: 28px 36px 40px; }

/* ---------- type ---------- */
.label, .raillabel, .sidelabel, .grouplabel, .listlabel { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.label.loud { color: var(--accent-ink); }
.note { color: var(--muted); font-size: 13px; }
.lead, .market .lead, .inbox .lead, .team .lead { color: var(--soft); font-size: 14.5px; max-width: 680px; }
.page h1, .market h1, .inbox h1, .team h1, .board-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 650; letter-spacing: -0.022em; }
.page { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.page h3 { margin: 22px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.market h2, .dept h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.inbox, .team, .market { gap: 22px; }

/* ---------- controls ---------- */
button { border: 1px solid var(--line2); border-radius: var(--r-m); background: var(--panel); min-height: 34px; padding: 0 12px; font-weight: 500; transition: background 0.12s, border-color 0.12s, color 0.12s; }
button:hover { border-color: var(--line2); background: var(--raised); }
button.primary { background: var(--accent); border-color: var(--accent-ink); color: var(--on-accent); font-weight: 600; box-shadow: none; }
button.primary:hover { filter: brightness(1.08); box-shadow: none; background: var(--accent); border-color: var(--accent-ink); }
button.danger { border-style: solid; color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 35%, var(--line2)); }
button.danger:hover { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 55%, var(--line2)); }
button.plain { background: none; border: 0; color: var(--muted); }
button.plain:hover { background: none; color: var(--text); }
button.plain.danger { color: var(--bad-ink); }
button.big { min-height: 40px; padding: 0 18px; font-size: 14px; }
input, select, textarea { background: var(--field); border: 1px solid var(--line2); border-radius: var(--r-m); padding: 7px 11px; }
select { min-height: 34px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a, .plain.link { color: var(--accent-ink); text-underline-offset: 2px; }
.navlink { border-radius: var(--r-m); padding: 7px 10px; background: none; border: 0; min-height: 0; font-weight: 500; }
.navlink:hover { background: var(--panel); border: 0; }
.navlink.on { background: var(--raised); color: var(--text); text-shadow: none; }
.hatch, .slot, .newproject { border: 1px solid var(--line); border-style: solid; background: none; color: var(--muted); }
.hatch:hover, .slot:hover, .newproject:hover { background: var(--panel); color: var(--text); border-color: var(--line2); }

/* ---------- surfaces ---------- */
.card, .mcard, .mfeat, .stat, .dept, .facts, .instructions, .willbox, .qcard, .core-card, .report, .memnote, .banner { border-radius: var(--r-l); }
.card, .mcard, .mfeat, .stat, .facts, .instructions, .qcard, .core-card { background: var(--panel); border: 1px solid var(--line); }
.dept { background: none; }
.mcard:hover, .mcard:focus-visible, .mfeat:hover, .qcard:hover { box-shadow: none; border-color: color-mix(in srgb, var(--bot) 55%, var(--line2)); background: var(--raised); }
.qcard { border-top: 1px solid var(--line); box-shadow: inset 0 2px 0 var(--bot); }
.qcard.waiting { border: 1px solid color-mix(in srgb, var(--bot) 50%, var(--line2)); }
.member { border-radius: var(--r-m); }
.member.on { background: var(--raised); outline: 0; box-shadow: inset 2px 0 0 var(--bot); }
.stat { padding: 14px 16px; }
.stat b { font: 600 20px var(--sans); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.willbox.wont { border-style: solid; }
.banner { background: var(--panel); border-color: var(--line2); }
.banner.error { border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line2)); background: color-mix(in srgb, var(--bad) 7%, var(--panel)); }
.mpill { min-height: 32px; padding: 0 14px; background: none; font-weight: 500; }
.mpill.on { color: var(--on-accent); font-weight: 600; }
.spacetabs button[role="tab"] { background: none; }
.tabs button { font-family: var(--sans); font-size: 13px; background: none; }
.tabs button.on, .spacetabs button.on { background: var(--raised); border-color: var(--line2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.pill { font-family: var(--sans); font-weight: 600; }
.track { height: 6px; }
.you { border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line2)); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }

/* ---------- conversations ---------- */
.chathead { padding: 10px 24px; min-height: 52px; }
.chathead h1 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.msg.user { background: var(--raised); border: 1px solid var(--line); border-radius: 14px 14px 4px 14px; padding: 10px 14px; }
.compose { border-top: 1px solid var(--line); }
.compose textarea { border-radius: var(--r-l); background: var(--panel); padding: 11px 14px; }
.empty h2 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.ideas button { border-radius: 999px; background: none; }
.chatrow:hover .navlink, .chatrow:focus-within .navlink { background: var(--panel); }
.memnote { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.memnote .mlabel { font-family: var(--sans); font-weight: 600; }
details.tool { border-radius: var(--r-m); }

.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--swatch); }
.swatch:hover { box-shadow: 0 0 0 1px var(--swatch); }
.look.on { box-shadow: none; background: var(--raised); }

/* Side columns scroll instead of squeezing their rows. */
.side > * { flex-shrink: 0; }
.member { gap: 10px; padding: 7px 8px; align-items: center; }
.member .who { display: flex; flex-direction: column; line-height: 1.25; }
.member .who b { font-weight: 600; font-size: 13.5px; }
.member .type { font: 13px var(--sans); color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .status { font: 13px var(--mono); }
.member .edit { bottom: auto; top: 50%; transform: translateY(-50%); right: 8px; }
.side-head { padding: 2px 8px 6px; align-items: center; }

/* =====================================================================
   The look, third pass: a business product. Agents are shown as role
   badges (a tile with initials) instead of characters; nothing bounces
   or blinks; the wordmark is steady; numbers and labels are set in the
   interface face. The black and neon-green theme is unchanged.
   ===================================================================== */
@keyframes k-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes k-spin { to { transform: rotate(360deg); } }
.k-pulse { animation: k-pulse 1.4s ease-in-out infinite; }
.k-ring { transform-box: fill-box; transform-origin: center; animation: k-spin 4s linear infinite; }
.k-asleep svg { opacity: 0.45; }

/* The wordmark: steady, with a small accent mark instead of a blinking cursor. */
.rail .brand { font: 700 13px/1 var(--sans); letter-spacing: 0.24em; padding: 8px 10px 18px; gap: 9px; }
.brand .cursor { order: -1; width: 9px; height: 9px; margin: 0; border-radius: 2px; background: var(--accent); animation: none; box-shadow: none; }
.login .brand { font: 700 14px/1 var(--sans); letter-spacing: 0.24em; }

/* Type: one face for the interface; the code face only where there is code. */
.page h1, .market h1, .inbox h1, .team h1, .board-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.empty h2 { font-size: 22px; font-weight: 600; }
.member .status, .qcard .now, .qcard .foot, .logitem .meta, .chip, .pill, .tabs button, .steps, .checks-list, .approval strong, .portrait .type, .texture, .spacetabs .count, .memnote .mlabel { font-family: var(--sans); }
.steps code, .checks-list pre, .mono { font-family: var(--mono); }
.chip { border-radius: 999px; padding: 1px 8px; font-size: 13px; font-weight: 500; }
.pill { font-size: 13px; font-weight: 500; }
.pill.loud { color: var(--text); }
.label, .raillabel, .sidelabel, .grouplabel, .listlabel { letter-spacing: 0.07em; }

/* Surfaces: flat panels with a hairline, no dotted backdrop and no coloured glow. */
.body.three > .center { background-image: none; }
.card, .mcard, .mfeat, .stat, .facts, .instructions, .qcard, .core-card { box-shadow: 0 1px 0 var(--hi) inset; }
.qcard { box-shadow: inset 0 1px 0 var(--hi); border-left: 2px solid color-mix(in srgb, var(--bot) 70%, var(--line2)); }
.scanline span { box-shadow: none; }
.dot { box-shadow: none; }
.logitem { border-left: 0; padding-left: 4px; }
.mfeat b { color: var(--text); font-size: 14.5px; text-align: center; }
.mhead b { letter-spacing: -0.005em; }
.youmark { border-radius: 11px; font: 600 12px var(--sans); letter-spacing: 0.02em; }
.stat { padding: 16px 18px; }
.stat b { font-size: 22px; font-weight: 600; }
.report .rhead b { color: var(--text); }
.portrait .type { font-size: 13px; }
.portrait h2 { font-size: 18px; font-weight: 600; margin-top: 14px; }
.member .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .who { min-width: 0; }
button.primary { letter-spacing: 0.005em; }
.mono.small { font-family: var(--sans); font-size: 13px; }

/* Organization structures, drag and drop on the chart, teams and shared memory. */
.structures h2 { margin: 0; font-size: 16px; font-weight: 600; }
.structures { padding: 20px 22px 22px; }
.structures > .note { margin: 4px 0 0; max-width: 820px; }
.chip.on { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 50%, var(--line2)); }
.dept.drop { border-color: var(--accent-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.dept .label { margin: 4px 0 0; }
.orgmem { display: flex; flex-direction: column; gap: 14px; }
.orgmem .note { margin: 0; max-width: 760px; }
.memgroup { display: flex; flex-direction: column; gap: 6px; }
.memgroup .label { margin: 6px 0 2px; }
.memrow { display: flex; gap: 12px; align-items: baseline; margin: 0; }
.memrow .mtext { white-space: pre-wrap; overflow-wrap: anywhere; }
.orgmem form select { width: auto; max-width: 300px; }

/* Kind of business, recommendations, and what each role answers for. */
.govern { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); }
.govern .label { margin: 0 0 4px; }
.govern ul { margin: 0; padding-left: 16px; color: var(--soft); font-size: 13px; line-height: 1.5; }

/* The work page: assign, what needs you, what is under way, and each department's week. */
.board-head { display: block; margin-bottom: 14px; }
.board-head .lead { margin: 2px 0 0; }
.body.three > .center > * + * { margin-top: 18px; }
.assignbox { padding: 16px; margin: 0; border-color: var(--line2); }
.assignrow { display: flex; gap: 14px; align-items: flex-start; }
.assignrow select { width: auto; max-width: 300px; font-weight: 600; }
.assignrow textarea { margin-top: 10px; background: var(--bg); min-height: 58px; resize: vertical; }
.assignfoot { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; margin-top: 10px; padding-left: 54px; }
.ideachips { display: flex; flex-wrap: wrap; gap: 6px; }
.ideachip { min-height: 28px; padding: 3px 11px; border-radius: 999px; background: none; border: 1px solid var(--line2); color: var(--soft); font-size: 13px; font-weight: 400; text-align: left; }
.ideachip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, var(--line2)); background: none; }
.assignfoot .primary { flex: none; min-height: 36px; padding: 0 18px; }
.statnote { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.worksec h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.worksec > .row { margin-bottom: 10px; }
.flow, .needlist { display: flex; flex-direction: column; gap: 6px; }
.needlist { margin-top: 8px; }
.flowrow, .needrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 9px 14px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); margin-left: calc(var(--depth, 0) * 30px); width: calc(100% - var(--depth, 0) * 30px); position: relative; }
.flowrow:hover, .needrow:hover { background: var(--raised); border-color: color-mix(in srgb, var(--bot, var(--accent)) 50%, var(--line2)); }
.flowrow.wait { border-color: color-mix(in srgb, var(--accent) 50%, var(--line2)); }
.flowelbow { position: absolute; left: -18px; top: -7px; width: 12px; height: 34px; border-left: 1px solid var(--line2); border-bottom: 1px solid var(--line2); border-bottom-left-radius: 6px; }
.flowmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.flowmain b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flowmain b .chip { margin-right: 7px; vertical-align: 1px; }
.flowsub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flowmeta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.flowmeta .track { width: 90px; }
.card.quiet { margin: 0; padding: 14px 16px; }
.insight { margin: 0 0 10px; color: var(--soft); }
.depttable { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--panel); }
.dhead, .drow { display: grid; grid-template-columns: minmax(140px, 1.6fr) repeat(6, minmax(58px, 0.7fr)) minmax(90px, 1fr); gap: 10px; align-items: center; padding: 9px 16px; font-size: 13px; font-variant-numeric: tabular-nums; }
.dhead { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--bg); }
.drow + .drow { border-top: 1px solid var(--line); }
.drow b { font-weight: 600; }
.drow span { color: var(--soft); }
.drow .loud { color: var(--accent-ink); font-weight: 600; }
.drow .warn { color: var(--warn); font-weight: 600; }
.core.worksec { margin-top: 18px; }
@media (max-width: 1320px) { .dhead span:nth-child(7), .drow span:nth-child(7) { display: none; } .dhead, .drow { grid-template-columns: minmax(130px, 1.6fr) repeat(5, minmax(54px, 0.7fr)) minmax(80px, 1fr); } }
.body.three .stats .stat { flex: 1 1 128px; padding: 13px 14px; }
.body.three .stats .stat b { font-size: 20px; }

/* Integrations: a catalogue by category, and each integration's own page. */
.integrations { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding-bottom: 30px; }
.integrations h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.integrations h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.integrations .lead { margin: 0; }
.icat[hidden] { display: none; }
.isearch { width: 100%; max-width: 520px; min-height: 42px; padding: 0 14px; border-radius: var(--r-m, 10px); border: 1px solid var(--line2); background: var(--panel); color: inherit; font: inherit; }
.pills.small .mpill { min-height: 28px; padding: 0 12px; font-size: 13px; }
.imark { display: inline-flex; flex: none; }
.ihero { display: flex; gap: 18px; align-items: flex-start; }
.ihero .imark svg { width: 56px; height: 56px; }
.ihero h1 { margin: 0; }
.isetup { padding: 16px 18px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.isetup h2 { margin: 0; }
.istep { display: flex; gap: 12px; align-items: flex-start; }
.istep .note { margin: 2px 0 0; }
.istep b { font-weight: 600; }
.istepmark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--on-accent); margin-top: 1px; }
.istep.done .istepmark { background: var(--accent); border-color: var(--accent-ink); color: var(--on-accent); font-weight: 700; }
.isec { display: flex; flex-direction: column; gap: 10px; }
.isec h2 { margin: 0; }
.isec .card { margin: 0; }
.irepo { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.irepo.gone { border-style: dashed; }
.ifacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 18px; }
.ifacts > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.ifacts .label { margin: 0; }
.ifacts span:last-child { color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ifacts .warn { color: var(--warn); }
.iadd { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.iadd .form { margin: 0; align-content: start; }
.isteps { margin: 8px 0 12px; padding-left: 20px; color: var(--soft); line-height: 1.7; }
.chip.on { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 50%, var(--line2)); }
.side .sidelabel .orgpick { width: 100%; max-width: none; }

/* Plus and minus on the chart: add an agent beneath, or take one (or its team) off. */
.addlist { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.addlist .label { margin: 8px 0 2px; }

/* The team builder: a tray of things to drag in, and a board of teams. */
.dragging-on .dept { transition: border-color 0.12s, background 0.12s; }
.dragging-on .dept:not(.drop) { border-style: dashed; }
.istep.action .istepmark { border-color: var(--warn); color: var(--warn); font-weight: 700; }
.istep.skipped .istepmark { color: var(--muted); }
.pickrows { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.pickrow { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); }
.pickrow .primary, .pickrow button { flex: none; }
.depts { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.note.recipe { margin: 0; }

/* Signing in to GitHub: the code to type, and choosing repositories. */
.signin { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line2)); border-radius: var(--r-m); background: color-mix(in srgb, var(--accent) 4%, var(--bg)); }
.signin .label { margin: 0; }
.signcode { font: 700 30px/1.1 var(--mono); letter-spacing: 0.12em; color: var(--text); user-select: all; }
.tokenflow { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.tokenflow .label { margin: 0; }
.tokenflow .row input { flex: 1; min-width: 220px; }
.setup-once { margin: 0; padding: 0; }
.setup-once > summary { padding: 12px 16px; justify-content: space-between; }
.setup-once .body { padding: 0 16px 14px; }
.setup-once .row input { flex: 1; min-width: 200px; max-width: 320px; }
.pickrow.pickable { cursor: pointer; }
.pickrow.pickable:hover { border-color: var(--line2); background: var(--raised); }
.pickrow input[type="checkbox"] { flex: none; width: 16px; height: 16px; }

/* The organization page, made simple: a short set-up, one board, and the rest under More. */
.orghead h1 { margin: 0; }
.orghead .lead { margin: 2px 0 0; }
.wiznum { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.notlisted { border-top: 1px solid var(--line); margin: 6px 0 0; border-radius: 0; background: none; }
.notlisted > summary { padding: 10px 0 4px; }
.notlisted .body { padding: 0 0 4px; }
.notlisted .row input { flex: 1; min-width: 200px; max-width: 300px; }
.removeint { display: flex; gap: 16px; align-items: center; margin: 0; border-color: color-mix(in srgb, var(--bad) 25%, var(--line)); }
.removeint .note { margin: 2px 0 0; }

/* Teams as plain lists of people, for someone who is not technical. */
.people { display: flex; flex-direction: column; gap: 6px; }
.people.two { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.person { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 12px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-m); cursor: pointer; }
.person:hover, .person.on { background: var(--raised); border-color: color-mix(in srgb, var(--bot) 55%, var(--line2)); }
.person.drop { border-color: var(--accent-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.person.dragging { opacity: 0.45; }
.person .flowmain b { font-size: 14px; }
.viewswitch { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r-m); overflow: hidden; flex: none; }
.viewswitch button { border: 0; border-radius: 0; background: none; min-height: 30px; padding: 0 14px; color: var(--muted); font-size: 13px; }
.viewswitch button.on { background: var(--raised); color: var(--text); }
.personcard h2 { margin: 0; font-size: 18px; }
.personcard .note { margin: 2px 0 0; }
.onthis { margin: 0; padding: 0; }
.onthis > summary { padding: 12px 16px; justify-content: space-between; }
.onthis .body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.onthis .note { margin: 0; }

/* Agents are department tiles: no glow, no idle movement. */
.person .keychar, .flowrow .keychar { flex: none; }
.form label.pickrow, label.pickrow.pickable { display: flex; flex-direction: row; align-items: center; gap: 12px; color: var(--text); font-size: 14px; }
.copybox { display: flex; flex-direction: column; gap: 6px; }
.copybox pre { margin: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-m); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.copybox button { min-height: 28px; }
.toollist { margin: 0; padding-left: 18px; color: var(--soft); font-size: 13px; line-height: 1.7; }

/* The library: a place to drop documents, and who may use each. */
.library { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; padding-bottom: 30px; }
.library h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.library h2 { margin: 0; font-size: 15px; font-weight: 600; }
.library .lead { margin: 0; }
.doctype { flex: none; width: 42px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font: 700 10px var(--sans); letter-spacing: 0.04em; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.accessgrid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding-left: 26px; }
.accessgrid .label { margin: 0 0 4px; }
.agentpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 12px; max-height: 190px; overflow-y: auto; }
.trysearch { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.trysearch .row input { flex: 1; min-width: 220px; }
.trysearch .row select { width: auto; max-width: 260px; }
.hits { display: flex; flex-direction: column; gap: 8px; }
.hit { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); }
.hit .label { margin: 0 0 4px; }
.hit p { margin: 0; color: var(--soft); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The repository for a task, in the assign box. */
.assignmeta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; padding-left: 54px; }
.repoline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.repoline select { width: auto; max-width: 260px; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text); }
.assignmeta .note { margin: 0; }

/* Updates from the team: one message per task, with what the agent said. */
.updates { display: flex; flex-direction: column; gap: 8px; }
.update { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); cursor: pointer; }
.update:hover { background: var(--raised); border-color: color-mix(in srgb, var(--bot) 50%, var(--line2)); }
.update.unread { border-left: 3px solid var(--accent); }
.update.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.uhead { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.uhead b { font-weight: 600; font-size: 14px; }
.utime { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.utitle { color: var(--soft); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unow { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--text); font-size: 13px; }
.uparts { margin-top: 6px; color: var(--muted); font-size: 13px; }
.uwords { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-m); background: var(--bg); border: 1px solid var(--line); color: var(--soft); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: hidden; }
.uwords.short { max-height: 96px; }
.uwords.muted { color: var(--muted); }
.flowsaid { color: var(--muted); font-size: 13px; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot.new { background: var(--accent); animation: none; box-shadow: none; }
.inbox .update + .update { margin-top: 0; }

/* The receipt for a task: totals, cost by agent, what was not done, every action. */
.receipt { max-width: 900px; display: flex; flex-direction: column; gap: 10px; }
.receipt h3 { margin: 18px 0 2px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rhead { display: flex; gap: 10px; align-items: flex-start; }
.rhead h2 { margin: 2px 0; font-size: 18px; overflow-wrap: anywhere; }
.rtotals { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.rtotals > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); }
.rtotals span { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rtotals b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rtotals i { font-style: normal; font-size: 13px; color: var(--muted); }
.rtotals i.bad, .racts li.bad .rmark, .rwhy, .rnotrow em { color: var(--bad-ink); }
.ragents, .rnot { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); }
.ragent, .rnotrow { display: flex; gap: 12px; align-items: center; padding: 10px 14px; }
.ragent + .ragent, .rnotrow + .rnotrow { border-top: 1px solid var(--line); }
.rname { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rname b { font-weight: 600; font-size: 14px; }
.rname span, .rcost span { font-size: 13px; color: var(--muted); }
.rbar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rbar i { display: block; height: 100%; background: var(--accent); }
.rcost { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.rnotrow { align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.rnotrow span { color: var(--soft); min-width: 200px; }
.rnotrow em { font-style: normal; flex-basis: 100%; overflow-wrap: anywhere; }
.rline { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); }
.rline.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.rline summary { display: flex; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; }
.rline summary::-webkit-details-marker { display: none; }
.rline summary:hover { background: var(--raised); }
.rline .grow, .ragent .grow { min-width: 0; }
.rtitle { font-size: 13px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbody { padding: 4px 14px 14px 48px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.rwhy { font-size: 13px; overflow-wrap: anywhere; }
.racts { margin: 0; padding: 0; list-style: none; width: 100%; counter-reset: act; }
.racts li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.racts li b { font-weight: 600; flex: none; }
.racts li .grow { color: var(--soft); min-width: 0; overflow-wrap: anywhere; }
.racts li em { flex-basis: 100%; font-style: normal; font-size: 13px; color: var(--bad-ink); padding-left: 74px; overflow-wrap: anywhere; }
.rmark { flex: none; width: 64px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.rsaid { width: 100%; padding: 10px 12px; border-radius: var(--r-m); background: var(--bg); border: 1px solid var(--line); color: var(--soft); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.rsaid .label { display: block; margin-bottom: 4px; }
.ufoot { margin-top: 8px; }

/* OpenRouter: choosing a model, with what it costs. */
.ormodels { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); }
.ormodel { display: flex; gap: 14px; align-items: center; padding: 12px 16px; }
.ormodel + .ormodel { border-top: 1px solid var(--line); }
.ormodel.on { box-shadow: inset 3px 0 0 var(--accent); }
.ormodel .grow { min-width: 0; }
.ormodel .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ormodel .row.tight { gap: 8px; flex-wrap: wrap; }
.orprice { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; font-variant-numeric: tabular-nums; }
.orprice b { font-weight: 600; font-size: 13px; }
.orprice span { font-size: 13px; color: var(--muted); }
.isec > .row > input[type=search] { flex: 1; min-width: 200px; }
.isec > .row > select { width: auto; }
.willgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
@media (max-width: 640px) { .ormodel { flex-wrap: wrap; } .orprice { align-items: flex-start; text-align: left; } }
.istep.num .istepmark { color: var(--soft); font-weight: 600; }

/* Before a task starts: what it needs that is missing. */
dialog.needs { max-width: 520px; width: calc(100% - 32px); padding: 22px 24px; border: 1px solid var(--line2); border-radius: var(--r-l); background: var(--panel); color: var(--text); }
dialog.needs::backdrop { background: var(--scrim); }
dialog.needs h2 { margin: 4px 0 6px; font-size: 18px; }
dialog.needs .needrow { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
dialog.needs .needrow p { margin: 0; color: var(--soft); line-height: 1.5; }
dialog.needs .row.wrap { flex-wrap: wrap; }
dialog.needs .row.end { justify-content: flex-end; margin-top: 8px; }

/* The Talqava logo: mark, wordmark and the blinking cursor, sized by brandLogo(). */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); line-height: 0; }
.logo svg { display: block; flex: none; }
.brand .logo .cursor, .logo .cursor { order: 0; display: inline-block; width: 5px; height: 12px; margin: 0 0 0 -4px; border-radius: 0; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); animation: k-blink 1s step-end infinite; }
.rail .brand { padding: 6px 8px 18px; letter-spacing: 0; font: inherit; }
.rail .brand:hover .logo { color: var(--text); }
.login .brand { margin-bottom: 18px; letter-spacing: 0; font: inherit; }
.login .logo { gap: 16px; }
.login .brand .logo .cursor { width: 8px; height: 18px; margin-left: -8px; }
@media (prefers-reduced-motion: reduce) { .logo .cursor { animation: none; } }

/* The library as a file manager: path, toolbar, the list of folders and files, and a preview beside it. */
.center.wide { max-width: none; }
.library.files { max-width: 1240px; }
.ftoolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ftoolbar .findbox { width: 240px; }
.ftoolbar select { width: auto; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
.crumbs .crumb { background: none; border: 1px solid transparent; padding: 6px 8px; font-size: 15px; font-weight: 600; color: var(--soft); border-radius: var(--r-m); }
.crumbs .crumb:hover { color: var(--text); background: var(--raised); }
.crumbs .crumb.here { color: var(--text); }
.crumbs .sep { color: var(--muted); }
.fstatus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--r-l); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.selbar b { margin-right: 6px; }
.fmain { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.fmain.withpreview { grid-template-columns: minmax(0, 1fr) 380px; }
.flistwrap { border-radius: var(--r-l); min-height: 220px; }
.flistwrap.dropover { outline: 2px dashed var(--accent); outline-offset: 4px; }
.flist { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); overflow: hidden; }
.frow { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr) 170px 76px 84px 210px; gap: 12px; align-items: center; padding: 8px 14px; min-height: 52px; border-top: 1px solid var(--line); cursor: default; }
.frow:first-child { border-top: 0; }
.frow.fheadrow { min-height: 36px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
.frow:not(.fheadrow):hover { background: var(--raised); }
.frow.folder, .frow.uprow, .frow:not(.fheadrow) { cursor: pointer; }
.frow.open { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); box-shadow: inset 3px 0 0 var(--accent); }
.frow.sel { background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.frow.dropover { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); box-shadow: inset 0 0 0 2px var(--accent); }
.frow.dragging { opacity: 0.45; }
.frow .pick { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-ink); }
.libicon { display: inline-flex; align-items: center; justify-content: center; color: var(--soft); }
.ficon { color: var(--accent-ink); }
.frow.uprow .ficon { color: var(--muted); }
.attachzone { border: 1px dashed var(--line); border-radius: 8px; padding: 8px; display: grid; gap: 8px; }
.attachzone.over { border-color: var(--accent); background: var(--bg); }
.attached { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; align-items: center; overflow-wrap: anywhere; }
.attached > .grow { grid-column: 2; }
.attached > .row { grid-column: 1 / -1; gap: 10px; }
.attachbig { grid-column: 1 / -1; width: 100%; max-height: 420px; object-fit: contain; border-radius: 6px; }
.attachbig[hidden] { display: none; }
.fthumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); }
.fkind { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; font: 700 9.5px/1 var(--mono); letter-spacing: 0.04em; color: var(--kind, var(--muted)); background: color-mix(in srgb, var(--kind, var(--muted)) 13%, var(--bg)); border: 1px solid color-mix(in srgb, var(--kind, var(--muted)) 30%, var(--line)); }
.fname { display: flex; flex-direction: column; min-width: 0; }
.fname b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize, .fdate { font: 13px var(--mono); color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.renamebox { height: 32px; font-size: 14px; }
.rowacts { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity 0.12s; }
.frow:hover .rowacts, .frow:focus-within .rowacts, .rowacts.show { opacity: 1; }
.fempty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px; border-top: 1px solid var(--line); text-align: center; }
.accesschip { display: inline-flex; align-items: center; gap: 6px; max-width: 160px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--bg); border: 1px solid var(--line); color: var(--soft); justify-self: start; }
.accesschip:hover { border-color: var(--line2); color: var(--text); }
.accesschip.all { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.accesschip.private { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, var(--bg)); }
.accesschip .inherit { color: var(--muted); }
.preview { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); max-height: calc(100vh - 140px); overflow-y: auto; }
.phead { display: flex; align-items: center; gap: 8px; }
.phead b { overflow-wrap: anywhere; }
.pview { border-radius: var(--r-m); background: var(--bg); border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.pimage { max-width: 100%; max-height: 420px; display: block; }
.pmedia { width: 100%; }
.ppdf { width: 100%; height: 460px; border: 0; background: #fff; }
.ptext { margin: 0; padding: 12px; width: 100%; max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.55 var(--mono); color: var(--soft); align-self: stretch; }
.pnone { display: flex; flex-direction: column; gap: 4px; padding: 24px; text-align: center; }
.pai .note { margin: 6px 0 0; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; margin-top: 6px; }
.segmented button { border: 0; border-radius: 0; background: var(--bg); color: var(--soft); padding: 6px 12px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; min-height: 0; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.on { background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--text); }
.segmented button.on:last-child { background: color-mix(in srgb, var(--warn) 14%, var(--bg)); }
.pfacts { display: flex; flex-direction: column; gap: 6px; }
.pfact { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.pfact span { color: var(--muted); }
.pfact b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
a.button { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--r-m); border: 1px solid var(--line2); background: var(--panel); color: var(--text); text-decoration: none; font-size: 13px; }
a.button:hover { background: var(--raised); }
.libdialog { max-width: 560px; }
.pickerlist { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-s); margin-top: 8px; }
.pickrow { padding: 6px 10px; gap: 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.pickrow:last-child { border-bottom: 0; }
.pickrow:hover { background: var(--raised); }
.accesschoices { display: flex; flex-direction: column; gap: 8px; }
.accesschoice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); cursor: pointer; }
.accesschoice:has(input:checked) { border-color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.accesschoice.private:has(input:checked) { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.accesschoice span { display: flex; flex-direction: column; gap: 2px; }
.accesschoice input { margin-top: 3px; accent-color: var(--accent-ink); }
.folderpick { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-m); }
.folderopt { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 0; background: none; text-align: left; padding-top: 8px; padding-bottom: 8px; min-height: 0; color: var(--text); }
.folderopt + .folderopt { border-top: 1px solid var(--line); }
.folderopt:hover { background: var(--raised); }
.folderopt.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.folderopt .libicon { color: var(--accent-ink); }
details.trysearch summary { cursor: pointer; list-style: none; }
details.trysearch[open] summary { margin-bottom: 10px; }
@media (max-width: 1100px) { .fmain.withpreview { grid-template-columns: minmax(0, 1fr); } .frow { grid-template-columns: 22px 34px minmax(0, 1fr) 150px 210px; } .frow .fsize, .frow .fdate { display: none; } }
.fmain.withpreview .frow { grid-template-columns: 22px 34px minmax(0, 1fr) 150px; }
.fmain.withpreview .frow .fsize, .fmain.withpreview .frow .fdate, .fmain.withpreview .frow .rowacts, .fmain.withpreview .fheadrow > :nth-child(n + 5) { display: none; }

/* The inbox as a mailbox: folders on the left, the list, and the open message beside it. */
.mail { display: grid; grid-template-columns: 216px minmax(0, 1fr); height: 100%; min-height: 0; }
.mailread { display: none; overflow-y: auto; min-height: 0; border-left: 1px solid var(--line); padding: 14px 24px 28px; background: var(--panel); }
.mail.reading .mailread { display: block; }
.mtime { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.star { border: 0; background: none; padding: 0; min-height: 0; width: 24px; font-size: 17px; line-height: 1; color: var(--muted); }
.star:hover { color: var(--text); }
.star.on { color: var(--warn); }
.mlabel { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; border: 1px solid var(--line); color: var(--soft); }
.mlabel.needs { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.mlabel.failed { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.mlabel.working { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.sysavatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: #0a0a0a; border: 1px solid #2a2a2a; color: var(--accent-ink); font: 700 13px/1 var(--mono); }
.sysavatar.big { width: 44px; height: 44px; border-radius: 11px; font-size: 18px; }
.readtools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.readtools button.on { color: var(--warn); }
.readsubject { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 21px; line-height: 1.3; overflow-wrap: anywhere; }
.readfrom { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.fromname { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fromname b { font-size: 15px; }
.fromname .rename { opacity: 0.7; }
.fromname .renamebox { height: 30px; width: 200px; }
.readbody { display: flex; flex-direction: column; gap: 14px; padding: 18px 0; }
.readreport { font-size: 14.5px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.readnow { display: flex; align-items: center; gap: 8px; color: var(--text); }
.readbody > pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.5 var(--mono); color: var(--soft); }
.readfacts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.readreply { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line2); border-radius: var(--r-l); background: var(--bg); }
.readreply textarea { border: 0; background: none; resize: vertical; min-height: 64px; padding: 4px; }
.readreply textarea:focus { outline: none; }
.composeform { display: flex; flex-direction: column; gap: 10px; }
.composeform label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; color: var(--muted); }
.composeform label select { flex: 1; }
.composeform textarea { resize: vertical; }
@media (max-width: 1100px) { .mail { grid-template-columns: 64px minmax(0, 1fr); }      }
.center.flush > .mail { flex: 1; height: auto; }
.mlabel.empty { border: 0; padding: 0; }

/* The audit log. */
.sysavatar.small { width: 20px; height: 20px; border-radius: 5px; font-size: 10px; }

/* The Organization page: the owner's chart, built and edited by hand. */
.orgx { max-width: 1400px; display: flex; flex-direction: column; gap: 12px; }
.orghead { display: flex; gap: 12px; align-items: flex-start; }
.orghead h1 { margin: 0; }
.orghead .lead { margin: 4px 0 0; }
.orgstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); font-size: 13px; color: var(--soft); }
.orgstrip b { color: var(--text); font-variant-numeric: tabular-nums; }
.orgproblems { display: flex; flex-direction: column; gap: 6px; }
.orgproblem { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); border-radius: var(--r-m); background: color-mix(in srgb, var(--bad) 6%, var(--panel)); font-size: 13px; color: var(--bad-ink); }
.orgwork { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; align-items: start; }
.orgwork.withpanel { grid-template-columns: 240px minmax(0, 1fr) 320px; }
.addbar { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); max-height: calc(100vh - 160px); overflow-y: auto; }
.addbar .note { margin: 0; }
.addlist { display: flex; flex-direction: column; gap: 4px; }
.addlist .label { margin: 8px 0 2px; }
.additem { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: var(--r-m); border: 1px solid transparent; cursor: grab; }
.additem:hover { background: var(--raised); border-color: var(--line); }
/* A ready-made team in the add bar is a row like any other item, not the page-wide .team layout. */
.additem.team { flex-direction: row; max-width: none; margin: 0; gap: 8px; padding-bottom: 6px; }
.posmain { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.posmain b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.additem .posmain b { display: block; white-space: normal; overflow-wrap: anywhere; }
.possub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leadtag { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 8px; color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.orgcanvas { min-width: 0; }
.orgboard { display: flex; flex-direction: column; gap: 12px; }
.youbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line2); border-radius: var(--r-l); background: var(--bg); }
.youmark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px; flex: none; }
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.groupframe { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); min-height: 120px; }
.groupframe.on { border-color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent); }
.groupframe header { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.groupframe header h2 { margin: 0; font-size: 15px; }
.groupgoal { margin-top: 4px; font-size: 13px; color: var(--soft); }
.groupbody { display: flex; flex-direction: column; gap: 4px; padding: 8px; flex: 1; }
.dropnote { margin: auto; text-align: center; }
.newgroup { align-items: center; justify-content: center; gap: 4px; border-style: dashed; background: none; color: var(--soft); min-height: 120px; }
.newgroup .plus { font-size: 22px; color: var(--accent-ink); }
.poscard { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); cursor: pointer; position: relative; }
.poscard:hover { border-color: var(--line2); background: var(--raised); }
.poscard.on { border-color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent); }
.poscard.lead { border-color: color-mix(in srgb, var(--bot) 45%, var(--line)); }
.poscard.dragging { opacity: 0.4; }
.poscard.you { cursor: default; background: var(--panel); }
.dragging-on .poscard, .dragging-on .groupframe, .dragging-on .youbar { transition: box-shadow 0.1s; }
.dropover { box-shadow: 0 0 0 2px var(--accent) !important; background: color-mix(in srgb, var(--accent) 8%, var(--panel)) !important; }
.treewrap { overflow-x: auto; padding-bottom: 8px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 18px; padding-left: 14px; border-left: 1px solid var(--line2); }
.tree li { padding: 4px 0; position: relative; }
.tree ul > li::before { content: ""; position: absolute; left: -14px; top: 24px; width: 12px; border-top: 1px solid var(--line2); }
.tree .poscard { max-width: 420px; }
.poslist { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); overflow: hidden; }
.posrow { display: grid; grid-template-columns: minmax(200px, 1.4fr) 1fr 1fr 1fr 110px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.posrow:first-child { border-top: 0; }
.posrow.head { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
.posrow select { width: 100%; min-width: 0; }
.poslink { display: flex; align-items: center; gap: 8px; text-align: left; min-height: 0; padding: 0; color: var(--text); }
.orgpanel2 { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); max-height: calc(100vh - 160px); overflow-y: auto; }
.orgpanel2 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.orgpanel2 label textarea, .orgpanel2 label input, .orgpanel2 label select { font-weight: 400; }
.panelhead { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.groupmark { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--accent-ink); font-weight: 700; }
.panelrules { padding: 10px 12px; border-radius: var(--r-m); background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.panelrules p { margin: 4px 0 0; color: var(--soft); }
.panelline { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.panelline.danger-zone { flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.panelline select { width: auto; }
@media (max-width: 1200px) { .orgwork.withpanel { grid-template-columns: 220px minmax(0, 1fr); } .orgwork.withpanel .orgpanel2 { grid-column: 1 / -1; position: static; } }
@media (max-width: 900px) { .orgwork, .orgwork.withpanel { grid-template-columns: minmax(0, 1fr); } .addbar { position: static; max-height: 280px; } .posrow { grid-template-columns: 1fr 1fr; } }

/* Starting from blank, and suggested positions. */
.startpanel { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px; border: 1px dashed var(--line2); border-radius: var(--r-l); background: var(--panel); }
.startyou { display: flex; gap: 14px; align-items: center; }
.startyou p { margin: 2px 0 0; }
.startstep { display: flex; gap: 14px; align-items: flex-start; }
.startstep .row input { flex: 1; min-width: 240px; }
.startways { margin: 6px 0 0; padding-left: 18px; color: var(--soft); font-size: 13.5px; line-height: 1.8; }
.startways .link { padding: 0; min-height: 0; }
.suggestbox { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: var(--r-l); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.suggestbox p { margin: 0; }
.suggestlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.suggestcard { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); }
.suggestwhy { margin-top: 4px; font-size: 13px; color: var(--soft); white-space: normal; line-height: 1.45; }
.suggestacts { display: flex; flex-direction: column; gap: 4px; }

/* Group budgets, and positions agents propose. */
.groupframe.warned > header .note { color: var(--warn); }
.groupframe.stopped { border-color: color-mix(in srgb, var(--bad-ink) 55%, var(--line)); }
.groupframe.stopped > header .note { color: var(--bad-ink); }
.loudnote { color: var(--bad-ink); }
.proposalbox { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 5%, var(--panel)); }
.proposalwhy { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent); color: var(--soft); }

/* Why a task exists: mission, goal, then each task down to this one. */
.whychain { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.whychain li { position: relative; padding-left: 16px; display: flex; flex-direction: column; }
.whychain li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--line2); }
.whychain li:not(:last-child)::after { content: ""; position: absolute; left: 6.5px; top: 15px; bottom: -6px; width: 1px; background: var(--line2); }
.whychain li.here::before { background: var(--accent); }
.whychain .whykind { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.whychain li.here > span:last-child { font-weight: 600; }

/* =====================================================================
   The workspace: a tree of pages, and a page edited in place.
   ===================================================================== */
.body.wsbody { grid-template-columns: 264px minmax(0, 1fr); }
.wsside { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.wssidehead { display: flex; align-items: center; gap: 6px; padding: 2px 2px 8px; border-radius: var(--r-m); }
.wshome { flex: 1; display: flex; align-items: center; gap: 8px; justify-content: flex-start; font-weight: 600; color: var(--text); padding: 6px 8px; border-radius: var(--r-m); }
.wshome.on, .wsrow.on { background: var(--grad-soft, transparent), color-mix(in srgb, var(--text) 6%, transparent); }
.wstree { list-style: none; margin: 0; padding: 0; }
.wsrow { display: flex; align-items: center; gap: 2px; padding-left: calc(var(--depth) * 14px); border-radius: var(--r-m); }
.wsrow:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.wsrow.dropover, .wssidehead.dropover { outline: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); }
.wscaret { width: 18px; min-height: 0; padding: 0; flex: none; color: var(--muted); font-size: 13px; text-align: center; }
.wslink { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; justify-content: flex-start; padding: 5px 4px; color: var(--soft); text-align: left; }
.wsrow.on .wslink { color: var(--text); font-weight: 600; }
.wsicon { flex: none; width: 18px; text-align: center; }
.wstitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wslink .count { font: 600 10.5px var(--mono); background: var(--grad-accent); color: var(--on-accent); border-radius: 999px; padding: 0 6px; }
.wslock { font-size: 13px; }
.wsadd { visibility: hidden; min-height: 0; padding: 2px 7px; color: var(--muted); }
.wsrow:hover .wsadd, .wsrow:focus-within .wsadd { visibility: visible; }
.wsdeleted { margin-top: auto; padding-top: 10px; }
.wsdeleted .row { padding: 2px 4px; }

.wscenter { position: relative; }
.wshomepage .wsresults { display: flex; flex-direction: column; gap: 6px; }
.wshit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; height: auto; padding: 8px 12px; }
.wsgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.wssuggestlist { display: flex; flex-direction: column; gap: 8px; }
.wscard { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; height: auto; padding: 14px 16px; font-weight: 400; }
.wscard b { font-weight: 600; }
.wsbigicon { font-size: 22px; }
.wssum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wstplpages { margin: 4px 0 8px; padding-left: 18px; color: var(--soft); font-size: 13px; }

.wspage { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 32px; max-width: 1180px; margin: 0 auto; }
.wsdoc { min-width: 0; max-width: 780px; width: 100%; justify-self: center; }
.wstrail { margin-bottom: 6px; }
.wstrail .link { padding: 0; min-height: 0; }
.wshead { display: flex; align-items: center; gap: 10px; }
.wspageicon { font-size: 30px; min-height: 0; padding: 2px 4px; }
.wstitlebox { border: 0; background: none; box-shadow: none; padding: 4px 0; font: 600 32px/1.15 var(--display, var(--sans)); letter-spacing: -0.025em; color: var(--text); }
.wstitlebox:focus { box-shadow: none; }
.wsmeta { margin: 4px 0 14px; }
.wstoolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 6px 4px; margin-bottom: 8px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.wstool { min-width: 30px; justify-content: center; color: var(--soft); }
.wsstatus { white-space: nowrap; }

/* The page's text, as it is edited. */
.wseditor .ProseMirror { outline: none; min-height: 55vh; padding: 6px 2px 40vh; font-size: 15.5px; line-height: 1.65; color: var(--text); }
.wseditor .ProseMirror > * + * { margin-top: 0.55em; }
.wseditor .ProseMirror h1 { font: 650 26px/1.25 var(--display, var(--sans)); letter-spacing: -0.02em; margin-top: 1.1em; }
.wseditor .ProseMirror h2 { font: 650 21px/1.3 var(--display, var(--sans)); letter-spacing: -0.015em; margin-top: 1em; }
.wseditor .ProseMirror h3 { font: 650 17px/1.35 var(--sans); margin-top: 0.9em; }
.wseditor .ProseMirror ul, .wseditor .ProseMirror ol { padding-left: 1.5em; }
.wseditor .ProseMirror ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
.wseditor .ProseMirror ul[data-type="taskList"] li { display: flex; gap: 8px; align-items: flex-start; }
.wseditor .ProseMirror ul[data-type="taskList"] li > label { flex: none; margin-top: 0.25em; }
.wseditor .ProseMirror ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.wseditor .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--muted); text-decoration: line-through; }
.wseditor .ProseMirror blockquote { margin-left: 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--soft); background: color-mix(in srgb, var(--accent) 5%, transparent); border-radius: 0 var(--r-s) var(--r-s) 0; }
.wseditor .ProseMirror pre { background: var(--field); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 12px; font: 13px/1.5 var(--mono); overflow-x: auto; }
.wseditor .ProseMirror code { font-family: var(--mono); font-size: 0.9em; background: color-mix(in srgb, var(--text) 7%, transparent); padding: 1px 5px; border-radius: 4px; }
.wseditor .ProseMirror pre code { background: none; padding: 0; }
.wseditor .ProseMirror hr { border: 0; border-top: 1px solid var(--line2); margin: 1.4em 0; }
.wseditor .ProseMirror a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.wseditor .ProseMirror table { border-collapse: collapse; width: 100%; margin: 0.8em 0; font-size: 14px; }
.wseditor .ProseMirror th, .wseditor .ProseMirror td { border: 1px solid var(--line2); padding: 6px 10px; vertical-align: top; text-align: left; min-width: 60px; }
.wseditor .ProseMirror th { background: color-mix(in srgb, var(--text) 5%, transparent); font-weight: 600; }
.wseditor .ProseMirror .selectedCell { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.wseditor .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: left; height: 0; color: var(--muted); pointer-events: none; }

/* The slash menu. */
.wsslash { position: absolute; z-index: 20; width: 260px; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: var(--r-l); background: var(--glass-strong, var(--raised)); -webkit-backdrop-filter: var(--blur, none); backdrop-filter: var(--blur, none); border: 1px solid var(--glass-line, var(--line2)); box-shadow: var(--shadow-l, none); }
.wsslashitem { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; height: auto; padding: 6px 10px; border: 0; background: none; text-align: left; }
.wsslashitem.on, .wsslashitem:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Agents' suggested changes. */
.wssuggestions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.wssuggestion { padding: 12px 14px; border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.wssuggestion p { margin: 4px 0; }
.wsdiff { margin: 8px 0; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; font-size: 13.5px; max-height: 320px; overflow-y: auto; }
.wsdiffline { display: flex; gap: 8px; padding: 2px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wsdiffline.add { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.wsdiffline.del { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--soft); text-decoration: line-through; }
.wsdiffmark { flex: none; width: 10px; font-family: var(--mono); color: var(--muted); }

/* The page's settings. */
.wspanel { display: flex; flex-direction: column; gap: 8px; align-self: start; position: sticky; top: 0; padding: 14px; border: 1px solid var(--glass-line, var(--line)); border-radius: var(--r-l); background: var(--panel); }
.wspanel .label { margin: 10px 0 0; }
.wspanel .label:first-child { margin-top: 0; }
.wspanel .note { margin: 0; }
.wsgroupchecks { display: flex; flex-direction: column; gap: 2px; }
.wstasks { display: flex; flex-direction: column; gap: 2px; }
.wstaskrow { display: flex; gap: 6px; justify-content: flex-start; text-align: left; padding: 4px 2px; font-size: 13px; }
.wspanelend { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.wshistory { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; min-width: min(760px, 80vw); max-height: 60vh; }
.wsrevs { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.wsrevbtn { justify-content: flex-start; text-align: left; font-size: 13px; }
.wsrevview { overflow-y: auto; padding: 0 6px; border-left: 1px solid var(--line); }
.rpages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0; }
@media (max-width: 1100px) { .wspage { grid-template-columns: minmax(0, 1fr); } .wspanel { position: static; } }

.wssuggestion .row { justify-content: flex-start; }
.wseditor .ProseMirror li > p { margin: 0; }
.wseditor .ProseMirror li + li { margin-top: 0.2em; }
.wseditor .ProseMirror ul[data-type="taskList"] li > label { margin-top: 0.3em; }
.wseditor .ProseMirror li p { margin: 0; }
.wseditor .ProseMirror ul[data-type="taskList"] li > label { margin-top: 0.22em; display: inline-flex; }
.wseditor .ProseMirror ul[data-type="taskList"] li > label input { margin: 0; }

/* About and legal. */
.legallinks { display: flex; flex-wrap: wrap; gap: 8px; }
dialog.needs.legaldialog { width: min(820px, 92vw); max-width: none; max-height: 86vh; flex-direction: column; gap: 6px; }
dialog.needs.legaldialog[open] { display: flex; }
.legaldoc { overflow-y: auto; padding-right: 6px; font-size: 14.5px; line-height: 1.6; }
.legaldoc pre { white-space: pre-wrap; font-size: 13px; }
.legaldoc table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13.5px; }
.legaldoc th, .legaldoc td { border: 1px solid var(--line2); padding: 6px 8px; text-align: left; vertical-align: top; }

/* =====================================================================
   Tasks: the board, its cards, and a task's panel.
   ===================================================================== */
.tasks { display: flex; flex-direction: column; gap: 14px; max-width: 1500px; margin: 0 auto; }
.tasks-head { display: flex; align-items: flex-start; gap: 16px; }
.tasks-head h1 { margin: 0 0 4px; }
.tasks-tools input[type="search"] { max-width: 280px; }
.tasks-tools select { max-width: 260px; }
.taskboard { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.taskcol { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r-l); background: color-mix(in srgb, var(--text) 3%, transparent); border: 1px solid var(--line); min-height: 140px; }
.taskcol > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 2px 4px 4px; }
.taskcol > header .count { font: 600 11px var(--mono); padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.taskcolhint { flex-basis: 100%; margin: 0; }
.col-needs > header .count { background: color-mix(in srgb, var(--warn) 22%, transparent); }
.col-review > header .count { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.taskempty { padding: 6px 4px; margin: 0; }
.taskcard { display: flex; flex-direction: column; align-items: stretch; gap: 6px; height: auto; padding: 10px 12px; text-align: left; font-weight: 400; border-radius: var(--r-m); background: var(--panel); border: 1px solid var(--glass-line, var(--line)); box-shadow: var(--shadow-s, none); border-left: 3px solid color-mix(in srgb, var(--bot) 55%, transparent); }
.taskcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-m, none); }
.taskcard.on { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.taskcardtop { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tasknum { font: 600 11.5px var(--mono); color: var(--muted); }
.taskpri { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 4px; }
.taskpri.urgent { color: var(--bad-ink); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.taskpri.high { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.taskpri.low { color: var(--muted); background: color-mix(in srgb, var(--text) 6%, transparent); }
.taskqueue { margin-left: auto; color: var(--muted); }
.tasktitle { font-weight: 600; line-height: 1.35; }
.taskdetail { font-size: 13px; color: var(--soft); line-height: 1.4; }
.taskdetail.bad { color: var(--bad-ink); }
.taskmeta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.taskcancelled { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }

.taskpanel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(460px, 92vw); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 30px; background: var(--glass-strong, var(--raised)); -webkit-backdrop-filter: var(--blur, none); backdrop-filter: var(--blur, none); border-left: 1px solid var(--glass-line, var(--line)); box-shadow: var(--shadow-l, none); animation: panel-in var(--t3, 0.3s) var(--ease, ease); }
.taskpanel[hidden] { display: none; }
@keyframes panel-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.taskpanelhead { display: flex; align-items: center; gap: 8px; }
.taskstatus { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.taskstatus.st-working { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.taskstatus.st-waiting, .taskstatus.st-blocked { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.taskstatus.st-blocked { color: var(--bad-ink); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.taskstatus.st-review { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.tasktitlebox { border: 0; background: none; box-shadow: none; padding: 2px 0; font: 600 21px/1.3 var(--display, var(--sans)); letter-spacing: -0.015em; }
.tasktitlebox:focus { box-shadow: none; }
.taskfacts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; margin: 4px 0; font-size: 13.5px; align-items: center; }
.taskfacts dt { color: var(--muted); }
.taskfacts dd { margin: 0; }
.taskfacts .link { padding: 0; min-height: 0; text-align: left; }
.taskpanel .label { margin: 10px 0 0; }
.taskdesc, .taskreport { font-size: 14px; padding: 10px 12px; border-radius: var(--r-m); background: color-mix(in srgb, var(--text) 3%, transparent); border: 1px solid var(--line); max-height: 320px; overflow-y: auto; }
.tasksubs { display: flex; flex-direction: column; gap: 2px; }
.tasksub { display: flex; align-items: center; gap: 8px; justify-content: flex-start; text-align: left; padding: 4px 6px; font-size: 13.5px; }
.taskdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line2); }
.taskdot.st-working, .taskdot.st-review { background: var(--accent); }
.taskdot.st-waiting { background: var(--warn); }
.taskdot.st-blocked { background: var(--bad); }
.taskdot.st-done { background: var(--muted); }
.taskstatus.st-paused { color: var(--muted); background: color-mix(in srgb, var(--text) 10%, transparent); }
.taskdot.st-paused { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.taskcard.paused { opacity: 0.72; }
.pausebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.pausebar .grow { min-width: 200px; }
.taskcomments { display: flex; flex-direction: column; gap: 8px; }
.taskcomment { padding: 8px 10px; border-radius: var(--r-m); background: color-mix(in srgb, var(--text) 4%, transparent); font-size: 14px; }
.taskcomment.mine { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ---------- AI models: every AI service in one place ---------- */
.aimodels { display: flex; flex-direction: column; gap: 14px; }
.aiconnected { display: flex; flex-direction: column; gap: 8px; }
.aiconn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-m, 8px); background: var(--panel); border: 1px solid var(--glass-line, var(--line)); }
.aiconn .tag { margin-left: 8px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--line); color: var(--muted, inherit); vertical-align: 1px; }
.tag.ok { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink, var(--text)); }
.aigroup h4 { margin: 6px 0 8px; font-size: 13px; letter-spacing: 0.01em; }
.aigroup > .row { align-items: center; }
.aigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.aicard { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r-m, 8px); background: var(--panel); border: 1px solid var(--glass-line, var(--line)); }
.aicard.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.aicard p { margin: 0; flex: 1; }
.aicardhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.svctile { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #0A0A0A; border: 1px solid #2A2A2A; color: #F2F2F2; font: 600 10.5px/1 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.3px; }
.aibackups { display: flex; flex-direction: column; gap: 6px; }
.aibackups p { margin: 0; }
.aibackuplist { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.aibackuplist li > * { vertical-align: middle; }
.aibackuplist li { display: list-item; }
.aibackuplist li .grow { margin-right: 8px; }
.aidialog { width: min(520px, calc(100vw - 32px)); }
.aidialog.wide { width: min(720px, calc(100vw - 32px)); max-width: 720px; }
.aidialog .note.bad { color: var(--bad-ink, var(--bad)); }
.aimodellist { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.aimodel { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s, 6px); border: 1px solid var(--line); }
.aimodel .note.bad { color: var(--bad-ink, var(--bad)); }
.aimodel .note.warn { color: var(--warn-ink, var(--warn)); }
.aimodel code { font-size: 13px; word-break: break-all; }
.aiadvanced { margin-top: 18px; }
.aiadvanced summary { cursor: pointer; font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; border-radius: var(--r-m, 8px); background: var(--raised, var(--panel)); border: 1px solid var(--glass-line, var(--line2)); box-shadow: var(--shadow-l, 0 8px 24px rgba(0,0,0,.12)); }

/* Goals and projects. */
.tasks-mode button.on { background: var(--raised); }
.taskplan { font-size: 13px; color: var(--accent-ink); }
.goalmission { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; font-size: 15px; }
.goalmission .label { margin: 0; }
.goalsection { display: flex; flex-direction: column; gap: 10px; }
.goalsection h3 { margin: 10px 0 0; font-size: 15px; }
.goalgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.goalcard { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.goalcard.st-achieved { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.goalcard.st-dropped { opacity: 0.7; }
.goalmark { font-size: 16px; color: var(--accent-ink); }
.goaltitle { font-size: 16px; line-height: 1.35; }
.goalnumber { display: flex; flex-direction: column; gap: 6px; }
.goalbar { display: block; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.goalbar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-accent, var(--accent)); transition: width var(--t3, 0.3s) var(--ease, ease); }
.goalbar.tasks { height: 4px; }
.goalbar.tasks i { background: color-mix(in srgb, var(--accent) 55%, var(--line2)); }
.goalupdate { display: flex; align-items: center; gap: 6px; }
.goalnow { width: 90px; padding: 4px 8px; }
.goalcard .note .bad { color: var(--bad-ink); }
.goalprojects { display: flex; flex-direction: column; gap: 6px; }
.goalproject { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--r-m); background: color-mix(in srgb, var(--text) 4%, transparent); }
.goalproject .grow { display: flex; flex-direction: column; gap: 2px; }
.goalproject.st-done, .goalproject.st-paused { opacity: 0.7; }
.goalactions { gap: 6px; }
.goalempty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; max-width: 620px; }
.goalempty p { margin: 0; }

/* ---------- schedules ---------- */
.whenrow { align-items: center; gap: 8px; }
.whenrow select, .whenrow input { width: auto; }
.whenrow input.mono { flex: 1; min-width: 260px; }
.warnline { color: var(--warn-ink, var(--warn)); }
:root[data-theme="light"] .warnline { color: #8A5A00; }

/* ---------- before you install ---------- */
.pvdialog { width: min(640px, calc(100vw - 32px)); max-width: 640px; max-height: calc(100vh - 48px); overflow-y: auto; }
.pvdialog h2 { margin: 0 0 4px; }
.pvlist { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; margin: 12px 0; }
.pvrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m, 8px); background: var(--panel); }
.pvrow.have { opacity: 0.75; }
.pvrow .tag { margin-left: 8px; }
.pvsum { font-weight: 500; }
.updatebox { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.updatebox ul { margin: 0; padding-left: 18px; }

/* ---------- a stopped task's hand-over note ---------- */
.handover { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.handover summary { cursor: pointer; display: block; line-height: 1.5; }
.handover ul { margin: 0 0 4px; padding-left: 18px; }
.handover .handwords { white-space: pre-wrap; margin: 0; color: var(--soft); }
.qnote:not(:empty) { padding: 0 16px; }

/* ---------- the task board ---------- */
.taskboard { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.taskboard summary { cursor: pointer; display: block; }
.boardlist { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.boardpost { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-s, 6px); background: var(--panel); }
.boardpost .tag { flex: none; margin-top: 2px; }
.boardpost.blocker .tag, .boardpost.question .tag { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--text); }
.boardpost.decision .tag { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.boardform { align-items: center; gap: 6px; flex-wrap: wrap; }
.boardform textarea { flex: 1 1 100%; min-height: 0; order: -1; }
.boardform select { width: auto; }

/* ---------- the access graph ---------- */
.accesspanel { display: flex; flex-direction: column; gap: 12px; }
.acards { display: flex; flex-direction: column; gap: 10px; }
.acard summary { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.acard[open] summary { margin-bottom: 8px; }
.arow { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.arow .alabel { flex: 0 0 150px; color: var(--soft); font-weight: 500; }
.arow.warnline .grow { color: var(--warn-ink, var(--warn)); }
.arow.pickrow { align-items: flex-start; gap: 10px; color: var(--text); }
.arow.pickrow input { margin-top: 3px; }
@media (max-width: 640px) { .arow { flex-direction: column; gap: 2px; } .arow .alabel { flex: none; } }

/* ---------- plans for approval ---------- */
.plancard { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.plancard.waiting { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.plancard summary { cursor: pointer; display: block; }
.plansteps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.plancard p { margin: 0; }
.stopbanner { display: flex; gap: 12px; align-items: center; }

/* A receipt part's model calls. */
.rsteps { margin: 8px 0; }
.rsteps summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.rsteptable { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.rsteptable th, .rsteptable td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.rsteptable th { font-weight: 600; color: var(--muted); }
.rsteptable .tag { margin-left: 6px; }

/* The page icon picker. */
.iconpicker { position: absolute; z-index: 60; width: 320px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m, 8px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); }
.icongrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-height: 220px; overflow-y: auto; }
.iconcell { font-size: 20px; line-height: 1; padding: 6px 0; border-radius: 6px; border: 1px solid transparent; background: none; cursor: pointer; }
.iconcell:hover, .iconcell.on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.iconcell.current { outline: 2px solid var(--accent); }

/* Keyboard focus on the organization's cards, group headings, Add list and panel. */
.poscard:focus-visible, .groupframe > header:focus-visible, .additem:focus-visible, .orgpanel2:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The Tasks board at a glance, and tasks that need a look. */
.todaystrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0 0 12px; }
.todaytile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-align: left; border-radius: var(--r-m, 8px); background: var(--panel); border: 1px solid var(--glass-line, var(--line)); font: inherit; color: inherit; }
.todaytile b { font-size: 20px; line-height: 1.1; }
.todaytile span { font-size: 13px; color: var(--muted); }
.todaytile.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.todaytile.warn b { color: var(--warn-ink, var(--warn)); }
button.todaytile { cursor: pointer; }
button.todaytile.on { background: color-mix(in srgb, var(--warn) 12%, var(--panel)); }
.taskattn { font-size: 13px; font-weight: 600; color: var(--warn-ink, var(--warn)); }

/* The leads' daily check-in, in the Inbox. */
.checkin { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m, 8px); }
.checkin h3 { margin: 0 0 4px; font-size: 14px; }
.checkinlist { margin: 4px 0 8px; padding-left: 18px; }

/* Page packs in the Marketplace, and a toast with an action. */
.packicon { font-size: 26px; line-height: 1; }
.toast .toastact { margin-left: 12px; font-weight: 600; text-decoration: underline; color: inherit; }

/* A connector's tile in the catalogue: its first letter, not its logo. */
.packicon.conn { font-weight: 700; font-size: 16px; color: var(--ink, inherit); }

/* Tables on a workspace page. */
.wstables { margin-top: 28px; display: grid; gap: 12px; }
.wstables h3 { margin: 0; font-size: 15px; }
.tbl { display: grid; gap: 10px; }
.tbl .tblname { font-weight: 600; border: 1px solid transparent; background: transparent; padding: 4px 6px; min-width: 140px; max-width: 260px; }
.tbl .tblname:hover, .tbl .tblname:focus { border-color: var(--line); }
.tblscroll { overflow-x: auto; }
.tblgrid { border-collapse: collapse; width: 100%; font-size: 13px; }
.tblgrid th { text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tblgrid td { padding: 2px 4px; border-bottom: 1px solid var(--line); }
.tblgrid td input, .tblgrid td select { width: 100%; min-width: 110px; border: 1px solid transparent; background: transparent; padding: 5px 6px; font: inherit; }
.tblgrid td input:hover, .tblgrid td input:focus, .tblgrid td select:hover, .tblgrid td select:focus { border-color: var(--line); }
.tblwaiting { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-m, 8px); }
.colrows { display: grid; gap: 8px; margin: 8px 0; }
.colrow { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 8px; align-items: center; }
.colrow input[aria-label="Choices"] { grid-column: 1 / 3; }
.tblnote { padding-left: 6px; }

/* Office: documents and notes. */
.officehome h1 { margin: 0 0 4px; }
.officegroup { padding: 12px 10px 4px; }
.officerow { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border-radius: var(--r-m, 8px); }
.officerow.on, .notecard.on { background: var(--raised, #eceeeb); }
.officetable { overflow-x: auto; padding: 0; }
.officetable table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.officetable th { text-align: left; font-size: 13px; font-weight: 600; padding: 10px 12px; color: var(--muted, #5e615f); }
.officetable td { padding: 9px 12px; border-top: 1px solid var(--line); }
.officeask input { flex: 1 1 280px; }
.officewait { display: block; width: 100%; text-align: left; margin-top: 6px; }
.officeturn { display: flex; flex-wrap: wrap; gap: 6px; }
.officetags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.notesside input[type="search"] { margin: 0 10px 4px; width: calc(100% - 20px); }
.notecard { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--r-m, 8px); border-bottom: 1px solid var(--line); }
.notecard .notesum { font-size: 13px; color: var(--ink-soft, #3c3f3d); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* A document looks like a sheet of paper. */
.wsdoc.paper { background: var(--panel, #fff); border: 1px solid var(--line); padding: 40px 48px; max-width: 760px; }
@media (max-width: 760px) { .wsdoc.paper { padding: 20px 16px; } }
/* Printing a document or note: only its text. */
@media print {
  body.printing * { visibility: hidden; }
  body.printing .wsdoc, body.printing .wsdoc * { visibility: visible; }
  body.printing .wsdoc { position: absolute; left: 0; top: 0; width: 100%; border: 0; padding: 0; max-width: none; }
  body.printing .wstoolbar, body.printing .wstrail, body.printing .wsmeta, body.printing .wstables button, body.printing .wsstatus { display: none; }
}
/* Projects: the cards and a project's page. */
.projectspage { display: grid; gap: 16px; }
.projecthead { gap: 10px; align-items: center; }
.projecthead h1 { margin: 0 0 2px; overflow-wrap: anywhere; }
.projectrow { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.projectrow:last-child { border-bottom: 0; }
.tag.badline { border-color: color-mix(in srgb, var(--bad, #c0392b) 55%, var(--line)); color: var(--bad, #c0392b); }
.projecthead select { width: auto; min-width: 130px; }
.projectspage > .back { justify-self: start; }

/* Office sheets: a grid of cells with formulas. */
.sheetdoc { max-width: none; min-width: 0; }
.sheetpage .wsdoc { flex: 1 1 520px; }
.sheettools { flex-wrap: wrap; gap: 6px; align-items: center; }
.sheettools select { width: auto; }
.sheetbarrowtop { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.sheetwhere { min-width: 56px; font-weight: 600; }
.sheetbar { flex: 1; min-width: 0; }
.sheetscroll { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: var(--r-m, 8px); background: var(--panel, #fff); }
.sheetgrid { border-collapse: collapse; font-size: 13px; }
.sheetgrid th { position: sticky; top: 0; background: var(--ground, #f5f6f4); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted, #5e615f); padding: 4px 8px; text-align: center; z-index: 1; }
.sheetgrid thead th { z-index: 2; }
.sheetgrid tbody th { position: sticky; left: 0; top: auto; min-width: 30px; }
.sheetgrid td { border: 1px solid var(--line); padding: 0; }
.sheetgrid td input { width: 112px; height: 28px; border: 0; background: transparent; padding: 0 8px; font: inherit; color: inherit; border-radius: 0; }
.sheetgrid td input:focus { outline: 2px solid var(--green-text, #007a3d); outline-offset: -2px; }
.sheetgrid td.n input { text-align: right; font-variant-numeric: tabular-nums; }
.sheetgrid td.n input:focus { text-align: left; }
.sheetgrid td.bad input { color: var(--critical, #b42318); }
.sheetgrid td.sel { background: color-mix(in srgb, var(--green-text, #007a3d) 10%, transparent); }
.sheetgrid td.locked { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--muted, #5e615f) 12%, transparent) 6px 7px); }
.sheetgrid td.sug { outline: 2px dashed var(--warning, #9a6200); outline-offset: -2px; }
.sheettabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.sheetcharts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 8px 0; }
.sheetchart { margin: 0; display: grid; gap: 10px; }
.sheetbars { display: grid; gap: 6px; }
.sheetbarrow { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.sheetbarrow > :nth-child(2) { justify-self: start; }
.sheetbarlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheetbarfill { display: block; height: 16px; background: #1f5bc7; min-width: 2px; }
.sheetline { width: 100%; height: 120px; color: #1f5bc7; }
.sheetlinelabels { display: flex; justify-content: space-between; }
.sheetwaiting { display: grid; gap: 8px; margin-bottom: 10px; }
.sheetdiff { font-size: 13px; border-collapse: collapse; }
.sheetdiff td { padding: 3px 12px 3px 0; }
.sheetgroups { display: grid; gap: 2px; }

/* Security: people and sign-in. */
.security .roles { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.security .roles dt { font-weight: 600; }
.security .roles dd { margin: 0; color: var(--ink-soft, #3c3f3d); }
.security .stepkey { font-size: 14px; letter-spacing: 0.06em; user-select: all; }
.security .officetable td { vertical-align: top; }
.login input[hidden] { display: none; }
.security .stopall { border-color: var(--critical, #b42318); }
.security .refused { margin: 6px 0 0; padding-left: 18px; }
.security .secrow { align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); }
.security .secrow:first-child { border-top: 0; }
.security .chip.bad { border-color: var(--critical, #b42318); color: var(--critical, #b42318); }
.security .chip.warn { border-color: #9a6200; color: #9a6200; }
.security .reviewline { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.security .reviewline input { min-width: 180px; flex: 1; }
.login .ssobutton { display: block; height: auto; text-align: center; text-decoration: none; padding: 10px 14px; border-radius: var(--r-m, 8px); background: var(--brand, #00d26a); color: #0a0a0a; font-weight: 600; }
.officestart { text-align: left; padding: 14px 16px; }
.officehomepage input[type="search"] { width: 100%; }
.clipbtn { margin: 0 10px 6px; text-align: left; }

/* Slides. */
.deckwork { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; margin-top: 12px; }
@media (max-width: 900px) { .deckwork { grid-template-columns: 1fr; } }
.sliderail { display: grid; gap: 6px; align-content: start; max-height: 70vh; overflow-y: auto; }
.slidethumb { display: flex; gap: 6px; align-items: flex-start; text-align: left; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-m, 8px); background: var(--panel, #fff); cursor: pointer; }
.slidethumb.on { border-color: var(--green-text, #007a3d); box-shadow: 0 0 0 1px var(--green-text, #007a3d); }
.slidethumb .thumbface { display: grid; gap: 2px; font-size: 13px; line-height: 14px; overflow: hidden; }
.slidethumb .thumbface span { color: var(--muted, #5e615f); }
.deckmain { display: grid; gap: 10px; }
.deckmain label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.slidestage { container-type: inline-size; }
.slideface { position: relative; aspect-ratio: 16 / 9; box-sizing: border-box; padding: 6% 7%; background: #fff; color: #0a0a0a; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4%; overflow: hidden; font-size: clamp(11px, 2.1cqw, 30px); }
.slideface h2 { margin: 0; font-size: 1.9em; line-height: 1.15; font-weight: 600; }
.slideface .slidebody { font-size: 1em; line-height: 1.45; }
.slideface .slidebody ul, .slideface .slidebody ol { padding-left: 1.2em; margin: 0; }
.slideface .slidebody li { margin: 0.3em 0; }
.slideface .slidebody table { font-size: 0.85em; }
.slideface .slidenum { position: absolute; right: 3%; bottom: 3%; font-size: 0.6em; color: #5e615f; }
.present { position: fixed; inset: 0; z-index: 1000; background: #0a0a0a; display: grid; place-items: center; container-type: inline-size; outline: 0; }
.present .slideface { width: min(100vw, 177.78vh); border: 0; font-size: min(2.1vw, 3.73vh); }
.present .presentbar { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; opacity: 0.25; }
.present .presentbar:hover, .present .presentbar:focus-within { opacity: 1; }
.present .presentbar button { color: #f2f2f2; background: #1b1c1b; border: 1px solid #333; padding: 6px 12px; border-radius: 8px; }
.deckprint { display: none; }
@media print {
  body.printingdeck > *:not(.deckprint) { display: none !important; }
  body.printingdeck .deckprint { display: block; }
  body.printingdeck .deckprint .slideface { width: 100%; font-size: 16pt; border: 0; break-after: page; page-break-after: always; }
}

/* Area tabs: the parts of Office and Knowledge, across the top. */
.areatabs { display: flex; align-items: center; gap: 4px; padding: 6px 20px; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.areatabs[hidden] { display: none; }
.areatab { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; white-space: nowrap; min-height: 32px; }
.areatab:hover { background: var(--raised); }
.areatab.on { background: var(--raised); border-color: var(--line2, var(--line)); font-weight: 600; }
/* Home. */
/* ---------- briefings: ready-made reports for the Inbox ---------- */
.briefgallery { display: grid; gap: 10px; margin-bottom: 8px; }
.briefgallery h2 { margin: 0; }
.briefgroup { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.briefgroup > summary { cursor: pointer; padding: 4px 0 8px; }
.briefneeds { color: var(--warn, #ffb020); }
:root[data-theme="light"] .briefneeds { color: #8a5a00; }
.briefgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.briefcard { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px; display: grid; gap: 6px; align-content: start; }
.briefcard.on { border-color: var(--accent-ink, var(--accent)); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.brieftop { display: flex; align-items: center; gap: 8px; }
.brieftop b { font-size: 15px; }
.briefstate { font: 600 10.5px var(--mono); border-radius: 999px; padding: 1px 8px; background: var(--line); color: var(--soft); }
.briefstate.on { background: var(--accent); color: var(--on-accent, #04130a); }
.briefabout, .briefcard .note { margin: 0; }
.brieffoot { margin-top: 6px; gap: 8px; }
.briefdialog label { display: grid; gap: 5px; align-items: start; }
.briefdialog textarea, .briefdialog input, .briefdialog select { width: 100%; }
.brieffacts { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.brieffact { display: flex; justify-content: space-between; gap: 14px; }
.brieffact span { color: var(--muted); }
.brieffact b { font-weight: 500; text-align: right; }
.briefmark { font: 600 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink, var(--accent)); }
/* ---------- the Inbox: three lists, decisions answered in place ---------- */
.inbox2 { max-width: 1040px; width: 100%; margin: 0 auto; padding: 22px 24px 60px; display: grid; gap: 14px; align-content: start; }
.inboxhead { display: grid; gap: 10px; }
.inboxhead h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.inboxbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inboxtabs { display: flex; flex-wrap: wrap; gap: 6px; }
.inboxtab { border: 1px solid transparent; border-radius: 999px; padding: 6px 14px; min-height: 0; background: none; color: var(--soft); display: inline-flex; align-items: center; gap: 7px; }
.inboxtab:hover { border-color: var(--line); background: none; }
.inboxtab.on { background: var(--panel); border-color: var(--line2); color: var(--text); font-weight: 600; }
.inboxcount { font: 600 11px var(--mono); background: var(--accent); color: var(--on-accent, #04130a); border-radius: 999px; padding: 1px 7px; }
.inboxcount.quiet { background: var(--line); color: var(--soft); }
.inboxfind { margin-left: auto; width: 200px; max-width: 100%; }
.inboxpanes { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.inbox2.deciding .inboxpanes { grid-template-columns: minmax(0, 1fr); }
.inbox2.deciding .inboxread { display: none; }
.inbox2.deciding .inboxlist { display: grid; gap: 12px; max-width: 760px; }
.inboxcard { border: 1px solid var(--warn, #ffb020); border-radius: 14px; background: var(--panel); overflow: hidden; }
.inboxcard.open { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn, #ffb020) 25%, transparent); }
.inboxcardtop { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 8px; }
.inboxcardtop .grow { display: grid; gap: 2px; min-width: 0; }
.inboxcardtop b { font-size: 15px; overflow-wrap: anywhere; }
.inboxkind { font: 600 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn, #ffb020); }
:root[data-theme="light"] .inboxkind { color: #8a5a00; }
.inboxkind.failed { color: var(--bad-ink, #b3261e); }
.inboxwhen { white-space: nowrap; }
.inboxcardbody { padding: 0 16px 14px 56px; display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.inboxcardbody .readbody { padding: 0; }
.inboxcardbody .readbody > p:first-child { margin-top: 0; }
.inboxcardbody .askcard { margin: 0; border-color: var(--line); background: none; }
.inboxcardfoot { display: flex; gap: 14px; padding: 6px 16px 10px; }
.inboxrows { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; display: grid; }
.inboxrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 0; }
.inboxrow:last-child { border-bottom: 0; }
.inboxrow .grow { display: grid; gap: 1px; min-width: 0; }
.inboxrow .grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inboxrow b { font-weight: 500; }
.inboxrow.unread b { font-weight: 700; }
.inboxrow.unread::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.inboxrow:hover, .inboxrow.open { background: color-mix(in srgb, var(--accent) 9%, transparent); border-color: var(--line); }
.inboxread { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
/* The older mailbox styles hide .mailread until a message is open; here the pane is always shown beside the list. */
.inbox2 .inboxread { display: block; }
.inbox2 .inboxread:empty { display: none; }
.inboxpick { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 60px 16px; }
.inboxreadtools { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.inboxback { display: none; }
.inboxcalm { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 40px 12px 14px; }
.inboxcalm b { font: 600 20px var(--round, var(--sans)); }
.inboxcalmmark { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 700; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink, var(--accent)); }
.calmrows { max-width: 520px; width: 100%; margin: 0 auto; }
@media (max-width: 899px) {
  .inboxpanes { grid-template-columns: minmax(0, 1fr); }
  .inbox2:not(.reading) .inboxread, .inbox2.reading .inboxlist { display: none; }
  .inboxback { display: inline-flex; }
  .inboxcardbody { padding-left: 16px; }
}
/* ---------- an agent asks before a step: one card, one clear button ---------- */
.askcard { border: 1px solid var(--warn, #ffb020); border-radius: 14px; background: color-mix(in srgb, var(--warn, #ffb020) 7%, var(--panel)); margin: 10px 0; overflow: hidden; display: grid; }
.askcardhead { display: flex; align-items: center; gap: 10px; padding: 12px 16px 6px; }
.askcardhead .grow { display: grid; gap: 1px; }
.askcardhead b { font-size: 15px; }
.askcardwhat { margin: 0; padding: 2px 16px 6px; overflow-wrap: anywhere; }
.askcarddetail { white-space: pre-line; }
.askcard > .note { margin: 0; padding: 0 16px 6px; }
.askcardmore { padding: 0 16px 8px; }
.askcardmore summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.askcardmore pre { margin: 8px 0 0; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.45 var(--mono); background: var(--field, var(--bg)); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.askcardfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid color-mix(in srgb, var(--warn, #ffb020) 40%, var(--line)); background: var(--panel); }
.askcardalways { justify-self: end; margin: 0 16px 10px; background: none; }
/* ---------- beside the chat: where things stand ---------- */
.body.two.over { grid-template-columns: 264px minmax(0, 1fr) 280px; }
.overpane { border-left: 1px solid var(--line); padding: 16px 14px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; }
.overhead { display: flex; align-items: center; gap: 8px; }
.overgroup { display: grid; gap: 6px; }
.overlabel { display: flex; }
.overcard { display: grid; gap: 3px; width: 100%; text-align: left; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-height: 0; }
.overcard:hover { border-color: var(--line2); }
.overcard.wait { border-color: var(--warn, #ffb020); background: color-mix(in srgb, var(--warn, #ffb020) 10%, var(--panel)); }
.overrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.overname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.overdone { display: block; width: 100%; text-align: left; border: 0; padding: 3px 0 3px 20px; min-height: 0; color: var(--muted); position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overdone::before { content: "✓"; position: absolute; left: 2px; color: var(--accent-ink, var(--accent)); font-weight: 700; }
@media (max-width: 1180px) { .body.two.over { grid-template-columns: 264px minmax(0, 1fr); } .overpane { display: none; } }
/* ---------- first run: set-up as a short chat ---------- */
.setupmain { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 0; min-height: 100%; }
.setupchat { display: flex; flex-direction: column; gap: 16px; max-width: 680px; width: 100%; margin: 0 auto; padding: 28px 24px 60px; }
.setupsay { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.setupsay p { margin: 4px 0 0; max-width: 60ch; }
.setupmark { width: 28px; height: 28px; border-radius: 7px; background: #0a0a0a; position: relative; display: block; }
.setupmark::before { content: ""; position: absolute; left: 7px; top: 8px; width: 14px; height: 3px; background: #f2f2f2; }
.setupmark::after { content: ""; position: absolute; left: 12px; top: 12px; width: 4px; height: 9px; background: var(--accent); }
.setupmine { align-self: flex-end; max-width: 80%; background: var(--raised, var(--panel)); border: 1px solid var(--line); border-radius: 14px 14px 4px 14px; padding: 8px 14px; }
.setupcard { margin-left: 40px; border: 1px solid var(--line2); border-radius: 14px; background: var(--panel); overflow: hidden; }
.setuphead { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.setupbody { display: grid; gap: 10px; padding: 14px 16px; }
.setupbody input { width: 100%; font-size: 15px; }
.setupopts { display: grid; }
.setupopt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 16px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); min-height: 0; }
.setupopt:last-child { border-bottom: 0; }
.setupopt .grow { display: grid; gap: 2px; }
.setupopt b { color: var(--text); }
.setupopt:hover, .setupopt:focus-visible { background: color-mix(in srgb, var(--accent) 9%, transparent); border-color: var(--line); }
.setupopt.first { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.setuplist { display: grid; max-height: 46vh; overflow-y: auto; }
.setuprow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.setuprow .grow { display: grid; gap: 2px; min-width: 0; }
.setuprow.on { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.setuprow input { width: 16px; height: 16px; flex: none; }
.setupfoot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.setupover { border-left: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.setupline { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; }
.setupline > div { display: grid; gap: 1px; }
.setuptick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line2); display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: 2px; }
.setupline.done .setuptick { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #04130a); }
@media (max-width: 900px) { .setupmain { grid-template-columns: minmax(0, 1fr); } .setupover { border-left: 0; border-top: 1px solid var(--line); } .setupcard { margin-left: 0; } }
/* ---------- home: one box to ask ---------- */
.askchip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--soft); }
/* ---------- the menu: what is in motion ---------- */
.recentitem { font-size: 13px; min-height: 30px; color: var(--muted); }
.recentitem .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.recentdot { width: 7px; height: 7px; flex: none; background: var(--accent); margin: 0 5px 0 6px; }
.recentitem.needs .recentdot { background: var(--warn, #ffb020); }
.recentitem.failed .recentdot { background: var(--bad, #ff6b6b); }
.security .sectabs { position: sticky; top: 0; z-index: 2; background: var(--bg, #f5f6f4); padding: 8px 0; }
.security .secrow .secgo { order: 3; }
.palette ul { max-height: min(70vh, 560px); overflow-y: auto; }

/* The main column: the top bar, the area tabs when an area has parts, then the page. */
.main { display: flex; flex-direction: column; }
.main > .body { flex: 1 1 auto; min-height: 0; }
.menubtn { display: none; }

/* A narrow window or a phone: the menu slides in from the side, and two-column pages stack. */
@media (max-width: 860px) {
  #app { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform 0.18s ease; box-shadow: none; }
  body.menuopen .rail { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35); }
  .menubtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-m, 8px); background: var(--panel); color: var(--text); font-size: 18px; cursor: pointer; flex: none; }
  .top { padding: 6px 10px; gap: 8px; flex-wrap: wrap; }
  .areatabs { padding: 6px 10px; }
  .center { padding: 16px 14px 28px; }
  .body.two { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; overflow-y: auto; }
  .body.two > .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 38vh; overflow-y: auto; }
  .wspage, .deckwork { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .wspanel { position: static; }
  .palette { min-width: 0; flex: 1 1 160px; }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } }
@media (max-width: 860px) {
  .body.three, .body.wsbody { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; overflow-y: auto; }
  .body.three > *, .body.wsbody > *, .body.two > * { overflow-y: visible; }
  .body.three > .side, .body.wsbody > .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 38vh; overflow-y: auto; }
}

/* Levels for each group and agent, and comments on a file. */
.levelsdialog .levelrows { display: grid; gap: 8px; margin: 10px 0; }
.levelsdialog .levelrows label { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; align-items: center; }
.levelsdialog .levelwords { padding-left: 18px; margin: 6px 0; }
.commentrow { padding: 8px 0; border-top: 1px solid var(--line); }
.commentrow p { margin: 2px 0 4px; white-space: pre-wrap; }
.wppost { padding: 5px 0; border-top: 1px solid var(--line); gap: 10px; }
.wpdaily { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.ihero .packicon.big { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 11px; font-size: 20px; font-weight: 700; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }
.checks .check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.slidechart { margin: 0.4em 0; }
.slidechart figcaption { margin-bottom: 0.3em; }

/* Speak instead of typing: a microphone beside the send button. */
.micbutton { display: inline-flex; align-items: center; justify-content: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; color: var(--muted); }
.micbutton:hover { color: var(--text); background: var(--line); }
.micbutton.recording { color: #fff; background: #d6453d; animation: micpulse 1.2s ease-in-out infinite; }
.micbutton.working { opacity: 0.55; cursor: progress; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 6px rgba(214, 69, 61, 0.18); } }
@media (prefers-reduced-motion: reduce) { .micbutton.recording { animation: none; } }
/* The Terms of Use, agreed to before the first use: the whole window, the documents in full, I agree always in view. */
#app > .login, #app > .termspage, #app > .accountpage { grid-column: 1 / -1; }
.termspage { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--bg); }
.termsinner { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 32px; box-sizing: border-box; }
.termsscroll { overflow-y: auto; padding: 48px 0 32px; }
.termsscroll .brand { margin-bottom: 28px; }
.termspage h1 { margin: 0 0 10px; font-size: 28px; line-height: 1.2; }
.termslead { margin: 0 0 14px; font-size: 15.5px; color: var(--muted); }
.termspoints { margin: 0 0 32px; padding: 18px 20px 18px 40px; display: grid; gap: 8px; font-size: 15px; line-height: 1.55; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l, 12px); }
.termspage h2 { margin: 0 0 10px; font-size: 17px; }
.termstabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.termstab { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; margin-bottom: -1px; color: var(--muted); font-weight: 600; cursor: pointer; }
.termstab[aria-selected="true"] { color: inherit; border-bottom-color: var(--brand, #00d26a); }
.termsdoc { padding: 18px 2px 8px; font-size: 15px; line-height: 1.65; overflow: visible; }
.termsdoc h2 { margin-top: 26px; }
.termsfoot { border-top: 1px solid var(--line); background: var(--panel); padding: 14px 0; }
.termsfoot .row { display: flex; align-items: center; gap: 20px; }
.termsfoot p { margin: 0; }
.termsfoot .termsagree { min-width: 160px; padding: 10px 22px; font-size: 15px; }
@media (max-width: 640px) { .termsinner { padding: 0 16px; } .termsfoot .row { flex-direction: column; align-items: stretch; } }

/* The optional Talqava account (Settings › General) */
.accountcode { display: block; margin: 6px 0; font: 600 24px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em; color: var(--accent-ink, currentColor); }
.accountemail { min-width: 220px; }

/* app.talqava.com/signup and /signin (public/account-page.ts): one card in the middle, in the floating glass look */
.accountpage { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; box-sizing: border-box; overflow-y: auto; }
.accountinner { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.accountcard {
  width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; padding: 30px 28px 24px; border-radius: 24px;
  background: var(--float, var(--panel)); border: 1px solid var(--float-line, var(--line)); box-shadow: var(--float-hi, 0 10px 30px -12px rgba(0, 0, 0, 0.3));
  -webkit-backdrop-filter: var(--float-blur, none); backdrop-filter: var(--float-blur, none);
}
.accountcard h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.accountlead { margin: 0 0 4px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.accountfield { width: 100%; box-sizing: border-box; padding: 11px 14px; font-size: 16px; border-radius: 12px; }
.accountgo { width: 100%; padding: 11px 16px; font-size: 15px; border-radius: 12px; }
.accountcard .socialsignin { flex-direction: column; align-items: stretch; }
.accountcard .socialsignin button { width: 100%; padding: 10px 16px; border-radius: 12px; }
.accountor { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.accountor::before, .accountor::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.accountswitch { margin: 4px 0 0; text-align: center; }
.accountskip { font-size: 14px; }
.accountfine { max-width: 36ch; margin: 0; text-align: center; }
@media (prefers-reduced-transparency: reduce) { .accountcard { background: var(--panel); -webkit-backdrop-filter: none; backdrop-filter: none; } }
