/* The values come from /theme.css (the design system's tokens); this file uses them only. */
:root {
  font-family: var(--font-family);
  font-size: var(--font-size);
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 13px;
  transition: background 0.15s;
}
button:hover {
  background: var(--surface-alt);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
button.primary:hover {
  background: var(--accent-hover);
}
button.small {
  padding: 6px 10px;
  font-size: 12px;
}
a {
  color: var(--accent);
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  padding: 11px;
}
textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}
p {
  line-height: 1.7;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 15px;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.7px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}
.brand {
  font-size: 44px;
  letter-spacing: -6px;
  font-weight: 800;
  line-height: 1;
}
.brand span {
  color: var(--brand-mark);
}
.brand small {
  display: block;
  margin-top: 15px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 500;
  color: var(--muted);
}
.layout {
  display: grid;
  grid-template-columns: 238px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--surface);
  color: var(--ink);
  padding: 29px 22px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar .brand {
  margin-bottom: 38px;
}
.sidebar label {
  margin-bottom: 24px;
  color: var(--muted);
}
.sidebar select {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.sidebar button.nav {
  background: transparent;
  border: 0;
  text-align: left;
  color: var(--muted);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0;
  padding: 11px 12px;
}
.sidebar button.nav.active {
  background: var(--accent-soft);
  color: var(--ink);
}
.nav-mark {
  font-size: 16px;
  width: 18px;
  text-align: center;
}
.main {
  grid-column: 2;
  padding: 0 42px 40px;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.page-intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 27px;
}
.page-intro p {
  color: var(--muted);
  max-width: 680px;
  margin-bottom: 0;
}
.page-intro .eyebrow {
  margin-bottom: 12px;
}
.page-intro h1 {
  margin-bottom: 12px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: 0.4px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  white-space: nowrap;
}
.grid {
  display: grid;
  gap: 20px;
}
.grid.two {
  grid-template-columns: 1.5fr 1fr;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 23px;
  min-width: 0;
}
.card > h2 {
  margin-bottom: 6px;
}
.empty {
  padding: 35px 20px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  border: 1px dashed var(--line);
  border-radius: var(--radius-control);
}
.empty strong {
  display: block;
  color: var(--ink);
  margin-bottom: 7px;
}
.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow: auto;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 13px 0;
  white-space: nowrap;
}
.tabs button.active {
  border-bottom: 2px solid var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.run-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 17px;
  margin-bottom: 12px;
}
.run-card:last-child {
  margin: 0;
}
.run-card h3 {
  margin: 0;
}
.run-card p {
  font-size: 12px;
  margin: 12px 0;
  color: var(--muted);
  white-space: pre-wrap;
}
.form {
  display: grid;
  gap: 17px;
}
.notice {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-card);
  background: var(--accent-soft);
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 20px;
}
.login {
  width: min(470px, calc(100% - 40px));
  margin: 12vh auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 40px;
}
.login .brand {
  color: var(--ink);
  margin-bottom: 32px;
}
.login h1 {
  font-size: 27px;
}
.login .brand small {
  color: var(--muted);
}
.login p {
  color: var(--muted);
  font-size: 13px;
}
.login button {
  width: 100%;
}
.terminal-confirm .terminal-code {
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-align: center;
}
.terminal-confirm .terminal-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--on-accent);
  padding: 13px 20px;
  border-radius: var(--radius-control);
  display: none;
  z-index: 100;
  max-width: 450px;
  line-height: 1.6;
}
#toast.visible {
  display: block;
}
#toast.error {
  background: var(--error-bg);
}
dialog {
  width: min(830px, calc(100% - 30px));
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 30px;
  max-height: 85vh;
  color: var(--ink);
}
dialog::backdrop {
  background: var(--backdrop);
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 20px;
  padding: 2px 9px;
}
.error-panel {
  padding: 20px;
  border: 1px solid var(--error-line);
  border-radius: var(--radius-control);
  color: var(--red);
  background: var(--error-bg);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1500px) {
  .main {
    padding-left: 65px;
    padding-right: 65px;
  }
}
@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 190px 1fr;
  }
  .sidebar {
    width: 190px;
    padding: 25px 15px;
  }
  .main {
    padding: 0 23px 30px;
  }
  .grid.two {
    grid-template-columns: 1fr;
  }
  .page-intro h1 {
    font-size: 28px;
  }
}
@media (max-width: 650px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    width: auto;
    padding: 15px;
    gap: 8px;
  }
  .sidebar .brand {
    font-size: 30px;
    margin: 0;
  }
  .sidebar .brand small {
    display: none;
  }
  .sidebar label {
    margin: 8px 0;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
  }
  .sidebar button.nav {
    white-space: nowrap;
    width: auto;
    margin: 0;
    padding: 8px;
  }
  .main {
    padding: 0 16px 30px;
  }
  .page-intro {
    flex-direction: column;
  }
  .card {
    padding: 18px;
  }
  .login {
    padding: 28px;
  }
  .tag {
    font-size: 11px;
  }
  .tabs {
    gap: 20px;
  }
}
@keyframes typing-pulse {
  0%,
  70%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.sidebar button.nav > span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}
.sidebar > * {
  flex-shrink: 0;
}
.sidebar button.nav {
  flex-shrink: 0;
}
@media (max-width: 650px) {
  .sidebar {
    overflow: visible;
    overscroll-behavior-y: auto;
  }
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}
*:hover {
  scrollbar-color: var(--scroll-thumb-hover) transparent;
}
@supports not (scrollbar-width: thin) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track,
  ::-webkit-scrollbar-corner {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border: 2px solid transparent;
    border-radius: var(--radius-control);
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background-color: var(--scroll-thumb-hover);
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
    scrollbar-width: auto;
  }
}
body {
  line-height: 1.5;
}
button {
  transition:
    background-color 140ms ease,
    border-color 140ms ease;
}
button:hover {
  border-color: var(--muted);
}
button.primary {
  border-color: var(--focus);
}
a {
  color: var(--ink);
  text-decoration-color: var(--focus);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
input,
textarea,
select {
  border-color: var(--line);
  padding: 10px 11px;
}
input[type='checkbox'],
input[type='radio'] {
  width: auto;
  accent-color: var(--focus);
}
h1 {
  line-height: 1.15;
}
h2,
h3 {
  font-weight: 600;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sidebar button.nav {
  border-radius: var(--radius-control);
  padding-left: 14px;
  position: relative;
}
.sidebar button.nav:hover {
  background: var(--surface-alt);
  color: var(--ink);
}
.sidebar button.nav.active {
  background: var(--accent-soft);
  color: var(--ink);
}
.sidebar button.nav.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  background: var(--focus);
}
.nav-mark {
  font-family: var(--font-mono);
  font-size: 13px;
}
.card {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 22px 0;
}
.grid {
  gap: 28px;
}
.run-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 0;
  margin: 0;
}
.run-card:last-child {
  border-bottom: 0;
}
.empty {
  border: 0;
  border-radius: 0;
  padding: 32px 16px;
  background: var(--surface-alt);
}
.notice {
  border-left-color: var(--focus);
}
#toast {
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--focus);
  border-radius: var(--radius-control);
}
#toast.error {
  background: var(--error-bg);
  color: var(--red);
  border-color: var(--error-line);
}
.login {
  border-radius: var(--radius-card);
}
.login .brand {
  color: var(--ink);
}
@keyframes typing-pulse {
  0%,
  70%,
  100% {
    opacity: 0.35;
  }
  35% {
    opacity: 1;
  }
}
@media (max-width: 650px) {
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .card {
    padding: 18px 0;
  }
  .grid {
    gap: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.nav-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-mark svg {
  width: 18px;
  height: 18px;
}
.messenger {
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.messenger .sidebar {
  position: relative;
  inset: auto;
  width: auto;
  height: 100%;
  padding: 0;
  overflow-y: auto;
  gap: 0;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 18px;
}
.sidebar-header .brand {
  margin: 0;
  font-size: 40px;
}
.sidebar-header .brand small {
  margin-top: 12px;
  font-size: 11px;
}
.sidebar-header button {
  border: 0;
  background: transparent;
  font-size: 18px;
}
.avatar {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.sidebar-footer button {
  border: 0;
  background: transparent;
}
.messenger .main {
  min-width: 0;
  height: 100%;
  padding: 0;
}
.messenger .tool-main {
  overflow-y: auto;
  padding: 0 32px 32px;
}
@media (min-width: 1700px) {
  .messenger {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .messenger {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}
@media (max-width: 650px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }
  /* Phones: a compact top bar with the navigation scrolling sideways, content below. */
  .messenger {
    display: block;
  }
  .messenger .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .messenger .sidebar .brand small {
    display: none;
  }
  .messenger .sidebar nav {
    display: flex;
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding: 0 12px 10px;
  }
  .messenger .sidebar button.nav {
    flex: 0 0 auto;
    width: auto;
  }
  .messenger .main {
    display: block;
    height: auto;
    padding: 0 16px 24px;
  }
}
.messenger {
  grid-template-columns: 360px minmax(0, 1fr);
}
.sidebar-header {
  padding: 16px 20px 10px;
}
.ai-missing {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin: 4px 16px 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  font-size: 12px;
  line-height: 1.5;
}
.ai-missing p {
  margin: 0;
}
.sidebar-header .brand small {
  margin-top: 5px;
}
@media (max-width: 900px) {
  .messenger {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .messenger {
    grid-template-columns: minmax(0, 1fr);
  }
}
.workspace-navigation {
  display: grid;
  gap: 4px;
  margin: 6px 12px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.workspace-navigation button {
  text-align: left;
}
.wizard-shell {
  height: 100dvh;
  overflow-y: auto;
  background: var(--paper);
}
.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1080px;
  margin: auto;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
}
.wizard-main {
  max-width: 880px;
  padding: 24px 32px 60px;
  margin: auto;
}
.wizard-main h1 {
  margin: 18px 0;
  font-size: 30px;
  letter-spacing: -0.7px;
}
.wizard-main > p {
  line-height: 1.7;
  max-width: 720px;
}
.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 32px;
  font-size: 12px;
  color: var(--muted);
}
.wizard-steps span {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.wizard-steps .active {
  color: var(--accent);
  font-weight: 700;
  border-color: var(--accent);
}
.wizard-steps .done {
  color: var(--step-done);
}
.wizard-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 0 0;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}
.wizard-main details {
  margin: 20px 0;
}
@media (max-width: 700px) {
  .wizard-main {
    padding: 18px;
  }
  .wizard-header {
    padding: 20px;
  }
  .wizard-steps {
    gap: 4px 12px;
  }
}
.form fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.form legend {
  font-weight: 600;
  padding: 0 6px;
}
.messenger {
  grid-template-columns: 290px minmax(0, 1fr);
}
.messenger .sidebar {
  background: var(--surface-alt);
}
.sidebar-header {
  padding: 18px 18px 10px;
}
.sidebar-header .brand {
  font-size: 34px;
}
.sidebar-header .brand small {
  display: none;
}
.workspace-navigation {
  margin: 0 12px 8px;
  padding-bottom: 8px;
  gap: 0;
}
.workspace-navigation .nav {
  padding: 10px;
  font-size: 12px;
}
@media (max-width: 700px) {
  .messenger {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .messenger {
    grid-template-columns: 1fr;
  }
}
[class*='agent-'] {
  --agent-color: hsl(var(--agent-hue, 188) 30% 35%);
  --agent-bg: hsl(var(--agent-hue, 188) 24% 94%);
  --agent-border: hsl(var(--agent-hue, 188) 20% 82%);
}
:root[data-theme='dark'] [class*='agent-'] {
  --agent-color: hsl(var(--agent-hue, 188) 35% 75%);
  --agent-bg: hsl(var(--agent-hue, 188) 15% 21%);
  --agent-border: hsl(var(--agent-hue, 188) 18% 29%);
}
.avatar[class*='agent-'] {
  background: hsl(var(--agent-hue, 188) 26% 42%);
  color: var(--on-agent-avatar);
}
@media (max-width: 650px) {
  :root {
    --mobile-primary-nav-height: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  .messenger {
    height: calc(100dvh - var(--mobile-primary-nav-height));
    min-height: 0;
  }
  #toast {
    right: 12px;
    bottom: calc(var(--mobile-primary-nav-height) + 8px);
    left: 12px;
    width: auto;
    max-width: none;
    text-align: center;
  }
}
.page-intro h1 {
  letter-spacing: -0.035em;
}
.card,
.run-card {
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.brand.has-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: normal;
}
.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}
.login .brand-logo {
  height: 44px;
}
.brand-logo-dark,
:root[data-theme='dark'] .brand-logo-light {
  display: none;
}
:root[data-theme='dark'] .brand-logo-dark {
  display: block;
}
.brand-ze {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--ink);
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.brand-ze span {
  color: var(--brand-mark);
}
.brand {
  font-size: 30px;
  letter-spacing: -1.4px;
  font-weight: 750;
}
.brand small {
  font-size: 11px;
  letter-spacing: 1.2px;
  line-height: 1.6;
}
.messenger {
  grid-template-columns: 280px minmax(0, 1fr);
}
.messenger .sidebar {
  width: 280px;
}
.messenger .main {
  min-width: 0;
}
.caw-onboarding .wizard-main {
  max-width: 760px;
}
.caw-onboarding .wizard-steps {
  flex-wrap: wrap;
}
.onboarding-form {
  gap: 22px;
}
.onboarding-form textarea {
  min-height: 120px;
}
.onboarding-review {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  line-height: 1.7;
}
.onboarding-review dt {
  color: var(--muted);
}
.onboarding-review dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
@media (max-width: 700px) {
  .messenger {
    grid-template-columns: minmax(0, 1fr);
  }
  .messenger .sidebar {
    width: 100%;
  }
  .onboarding-review {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .onboarding-review dd {
    margin-bottom: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
.agents-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.agents-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-weight: 500;
  cursor: pointer;
}
.agents-check:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.agents-check:has(input:disabled) {
  cursor: default;
  opacity: 0.75;
}
.agents-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.agents-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  cursor: pointer;
}
.agents-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.agents-option input {
  margin-top: 2px;
}
.agents-option span {
  display: grid;
  gap: 4px;
}
.agents-option small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}
.agents-directive {
  display: grid;
  gap: 10px;
}
.agents-directive p {
  margin: 0;
}
.agents-rules {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.agents-inline {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.agents-inline button {
  justify-self: start;
}
/* Conversations: the agent's and people's, one list in the sidebar. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
button.link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
}
.chat-provider {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.chat-provider small {
  display: block;
}
.chat-login {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.chat-code {
  font-size: 1.4em;
  letter-spacing: 0.15em;
}

/* Queues: one card per demand, draggable while waiting. */
.queue-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.queue-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.queue-item[draggable='true'] {
  cursor: grab;
}
.queue-item h3 {
  margin: 0 0 4px;
}
.queue-item.status-running {
  border-color: var(--accent);
}
.queue-item.status-waiting_human {
  border-color: var(--amber);
}
.queue-item blockquote {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 3px solid var(--line);
  white-space: pre-wrap;
}

/* Onboardings: repositories to import, AI drafts, the project checklist. */
.wizard-repos {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.wizard-draft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: -6px 0 12px;
}
.wizard-ai {
  margin-top: 24px;
}
.wizard-ai summary {
  cursor: pointer;
  color: var(--muted);
}
.project-checklist {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.project-checklist > li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.project-checklist > li > strong::before {
  content: '○ ';
  color: var(--muted);
}
.project-checklist > li.done > strong::before {
  content: '● ';
  color: var(--accent);
}
@media (max-width: 650px) {
  .project-checklist > li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.project-tasks {
  margin-top: 16px;
}
.project-tasks h4 {
  margin: 0;
}
.project-tasks ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.project-tasks li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.project-tasks li small {
  display: block;
}

/* Operation panel. */
.ops-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.ops-cards div {
  display: grid;
  gap: 4px;
}
.ops-cards strong {
  font-size: 1.8em;
}
.ops-cards span {
  color: var(--muted);
}
.ops-table {
  width: 100%;
  border-collapse: collapse;
}
.ops-table th,
.ops-table td {
  padding: 8px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.card:has(.ops-table) {
  overflow-x: auto;
}

/* Conversations: one list in the sidebar (the agent first, then project channels and people),
   one thread on the right. The SPEC opens in a drawer that closes. */
.avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
  border: 0;
  background: hsl(var(--tone, 200) 32% 88%);
  color: hsl(var(--tone, 200) 40% 28%);
}
:root[data-theme='dark'] .avatar {
  background: hsl(var(--tone, 200) 22% 26%);
  color: hsl(var(--tone, 200) 40% 82%);
}
/* Ten hues for avatars and map areas, picked from the name. */
.tone-0 {
  --tone: 8;
}
.tone-1 {
  --tone: 32;
}
.tone-2 {
  --tone: 52;
}
.tone-3 {
  --tone: 95;
}
.tone-4 {
  --tone: 150;
}
.tone-5 {
  --tone: 180;
}
.tone-6 {
  --tone: 205;
}
.tone-7 {
  --tone: 235;
}
.tone-8 {
  --tone: 275;
}
.tone-9 {
  --tone: 320;
}
.avatar.channel {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 500;
}
.messenger .sidebar {
  display: flex;
  flex-direction: column;
}
.conversations {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 4px 10px 12px;
  overflow-y: auto;
}
.convo-group {
  display: grid;
  gap: 2px;
  margin-top: 14px;
}
.convo-group h3 {
  margin: 0 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.convo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: var(--ink);
}
.convo-link:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.convo-link.active {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.convo-link-text {
  display: grid;
  flex: 1;
  min-width: 0;
}
.convo-link-text strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.convo-link-text small {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.convo-link.unread .convo-link-text small {
  color: var(--ink);
}
.convo-link.busy .avatar {
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 4px var(--accent);
}
.badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.messenger .workspace-navigation {
  margin: 0 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.messenger .workspace-navigation .nav {
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
}
.messenger .workspace-navigation .nav.active::before {
  display: none;
}

/* The conversation page fills the height: header, thread that scrolls, composer. */
.messenger .main.convo-page {
  height: 100%;
  overflow: hidden;
  padding: 0;
}
.convo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.convo.with-drawer {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 44%);
}
.convo-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}
.convo-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.convo-head .avatar {
  width: 36px;
  height: 36px;
}
.convo-title {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.convo-title h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.2px;
}
.convo-title small {
  font-size: 12px;
}
.convo-title button.link {
  font-size: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}
.convo-head button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.convo-card {
  margin: 16px auto 0;
  width: min(760px, calc(100% - 48px));
}
section.convo-card {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.convo-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.convo-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 20px;
}
.convo-empty {
  display: grid;
  gap: 6px;
  margin: 12vh auto 0;
  max-width: 420px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.convo-empty strong {
  color: var(--ink);
  font-size: 16px;
}
.convo-compose {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 18px;
}

/* Messages: the person's on the right in a soft bubble; others' as plain text with a name. */
.chat-bubble {
  max-width: 100%;
  min-width: 0;
}
/* Reply, at hand on the message under the pointer or with focus inside it. */
.chat-bubble[data-message] {
  position: relative;
}
.msg-reply {
  position: absolute;
  top: -12px;
  right: 8px;
  z-index: 1;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.chat-bubble.human .msg-reply {
  right: auto;
  left: 8px;
}
.chat-bubble[data-message]:hover .msg-reply,
.chat-bubble[data-message]:focus-within .msg-reply {
  opacity: 1;
  pointer-events: auto;
}
.msg-reply:hover,
.msg-reply:focus-visible {
  color: var(--ink);
}
/* On touch screens the swipe answers; no button floating over the text. */
@media (hover: none) {
  .msg-reply {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .msg-reply {
    transition: none;
  }
}
.chat-bubble.human {
  align-self: flex-end;
  max-width: min(560px, 85%);
  padding: 10px 14px;
  border-radius: 18px 18px 4px 18px;
  background: var(--surface-alt);
  line-height: 1.55;
}
.chat-bubble.human.held {
  background: transparent;
  border: 1px dashed var(--line);
}
.chat-bubble.human footer {
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
}
.chat-bubble.human footer button.link {
  font-size: 12px;
}
.chat-bubble.human textarea {
  min-height: 80px;
  margin-bottom: 8px;
}
.chat-from {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  min-width: 0;
}
.chat-from .avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}
.chat-from .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-from time,
.chat-thought time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.chat-bubble.agent .chat-text {
  padding-left: 32px;
}
.chat-ask {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--amber) 7%, var(--paper));
}
.chat-ask .chat-text {
  padding-left: 32px;
}
.chat-ask-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin: 10px 0 0 32px;
}
.chat-ask-form textarea {
  min-height: 44px;
  border-radius: 10px;
  resize: none;
  field-sizing: content;
}
.chat-thought {
  font-size: 13px;
  color: var(--muted);
}
.chat-thought summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 2px 0 2px 32px;
}
.chat-thought summary::-webkit-details-marker {
  display: none;
}
.chat-thought-mark {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.chat-thought[open] .chat-thought-mark {
  transform: rotate(45deg);
}
.chat-thought .chat-text {
  margin: 6px 0 0 32px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line);
}
.chat-working {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 32px;
  font-size: 13px;
  color: var(--muted);
}
.chat-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.chat-divider::before,
.chat-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}
.typing {
  display: inline-flex;
  gap: 3px;
}
.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: typing-pulse 1.2s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

/* The composer: one rounded box, the project as a small pill inside it. */
.chat-composer {
  display: grid;
  gap: 6px;
  padding: 10px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
}
.chat-composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}
.chat-composer textarea {
  min-height: 24px;
  max-height: 240px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  resize: none;
  field-sizing: content;
}
.chat-composer textarea:focus-visible {
  outline: 0;
}
.chat-composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.spacer {
  flex: 1;
}
.chat-pill {
  display: inline-flex;
  align-items: center;
  max-width: 50%;
  font-size: 12px;
  font-weight: 500;
}
.chat-pill select {
  width: auto;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  border-color: transparent;
  font-size: 12px;
}
span.chat-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rendered Markdown: answers and SPECs. */
.md {
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.md > :first-child {
  margin-top: 0;
}
.md > :last-child {
  margin-bottom: 0;
}
.md p,
.md ul,
.md ol,
.md blockquote,
.md pre,
.md .md-table {
  margin: 0 0 10px;
}
.md h2,
.md h3,
.md h4,
.md h5,
.md h6 {
  margin: 18px 0 8px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}
.md h2 {
  font-size: 18px;
}
.md h3 {
  font-size: 15px;
}
.md h4,
.md h5,
.md h6 {
  font-size: 13px;
}
.md ul,
.md ol {
  padding-left: 22px;
}
.md li + li {
  margin-top: 3px;
}
.md li.md-task {
  list-style: none;
  margin-left: -20px;
}
.md blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.md code {
  padding: 1px 5px;
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.88em;
}
.md pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: var(--radius-control);
  background: var(--surface-alt);
}
.md pre code {
  padding: 0;
  background: none;
}
.md hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}
.md-table {
  overflow-x: auto;
}
.md table {
  border-collapse: collapse;
  font-size: 0.92em;
}
.md th,
.md td {
  padding: 6px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.md th {
  background: var(--surface-alt);
}

/* The SPEC drawer. */
.chat-spec {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 24px 24px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}
.chat-spec-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.chat-spec-head h2 {
  margin: 4px 0 2px;
  font-size: 18px;
}
.chat-spec-head p {
  margin: 0;
  font-size: 12px;
}
button.icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
button.icon:hover {
  background: var(--surface-alt);
  color: var(--ink);
}
.spec-switch {
  gap: 18px;
  margin: 0;
}
.spec-switch button {
  padding: 8px 0;
  font-size: 12px;
}
.spec-actions {
  gap: 8px;
}
.spec-doc {
  padding-top: 4px;
}
.spec-edit textarea {
  min-height: 55vh;
  font-family: var(--font-mono);
  font-size: 13px;
}
.spec-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.spec-deliveries {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}
.spec-delivery small {
  display: block;
}
.spec-delivery.conflict,
.spec-delivery.blocked {
  color: var(--red);
}
.spec-diff {
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
}
.spec-diff .add {
  background: var(--accent-soft);
}
.spec-diff .del {
  color: var(--red);
  text-decoration: line-through;
}
@media (max-width: 1100px) {
  .convo.with-drawer {
    grid-template-columns: minmax(0, 1fr);
  }
  .convo.with-drawer .chat-spec {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(560px, 100%);
    z-index: 20;
    box-shadow: -12px 0 32px color-mix(in srgb, var(--ink) 14%, transparent);
  }
}
@media (max-width: 700px) {
  .conversations {
    display: flex;
    flex: none;
    gap: 4px;
    overflow-x: auto;
    padding: 0 12px 8px;
  }
  .convo-group {
    display: contents;
  }
  .convo-group h3,
  .convo-link-text small {
    display: none;
  }
  .convo-link {
    flex: 0 0 auto;
    width: auto;
  }
  .messenger .main.convo-page {
    height: auto;
    overflow: visible;
  }
  .convo-thread {
    max-height: 62vh;
  }
  .convo-head {
    padding: 12px 16px;
  }
  .convo-inner,
  .convo-compose,
  .convo-card {
    width: calc(100% - 32px);
  }
  .chat-bubble.agent .chat-text,
  .chat-ask .chat-text,
  .chat-working,
  .chat-thought summary {
    padding-left: 0;
  }
  .chat-thought .chat-text,
  .chat-ask-form {
    margin-left: 0;
  }
}

/* The code map: the drawing on the left, what is selected on the right. */
.messenger .main.map-main {
  height: 100%;
  overflow: hidden;
  padding: 0;
}
.map-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.map-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.map-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px;
  font-size: 16px;
}
.map-crumbs button.link {
  font-size: inherit;
}
.map-project {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.map-project select {
  width: auto;
}
.map-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
}
.map-canvas {
  position: relative;
  min-height: 0;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px) 0
      0 / 22px 22px,
    var(--paper);
}
.map-svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
}
.map-svg.panning {
  cursor: grabbing;
}
.map-edges line {
  stroke: var(--muted);
  stroke-opacity: 0.28;
  transition: stroke-opacity 0.15s;
}
.map-node {
  cursor: pointer;
  transition: opacity 0.15s;
}
.map-node circle {
  fill: hsl(var(--tone) 45% 72%);
  stroke: hsl(var(--tone) 40% 42%);
  stroke-width: 1.5;
}
:root[data-theme='dark'] .map-node circle {
  fill: hsl(var(--tone) 30% 34%);
  stroke: hsl(var(--tone) 45% 62%);
}
.map-node .map-ring {
  fill: none;
  stroke-dasharray: 3 3;
  stroke-opacity: 0.6;
}
.map-node.outside circle {
  fill: var(--surface);
  stroke: var(--muted);
  stroke-dasharray: 2 2;
}
.map-node text {
  font-size: 12px;
  text-anchor: middle;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}
.map-node.minor text {
  display: none;
}
.map-node.minor.near text,
.map-node.minor.selected text,
.map-node.minor:hover text {
  display: block;
}
.map-node.outside text {
  fill: var(--muted);
  font-size: 11px;
}
.map-node.selected circle:first-child {
  stroke: var(--ink);
  stroke-width: 3;
}
.map-node:focus-visible {
  outline: none;
}
.map-node:focus-visible circle:first-child {
  stroke: var(--focus);
  stroke-width: 3;
}
.map-svg.focused .map-node:not(.near) {
  opacity: 0.25;
}
.map-svg.focused line {
  stroke-opacity: 0.06;
}
.map-svg.focused line.near {
  stroke: var(--accent);
  stroke-opacity: 0.8;
}
.map-zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.map-info {
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
}
.map-info h2 {
  margin: 4px 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.map-info h3 {
  margin: 20px 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.map-path {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.map-links {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.map-links li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.map-links button.link {
  text-align: left;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .map-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 1fr) auto;
  }
  .map-info {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 700px) {
  .messenger .main.map-main {
    height: auto;
    overflow: visible;
  }
  .map-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .map-canvas {
    height: 60vh;
  }
}

/* Decisions: pinned above the composer until answered, then a record in the thread. */
.chat-asks {
  display: grid;
  gap: 10px;
  max-height: 45vh;
  margin-bottom: 10px;
  overflow-y: auto;
}
.chat-ask header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.chat-ask header .avatar {
  flex: none;
  width: 24px;
  height: 24px;
  font-size: 11px;
}
.chat-ask header div {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
}
.chat-ask header small {
  font-size: 12px;
}
.chat-ask .chat-text {
  padding-left: 34px;
}
.chat-ask-form {
  margin-left: 34px;
}
.chat-decision {
  align-self: flex-end;
  max-width: min(560px, 85%);
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
  border-radius: 18px 18px 4px 18px;
  background: color-mix(in srgb, var(--amber) 6%, var(--paper));
  line-height: 1.55;
}
.chat-decision header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}
.chat-decision time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.chat-decision details {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.chat-decision summary {
  cursor: pointer;
}
.chat-decision details .md {
  margin-top: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.chat-note {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.chat-note time {
  font-size: 11px;
}
.chat-bubble.human > time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

/* "sobre a SPEC": a chip the person can remove. */
span.chat-pill.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px 2px 10px;
}
span.chat-pill.chip button {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  line-height: 1;
}
span.chat-pill.chip button:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

/* The SPEC drawer: where it belongs under the title, deliveries in plain words. */
h2[tabindex='-1']:focus,
h3[tabindex='-1']:focus {
  outline: none;
}
.chat-spec-head h2 {
  margin: 0 0 2px;
}
.spec-where {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
}
.spec-deliveries {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.spec-delivery {
  display: grid;
  gap: 2px;
}
.spec-delivery.conflict,
.spec-delivery.blocked {
  color: var(--ink);
}
.spec-delivery.blocked strong,
.spec-delivery.conflict strong {
  color: var(--red);
}
.spec-delivery-help {
  color: var(--muted);
}
.spec-delivery-help details {
  margin-top: 2px;
}
.spec-delivery-help summary {
  cursor: pointer;
}
.spec-delivery-help code {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.segmented {
  display: inline-flex;
}
.segmented button {
  border-radius: 0;
}
.segmented button:first-child {
  border-radius: var(--radius-control) 0 0 var(--radius-control);
}
.segmented button:last-child {
  margin-left: -1px;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}
.segmented button[aria-pressed='true'] {
  position: relative;
  background: var(--accent-soft);
  border-color: var(--accent);
}
.spec-actions {
  flex-wrap: wrap;
}
.spec-confirm {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.spec-confirm h3 {
  margin: 0;
  font-size: 15px;
}
.spec-confirm ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}
.spec-confirm p {
  margin: 0;
  font-size: 12px;
}
ol.spec-diff {
  margin: 0;
  list-style: none;
  overflow-wrap: anywhere;
}
.spec-diff li {
  padding: 1px 6px;
  border-radius: var(--radius-control);
}
.spec-diff li.add,
.spec-diff-legend .add {
  background: var(--accent-soft);
}
.spec-diff li.del,
.spec-diff-legend .del {
  color: var(--red);
  text-decoration: line-through;
}
.spec-diff li.fold {
  color: var(--muted);
  text-align: center;
}
.spec-diff-legend {
  display: flex;
  gap: 12px;
  margin: 0;
  font-size: 12px;
}
.spec-diff-legend span {
  padding: 1px 6px;
  border-radius: var(--radius-control);
}

/* Small text never goes below 11px; placeholders keep readable contrast. */
.eyebrow,
.tag,
.brand small,
.sidebar-header .brand small,
.chat-from .avatar {
  font-size: 11px;
}
.sidebar-footer {
  font-size: 12px;
}
::placeholder {
  color: var(--muted);
  opacity: 1;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toasts: a quiet confirmation, smaller than the actions on the page. */
#toast {
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--ink) 18%, transparent);
}
#toast.error {
  background: var(--error-bg);
  color: var(--red);
  border: 1px solid var(--error-line);
}

/* On a phone a conversation takes the screen: its list on top, the full menu on request. */
.menu-toggle {
  display: none;
}
@media (max-width: 700px) {
  .messenger.in-convo {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
  }
  .messenger.in-convo .sidebar {
    width: 100%;
    height: auto;
    overflow: visible;
    border-bottom: 1px solid var(--line);
  }
  .messenger.in-convo:not(.menu-open) .workspace-navigation,
  .messenger.in-convo:not(.menu-open) .sidebar-footer {
    display: none;
  }
  .messenger.in-convo.menu-open .sidebar {
    max-height: 80dvh;
    overflow-y: auto;
  }
  .messenger.in-convo.menu-open .workspace-navigation {
    flex-wrap: wrap;
    overflow: visible;
  }
  .messenger.in-convo .sidebar-header {
    gap: 8px;
    padding: 10px 16px 6px;
  }
  .messenger.in-convo .sidebar-header .brand {
    font-size: 26px;
  }
  .messenger.in-convo .menu-toggle {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    font-size: 14px;
  }
  .messenger.in-convo .main.convo-page {
    grid-column: 1;
    height: 100%;
    overflow: hidden;
  }
  .convo-thread {
    max-height: none;
  }
  .convo-compose {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .chat-asks {
    max-height: 38dvh;
  }
  .chat-ask .chat-text,
  .chat-ask-form {
    margin-left: 0;
    padding-left: 0;
  }
  .chat-pill select,
  .chat-composer textarea,
  .chat-ask-form textarea,
  .chat-bubble.human textarea {
    font-size: 16px;
  }
  .convo-link,
  .convo-head button,
  .chat-composer-bar button,
  .spec-actions button,
  .spec-confirm button,
  .chat-ask-form button {
    min-height: 44px;
  }
  button.icon {
    width: 44px;
    height: 44px;
  }
  #toast {
    top: 12px;
    right: 16px;
    bottom: auto;
    left: 16px;
    max-width: none;
  }
}

/* Second pass: one decision at a time, a calmer SPEC drawer, a phone used with one hand. */
.chat-ask:focus {
  outline: 2px solid color-mix(in srgb, var(--amber) 70%, var(--ink));
  outline-offset: 2px;
}
.chat-ask-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0 34px;
}
.chat-ask-options button {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--paper);
}
.chat-ask-options button:hover {
  background: color-mix(in srgb, var(--amber) 12%, var(--paper));
}
.chat-ask-next,
.chat-asks-more {
  margin: 8px 0 0 34px;
  font-size: 12px;
  color: var(--muted);
}
.chat-asks-more {
  margin: 0;
  text-align: center;
}
.convo-title button.link.attention {
  color: var(--ink);
  font-weight: 600;
  text-decoration-color: var(--amber);
}
.chat-decision-label {
  color: color-mix(in srgb, var(--amber) 60%, var(--ink));
}
.convo-link.waiting .avatar {
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 4px var(--amber);
}
.chat-divider strong {
  color: var(--ink);
  font-weight: 600;
}
.spec-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.spec-pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 500;
}
.spec-pill.draft {
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
}
.spec-stopped {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
}
.spec-waiting {
  font-size: 12px;
  color: var(--muted);
}
.spec-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.spec-meta summary {
  cursor: pointer;
}
.spec-meta p {
  margin: 6px 0 0;
}
.segmented button {
  transition: none;
}
.segmented button[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
ol.spec-diff {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
}
.spec-diff li.heading {
  font-weight: 700;
}
.spec-diff li.fold {
  font-size: 12px;
  font-style: italic;
}
@media (max-width: 700px) {
  .chat-ask-options,
  .chat-ask-next {
    margin-left: 0;
  }
  .chat-ask-options button {
    min-height: 44px;
  }
  /* The SPEC's actions stay at the bottom, within reach of a thumb. */
  .chat-spec .spec-actions,
  .chat-spec .spec-confirm {
    order: 10;
    position: sticky;
    bottom: 0;
    margin: 0 -24px -24px;
    padding: 12px 24px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .chat-spec .spec-confirm {
    border-width: 1px 0 0;
    border-radius: 0;
  }
  body:has(.messenger.in-convo) #toast {
    top: auto;
    bottom: 132px;
  }
  /* Lists that scroll sideways fade at the edge, so it shows there is more. */
  .messenger .sidebar nav:not(.workspace-navigation),
  .messenger:not(.in-convo) .workspace-navigation {
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  }
}

/* Projects in the sidebar: the open one lists its topics (Geral is the project's own row). */
.convo-topics {
  display: grid;
  gap: 1px;
  margin: 2px 0 6px 28px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.topic-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}
.topic-link:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink);
}
.topic-link.active {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink);
  font-weight: 600;
}
.topic-link.unread {
  color: var(--ink);
  font-weight: 600;
}
.topic-link.add {
  color: var(--muted);
  font-size: 12px;
}
.topic-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-draft {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 18%, var(--surface));
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
}
.topic-new {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 4px 10px;
}
.topic-new input {
  flex: 1 1 100%;
  min-width: 0;
}
.chat-hint {
  font-size: 12px;
}
/* The 1-1 code session: what changed in the person's copy waits in one quiet line above the
   composer, with the way to the team (Abrir PR) and the way to drop it. */
.chat-code-icon {
  flex: none;
  width: 16px;
  height: 16px;
}
.chat-changes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 4px 4px 4px 14px;
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
}
.chat-changes > .chat-code-icon {
  color: var(--accent);
}
.chat-changes p {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-changes button {
  flex: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  white-space: nowrap;
}
.chat-changes .chat-changes-pr {
  color: var(--accent);
  font-weight: 600;
}
.chat-changes .chat-changes-pr:hover {
  background: var(--accent-soft);
}
.chat-changes .chat-changes-off {
  color: var(--muted);
}
.chat-changes .chat-changes-off:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
}
.convo-head button.attention {
  border-color: color-mix(in srgb, var(--amber) 70%, var(--line));
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
}

/* A decision record reads on its own: the question in a line, the answer in bold. */
.chat-decision-question {
  margin: 0 0 4px;
  font-size: 13px;
  color: color-mix(in srgb, var(--muted) 55%, var(--ink));
}
/* Muted text on the warm decision cards keeps AA contrast. */
.chat-ask header small,
.chat-ask-next,
.chat-decision .muted,
.chat-decision time,
.chat-decision summary {
  color: color-mix(in srgb, var(--muted) 55%, var(--ink));
}
.spec-delivery.unset strong {
  color: var(--ink);
}
@media (max-width: 700px) {
  .convo-topics {
    display: contents;
  }
  .topic-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
  }
  .chat-hint {
    display: none;
  }
}

/* Task topics: their state beside the name; finished tasks fold away. */
.topic-state {
  flex: none;
  font-size: 11px;
  color: var(--muted);
}
.topic-done {
  margin-top: 2px;
}
.topic-done summary {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.topic-done summary:hover {
  color: var(--ink);
}
@media (max-width: 700px) {
  .topic-done {
    display: contents;
  }
  .topic-done summary {
    display: none;
  }
}

/* Topics the team opened: rename in the header, archived ones closed to new messages. */
.topic-rename {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.topic-rename input {
  flex: 1 1 220px;
  min-width: 0;
}
.topic-archived {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 14px;
}

/* Typing "@" offers the person's own agent, above the message. */
.mention-pick {
  justify-self: start;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}
.mention-pick strong {
  color: var(--ink);
}
.mention-pick:hover,
.mention-pick:focus-visible {
  border-color: var(--accent);
}
.mention-pick[hidden] {
  display: none;
}

/* Work someone else set off for the agent: its title, then the button that lets it start. */
.chat-approval-title {
  margin: 10px 0 0 34px;
  font-weight: 600;
}
.chat-approval-cost {
  margin: 4px 0 0 34px;
  font-size: 13px;
  color: var(--muted);
}
.chat-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0 34px;
}
.chat-approval-actions button {
  border-radius: 999px;
  padding-inline: 14px;
}
/* A code session's command waiting for leave: shown whole, as it would run. */
.chat-permit-command {
  margin: 10px 0 0 34px;
  padding: 10px 12px;
  max-height: 180px;
  overflow: auto;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
/* Leaving the closed box is not a routine question: its own tone, the risk at reading size,
   and "Permitir" no louder than "Negar". */
.chat-permit.risk {
  border-color: var(--error-line);
  background: color-mix(in srgb, var(--red) 5%, var(--paper));
}
.chat-permit-risk {
  margin: 10px 0 0 34px;
  font-size: 14px;
  line-height: 1.5;
}
.chat-approval-actions .chat-permit-allow {
  border-color: var(--red);
  color: var(--red);
  background: var(--paper);
}
.chat-approval-actions .chat-permit-allow:hover {
  background: var(--error-bg);
}

/* Opening the PR: what it needs and where the change goes, before it happens. */
.chat-pr {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 4%, var(--paper));
}
.chat-pr-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.chat-pr-field {
  display: grid;
  gap: 6px;
  margin: 4px 0 0 34px;
  font-size: 13px;
}
.chat-pr-field input {
  border-radius: 10px;
  font-weight: 400;
}
.chat-pr-steps {
  display: grid;
  gap: 4px;
  margin: 10px 0 0 34px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 700px) {
  .chat-approval-title,
  .chat-approval-cost,
  .chat-approval-actions,
  .chat-permit-command,
  .chat-permit-risk,
  .chat-pr-field,
  .chat-pr-steps {
    margin-left: 0;
  }
  .chat-approval-actions button,
  .chat-changes button {
    min-height: 44px;
  }
  .chat-pr-field input {
    font-size: 16px;
  }
  .chat-changes {
    flex-wrap: wrap;
    row-gap: 0;
    padding: 6px 4px 2px 14px;
  }
  .chat-changes p {
    flex-basis: calc(100% - 32px);
    white-space: normal;
  }
  .chat-changes .chat-changes-pr {
    margin-left: 16px;
  }
}

/* "@" choices while typing, and the people a message calls. */
.mention-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mention-picks[hidden] {
  display: none;
}
.chat-text .mention {
  padding: 0 3px;
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  font-weight: 600;
}
.chat-text .mention.me {
  background: color-mix(in srgb, var(--amber) 28%, var(--surface));
}
.badge.mention {
  background: var(--amber);
  color: var(--ink);
}

/* A message's menu: right click, or the menu key, on a message. */
.message-menu {
  position: fixed;
  z-index: 50;
  display: grid;
  min-width: 160px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 18%, transparent);
}
.message-menu button {
  justify-content: flex-start;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
}
.message-menu button:hover,
.message-menu button:focus-visible {
  background: var(--surface-alt);
}
[data-team-thread] [data-message]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
/* On a phone, a message pulled to the side shows it will be answered. */
[data-team-thread] [data-message] {
  touch-action: pan-y;
}
[data-team-thread] [data-message].swipe-ready {
  box-shadow: -4px 0 0 var(--accent);
}
[data-team-thread] [data-message].flash {
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  transition: background 0.3s;
}

/* A reply quotes the message it answers; the composer shows what is being answered. */
.reply-quote {
  display: block;
  width: 100%;
  margin: 4px 0;
  padding: 4px 8px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-quote strong {
  color: var(--ink);
}
.reply-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 12px;
}
.reply-banner span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The settings of a room or topic, beside the conversation. */
.settings-section {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.settings-section h3 {
  margin: 0;
  font-size: 14px;
}
.settings-section p {
  margin: 0;
  font-size: 13px;
}
.settings-section .topic-rename {
  flex: none;
}
.settings-section .topic-rename label {
  flex: 1 1 100%;
  font-size: 12px;
  font-weight: 600;
}
.settings-section > button {
  justify-self: start;
}
.notify-options {
  display: grid;
  gap: 6px;
}
.notify-option {
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper);
  text-align: left;
}
.notify-option small {
  color: var(--muted);
  font-size: 12px;
}
/* The choice shows at once, like the Documento/Mudanças switch. */
.notify-option {
  transition: none;
}
.notify-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Searching people and conversations, at the top of the list. */
.convo-search {
  padding: 0 0 8px;
}
.convo-search input {
  width: 100%;
}
.convo-search-empty {
  margin: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}
.search-message {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
}
.search-message:hover,
.search-message:focus-visible {
  background: var(--surface-alt);
}
.search-message small {
  color: var(--muted);
  font-size: 11px;
}
.search-message span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.convo-search ~ * mark,
.search-message mark {
  background: color-mix(in srgb, var(--amber) 35%, transparent);
  color: inherit;
}
/* On a phone the search sits at the start of the strip; while searching, the results run down. */
@media (max-width: 700px) {
  .conversations .convo-search {
    flex: 0 0 160px;
    padding: 0;
  }
  .messenger .sidebar nav.conversations.searching {
    flex-direction: column;
    overflow-x: visible;
  }
  .conversations.searching .convo-search {
    flex: none;
    padding-bottom: 6px;
  }
  .conversations.searching .convo-group {
    display: block;
  }
  .conversations.searching .convo-group h3,
  .conversations.searching .convo-link-text small {
    display: block;
  }
}

/* A command the agent ran: one line until opened, then what it printed. */
/* Files the agent made, shown in the answer as the browser can: pictures, video, sound, PDF. */
.md .md-image,
.md .md-media {
  display: block;
  max-width: 100%;
  max-height: 520px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper);
}
.md .md-audio {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 8px 0;
}
.md .md-pdf {
  display: block;
  width: 100%;
  height: 520px;
  margin: 8px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}
.md a.md-file {
  display: inline-block;
}
.md details.terminal {
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-alt);
}
.md details.terminal summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  list-style-position: inside;
}
.md details.terminal summary code {
  overflow: hidden;
  padding: 0;
  background: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.md details.terminal pre {
  max-height: 320px;
  margin: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-control) var(--radius-control);
  font-size: 0.85em;
}
.md .terminal-state {
  flex: none;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85em;
}
.md details.terminal.falhou {
  border-color: var(--error-line);
}
.md details.terminal.falhou .terminal-state {
  color: var(--red);
}
.chat-terminal {
  margin-top: 10px;
}
.chat-terminal > p {
  margin: 0 0 4px;
  font-size: 0.85em;
}
.md details.terminal summary::-webkit-details-marker {
  display: none;
}
.md details.terminal summary::before {
  content: '▸';
  flex: none;
  color: var(--muted);
}
.md details.terminal[open] summary::before {
  content: '▾';
}

/* A command the person ran with "!": a small terminal in the thread, for them only. */
.chat-command {
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-alt);
}
.chat-command.failed {
  border-color: var(--error-line);
}
.chat-command-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}
.chat-command-head code {
  overflow: hidden;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-command-head .terminal-state {
  flex: none;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85em;
}
.chat-command.failed .terminal-state {
  color: var(--red);
}
.chat-command pre {
  overflow: auto;
  max-height: 360px;
  margin: 0;
  padding: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.85em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-command > p {
  margin: 0;
  padding: 4px 10px 6px;
  font-size: 0.8em;
}

/* "The shell is ready": the button that opens the Prévia, under the agent's note. */
.chat-opens {
  margin-top: 10px;
}

/* A SPEC published: the pipeline moved on, marked across the room's conversation. */
.chat-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--ink);
  font-size: 0.9em;
}
.chat-stage::before,
.chat-stage::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--accent);
  opacity: 0.5;
}
.chat-stage span {
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  text-align: center;
}
.chat-stage time {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.85em;
}

/* The Prévia: the project's screens running beside the conversation, isolated. */
.convo.with-drawer.wide {
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 62%);
}
.preview-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.preview-tools select {
  width: auto;
}
.preview-devices {
  display: inline-flex;
  gap: 4px;
}
.preview-stage {
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 420px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-alt);
}
.preview-frame {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
}
.preview-stage.mobile .preview-frame {
  width: 390px;
  max-width: 100%;
}
.preview-empty {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
}
.preview-empty p {
  margin: 0;
  color: var(--muted);
}
a.small.button {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  font-size: 0.85em;
  text-decoration: none;
}
.preview-devices button[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}
/* With the Prévia open the conversation is narrow: its title keeps one line. */
.convo.with-drawer.wide .convo-title small {
  display: none;
}

/* The development board: progress and forecast, then the plan's stages and their tasks. */
.board-summary {
  display: grid;
  gap: 8px;
}
.board-summary p {
  margin: 0;
}
.board-progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
  appearance: none;
}
.board-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--surface-alt);
}
.board-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}
.board-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}
.settings-section h3 .muted {
  font-weight: 400;
}
.board-tasks {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.board-task {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper);
}
.board-task.done {
  background: var(--surface);
}
.board-task.done .board-title {
  color: var(--muted);
}
.board-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.board-number {
  min-width: 22px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.board-title {
  flex: 1 1 200px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.board-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.team-tasks .tag.attention {
  border-color: var(--amber);
  color: var(--ink);
}
.team-tasks .tag.done {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.board-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 4px 0 0 30px;
  color: var(--muted);
  font-size: 13px;
}
.board-dep {
  color: var(--ink);
  font-weight: 600;
}
.board-dep.done {
  color: var(--accent);
  font-weight: 400;
}
.board-details {
  margin: 6px 0 0 30px;
  font-size: 13px;
}
.board-details summary {
  cursor: pointer;
  color: var(--muted);
}
.board-details h4 {
  margin: 12px 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.board-details ul {
  margin: 0;
  padding-left: 18px;
}
.board-details .md {
  margin-top: 8px;
}
.board-test {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.board-reviews .approved strong {
  color: var(--accent);
}
.board-reviews .rejected strong {
  color: var(--red);
}
.board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
@media (max-width: 700px) {
  .board-meta,
  .board-details {
    margin-left: 0;
  }
}

/* "Preparar o projeto": each step, and the choices where it stopped. */
.project-checklist > li.attention > strong {
  color: var(--amber);
}
.setup-details {
  grid-column: 1 / -1;
  margin-top: 2px;
}
.setup-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9em;
}
.setup-steps {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}
.setup-step {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
}
.setup-step p {
  margin: 2px 0 6px;
  color: var(--muted);
}
.setup-icon {
  font-weight: 700;
  text-align: center;
}
.setup-step.ok .setup-icon,
.setup-step.done .setup-icon {
  color: var(--accent);
}
.setup-step.warning .setup-icon,
.setup-step.needs_person .setup-icon {
  color: var(--amber);
}
.setup-step.error .setup-icon {
  color: var(--red);
}
.setup-conflict {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--amber);
  border-radius: var(--radius-card);
}
.setup-conflict h4,
.setup-conflict h5 {
  margin: 0 0 6px;
}
.setup-sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.setup-sides pre {
  overflow: auto;
  max-height: 220px;
  margin: 0;
  padding: 8px;
  border-radius: var(--radius-control);
  background: var(--surface-alt);
  font-size: 0.8em;
  white-space: pre-wrap;
}

/* Settings where they matter: a sheet over the page, opened from the agent's conversation or a
   project's room. One column of quiet sections, hairlines between them, no boxes in boxes. */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  animation: sheet-fade 0.18s ease-out;
}
.sheet {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 41;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(480px, 100vw);
  background: var(--paper);
  box-shadow: -12px 0 32px -16px color-mix(in srgb, var(--ink) 35%, transparent);
  animation: sheet-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheet-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@keyframes sheet-fade {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet-backdrop {
    animation: none;
  }
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px 24px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 {
  margin: 0;
  font-size: 18px;
}
.sheet-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.sheet-head button.icon {
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}
.sheet-head button.icon:hover {
  background: var(--surface-alt);
}
.sheet-body {
  overflow-y: auto;
  padding: 0 24px 32px;
  overscroll-behavior: contain;
}
.sheet-section,
.sheet-body > .settings-section {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.sheet-section:last-child,
.sheet-form > .sheet-section:last-of-type {
  border-bottom: 0;
}
.sheet-section h3,
.sheet-body > .settings-section h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.sheet-section p {
  margin: 0;
}
.sheet-section > .muted,
.sheet-section .muted {
  font-size: 13px;
}
.sheet-section label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 13px;
}
.sheet-section input:not([type='checkbox']):not([type='radio']),
.sheet-section textarea,
.page-narrow input:not([type='checkbox']):not([type='radio']) {
  border-radius: 10px;
  font-weight: 400;
}
.page-narrow .card > h2 {
  font-size: 16px;
}
.sheet-section textarea {
  resize: none;
  field-sizing: content;
  min-height: 72px;
}
.sheet-more > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
}
.sheet-more > summary::-webkit-details-marker {
  display: none;
}
.sheet-more > summary::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s;
}
.sheet-more[open] > summary::after {
  transform: translateY(1px) rotate(-135deg);
}
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}
.sheet-form > .sheet-actions {
  position: sticky;
  bottom: 0;
  margin: 0 -24px;
  padding: 12px 24px;
  background: linear-gradient(to top, var(--paper) 70%, transparent);
}
.sheet-actions button,
.row.end button {
  border-radius: 999px;
  padding-inline: 16px;
}
.row.end {
  justify-content: flex-end;
}
.sheet .agents-options {
  display: grid;
  gap: 6px;
}
.sheet .agents-option {
  border-radius: 12px;
}

/* Choices as pills: tap to wear a hat, to send a SPEC on, to give access to a project. */
.pill-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill-check {
  position: relative;
  display: inline-flex;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}
.pill-check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.pill-check span {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  transition:
    background 0.15s,
    color 0.15s;
}
.pill-check:hover span {
  color: var(--ink);
}
.pill-check input:checked + span {
  background: var(--accent-soft);
  color: var(--accent);
}
.pill-check input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.pill-check input:disabled {
  cursor: default;
}
.pill-check input:disabled + span {
  opacity: 0.6;
}
fieldset.plain {
  margin: 0;
  padding: 0;
  border: 0;
}
fieldset.plain legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

/* A project's size: three quiet choices, each with what it writes and an example. */
.size-options {
  display: grid;
  gap: 6px;
}
.size-choice legend {
  padding: 0;
}
.size-options .size-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  min-height: 44px;
}
.size-option span {
  gap: 2px;
}
.size-option small {
  font-size: 12px;
  line-height: 1.5;
}
.size-writer {
  margin: 0 0 10px;
}

/* A project's team: one row per agent, the hats it wears as pills. */
.team-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}
.team-row + .team-row {
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.team-row p {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.team-row small {
  font-size: 12px;
  color: var(--muted);
}

/* The pipeline as a diagram: each hat an ID card, each arrow a document going to who reads it.
   Laid out by itself (web/pipeline.ts); wide left to right, compact top to bottom. */
.page-narrow.page-wide {
  max-width: none;
}
.pipe {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.pipe-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 34px;
}
.pipe-bar p {
  max-width: 96ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.pipe-bar .row {
  gap: 8px;
}
.pipe-bar.dirty {
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-control);
  background: var(--warning-bg);
}
.pipe-bar.dirty p {
  color: var(--ink);
}
.pipe-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--error-line);
  border-radius: var(--radius-control);
  background: var(--error-bg);
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
}
.pipe-error:empty {
  display: none;
}
.pipe-error .pipe-glyph {
  margin-top: 2px;
}
.pipe-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
.pipe.with-panel:not(.small) .pipe-board {
  grid-template-columns: minmax(0, 1fr) 288px;
}
.pipe-frame {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-alt);
  overscroll-behavior-x: contain;
}
.pipe-frame.compact {
  display: none;
}
.pipe-frame.compact.only {
  display: block;
}
.pipe-svg {
  display: block;
  max-width: none;
  font-family: var(--font-family);
}
.pipe-frame .pipe-svg {
  margin: 0 auto;
}
.pipe-scroll-hint {
  display: none;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.pipe:has(.pipe-frame[data-overflow]) .pipe-scroll-hint {
  display: block;
}
.pipe-run,
.pipe-apart {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.pipe-apart {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.pipe-apart .pipe-glyph {
  margin-top: 1px;
}
.pipe-apart strong {
  color: var(--ink);
  font-weight: 600;
}

/* Arrows: quiet lines; the selected and the one just drawn in the accent. */
.pipe-edge-line {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
}
.pipe-arrow {
  fill: var(--muted);
}
.pipe-edge.quiet .pipe-edge-line {
  stroke: var(--line);
  stroke-dasharray: 4 4;
}
.pipe-arrow.quiet {
  fill: var(--line);
}
.pipe-edge.selected .pipe-edge-line,
.pipe-edge.fresh .pipe-edge-line {
  stroke: var(--accent);
  stroke-width: 2.2;
}
.pipe-arrow.selected {
  fill: var(--accent);
}
.pipe-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 10;
  pointer-events: stroke;
  cursor: pointer;
}
.pipe-edge:hover .pipe-edge-line {
  stroke: var(--ink);
}
.pipe-edge.selected:hover .pipe-edge-line {
  stroke: var(--accent);
}
.pipe-ghost {
  display: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  pointer-events: none;
}
.pipe-ghost.shown {
  display: inline;
}
.pipe-port {
  cursor: crosshair;
  touch-action: none;
}
.pipe-port-hit {
  fill: transparent;
}
.pipe-port-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}
.pipe-port:hover .pipe-port-dot,
.pipe-port.active .pipe-port-dot {
  fill: var(--accent);
}
.pipe-cut {
  cursor: pointer;
  outline: none;
}
.pipe-cut circle {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.pipe-cut path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}
.pipe-cut:hover circle {
  fill: var(--accent-soft);
}
.pipe-cut:focus-visible circle {
  stroke: var(--focus);
  stroke-width: 3;
}

/* The ID card: the hat, its document, who wears it, where the document stands. */
.pipe-fo {
  overflow: visible;
}
.pipe-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 9px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  text-align: left;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 7%, transparent);
  /* No easing here: a card moved or restyled by a re-render shows its new state at once. */
  transition: none;
}
button.pipe-node:hover {
  border-color: var(--muted);
  background: var(--surface);
}
.pipe-node:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.pipe-node.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.pipe-node-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.pipe-node-name {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pipe-tag {
  flex: none;
  color: var(--amber);
  font-size: 10.5px;
  font-weight: 500;
}
.pipe-tag.unsaved {
  color: var(--accent);
}
.pipe-node-doc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.pipe-node-who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  margin-top: auto;
  overflow: hidden;
  white-space: nowrap;
}
.pipe-node-who > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipe-node-who .avatar {
  width: 20px;
  height: 20px;
  margin-right: -3px;
  font-size: 8.5px;
  letter-spacing: 0;
  box-shadow: 0 0 0 1.5px var(--surface);
}
.pipe-node-who .avatar:last-of-type {
  margin-right: 0;
}
.pipe-node-who.nobody {
  color: var(--muted);
}
.pipe-node-who.cover {
  color: var(--amber);
}
.pipe-node-state {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
}
.pipe-node-state > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipe-node-note {
  margin-top: auto;
  color: var(--muted);
  font-style: italic;
}
.pipe-glyph {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pipe-glyph .fill {
  fill: currentColor;
  stroke: none;
}
/* Where the document stands: a calm tint, the words and an icon say it too. */
.pipe-node.state-done {
  border-color: var(--success-line);
  background: color-mix(in srgb, var(--success-bg) 60%, var(--surface));
}
.pipe-node.state-done .pipe-node-state {
  color: var(--success);
}
.pipe-node.state-draft,
.pipe-node.state-waiting {
  border-color: var(--warning-line);
  background: color-mix(in srgb, var(--warning-bg) 60%, var(--surface));
}
.pipe-node.state-draft .pipe-node-state,
.pipe-node.state-waiting .pipe-node-state {
  color: var(--amber);
}
.pipe-node.state-working {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  animation: pipe-working 2.4s ease-in-out infinite;
}
.pipe-node.state-working .pipe-node-state {
  color: var(--accent);
}
.pipe-node.state-working .pipe-glyph .fill {
  animation: pipe-dot 1.2s ease-in-out infinite;
}
.pipe-node.state-stuck {
  border-color: var(--error-line);
  background: color-mix(in srgb, var(--error-bg) 60%, var(--surface));
}
.pipe-node.state-stuck .pipe-node-state {
  color: var(--red);
}
.pipe-node.state-nobody {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}
@keyframes pipe-working {
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  }
}
@keyframes pipe-dot {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pipe-node.state-working,
  .pipe-node.state-working .pipe-glyph .fill {
    animation: none;
  }
}
/* Outside the project's size: there, quiet. Not saved yet: a dashed accent. */
.pipe-node.quiet {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  opacity: 0.66;
}
.pipe-node.unsaved {
  border-style: dashed;
  border-color: var(--accent);
}
.pipe-node.shell {
  justify-content: center;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}
.pipe-node.shell .pipe-node-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
.pipe-shell-state {
  color: var(--muted);
}
.pipe-node.shell.ready {
  border-style: solid;
  border-color: var(--accent);
}
.pipe-node.shell.ready .pipe-shell-state {
  color: var(--accent);
}
.pipe-node.shell.waiting .pipe-shell-state {
  color: var(--amber);
}
.pipe-node.shell.stuck .pipe-shell-state {
  color: var(--red);
}
/* Dragging a link: where it can land, and where it cannot. */
.pipe-svg.dragging .pipe-node {
  cursor: crosshair;
}
.pipe-node.drop-ok {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
.pipe-node.drop-bad {
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent);
}
.pipe-node.compact {
  justify-content: center;
  gap: 1px;
  padding: 5px 6px;
  border-radius: 9px;
}
.pipe-node.compact .pipe-node-name {
  font-size: 11px;
  line-height: 16px;
}
.pipe-node.compact .pipe-node-state {
  gap: 3px;
  font-size: 11px;
  line-height: 14px;
}
.pipe-node.compact .pipe-glyph {
  width: 11px;
  height: 11px;
}

/* The open hat's panel, beside the diagram (under it when there is no room). */
.pipe-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  font-size: 13px;
}
.pipe-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.pipe-panel h4 {
  margin: 0;
  font-size: 15px;
}
.pipe-panel p {
  margin: 0;
}
.pipe-panel .muted {
  font-size: 12.5px;
}
.pipe-panel-head button.icon {
  margin: -4px -6px 0 0;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}
.pipe-panel-head button.icon:hover {
  background: var(--surface-alt);
}
.pipe-panel .agents-checks {
  gap: 6px;
}
.pipe-panel label.agents-check {
  display: inline-flex;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  font-size: 12.5px;
}
.pipe-panel .agents-check.quiet {
  border-style: dashed;
}

/* The project's sheet opened wide for its diagram. */
.sheet.wide {
  width: min(1480px, calc(100vw - 40px));
}
@media (max-width: 720px) {
  .sheet.wide {
    width: 100vw;
  }
  .pipe-frame.wide {
    display: none;
  }
  .pipe-frame.compact {
    display: block;
  }
  .pipe-drag-hint {
    display: none;
  }
  .pipe.with-panel:not(.small) .pipe-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .pipe-bar .row,
  .pipe-bar .row button {
    flex: 1 1 auto;
  }
  .pipe-panel .agents-check {
    min-height: 44px;
  }
}

/* The account menu, at the foot of the sidebar. */
.sidebar-footer {
  position: relative;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: inherit;
}
.account-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.account-toggle:hover,
.account-toggle[aria-expanded='true'] {
  background: var(--surface-alt);
}
.account-toggle .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.account-toggle span {
  display: grid;
  min-width: 0;
}
.account-toggle strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-toggle small {
  font-size: 12px;
  color: var(--muted);
}
.account-menu {
  position: absolute;
  right: 10px;
  bottom: calc(100% - 4px);
  left: 10px;
  z-index: 30;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--ink) 30%, transparent);
  animation: sheet-fade 0.14s ease-out;
}
.account-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  text-align: left;
}
.account-menu button:hover,
.account-menu button:focus-visible {
  background: var(--surface-alt);
}
.account-menu svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.account-menu hr {
  margin: 4px 6px;
  border: 0;
  border-top: 1px solid var(--line);
}
.menu-toggle .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

/* "+" beside the projects: who runs the company starts one from the list itself. */
.convo-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.convo-add {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.convo-add:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

/* Settings pages (company, account): a reading width, a plain title, sections by hairlines. */
.page-narrow {
  max-width: 720px;
  padding-top: 32px;
}
.page-head {
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0;
  font-size: 26px;
}
.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}
.page-narrow .form,
.company-block {
  display: grid;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.page-narrow .form h2,
.company-block h2 {
  margin: 0;
  font-size: 16px;
}
.company-block h3 {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.page-narrow .card {
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.person-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.person-row + .person-row {
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.person-row div:first-child {
  display: grid;
  min-width: 0;
}
.person-row small {
  font-size: 12px;
  color: var(--muted);
}
.person-row .tag.attention,
.ops-table .tag.attention {
  border-color: var(--amber);
  color: var(--ink);
}
/* Where a person is connected, for the Enterprise Admin in Pessoas. */
.person-row:has(.person-access[open]) {
  align-items: flex-start;
}
.person-access {
  margin-top: 6px;
}
.person-access summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.person-access ul {
  display: grid;
  gap: 6px;
  margin: 6px 0 10px;
  padding: 0;
  list-style: none;
}
.person-access li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.person-access li span {
  display: grid;
  min-width: 0;
}
/* The sign-in screen's other ways in: the link by e-mail, back to the password. */
.signin-actions {
  display: grid;
  gap: 10px;
  margin: 16px 0 12px;
}
dialog .form {
  display: grid;
  gap: 12px;
}
dialog:has(form[data-form='project']) {
  width: min(520px, calc(100% - 30px));
  border-radius: 18px;
}

@media (max-width: 700px) {
  .sheet {
    width: 100vw;
  }
  .sheet-body {
    padding: 0 16px 24px;
  }
  .sheet-form > .sheet-actions {
    margin: 0 -16px;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  }
  .sheet-actions button,
  .pill-check span,
  .chat-opens button,
  .account-menu button {
    min-height: 44px;
  }
  .pill-check span {
    display: inline-flex;
    align-items: center;
  }
  .messenger.in-convo .menu-toggle {
    padding: 0 4px;
    border: 0;
    background: transparent;
  }
  /* On a phone the account menu rises from the bottom, over the conversation. */
  .messenger.in-convo.account-open .sidebar-footer {
    display: block;
    padding: 0;
    border: 0;
  }
  .messenger.in-convo .account-toggle {
    display: none;
  }
  .account-menu {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 10px 10px max(14px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }
  .page-narrow {
    padding-top: 16px;
  }
  .messenger.in-convo .convo-group h3 {
    display: none;
  }
}

/* The agent's name and face in its conversation open its settings. */
.convo-who,
.convo-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
.convo-who {
  border-radius: 999px;
}
.convo-name:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* A new 1-1: the agent's hello, then a few ways to start, as pills. */
.chat-missing {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(760px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 10px 10px 10px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--amber) 12%, var(--paper));
  font-size: 14px;
}
.chat-missing span {
  flex: 1;
}
.chat-missing button {
  flex: none;
  border-radius: 999px;
  padding-inline: 14px;
}
.chat-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0 32px;
}
.chat-ideas .chat-idea {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
}
.chat-ideas .chat-idea:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}
.chat-noproject {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.convo-name {
  cursor: pointer;
}
.messenger .convo-link.offline .avatar {
  position: relative;
  overflow: visible;
}
.messenger .convo-link.offline .avatar::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--amber);
}
@media (max-width: 700px) {
  .chat-missing {
    flex-wrap: wrap;
    width: calc(100% - 24px);
  }
  .chat-ideas {
    margin-left: 0;
  }
  .chat-ideas .chat-idea {
    min-height: 44px;
  }
}

/* Notices: a small pill at the top, over nothing that matters, gone in a few seconds. */
#toast {
  top: 14px;
  right: auto;
  bottom: auto;
  left: 50%;
  width: max-content;
  max-width: min(480px, calc(100vw - 32px));
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--ink) 50%, transparent);
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#toast.error {
  border: 0;
  background: var(--red);
  color: var(--paper);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #toast {
    animation: none;
  }
}
@media (max-width: 700px) {
  #toast,
  body:has(.messenger.in-convo) #toast {
    top: 10px;
    right: auto;
    bottom: auto;
    left: 50%;
    width: max-content;
  }
}

/* A primary action that cannot run yet reads as waiting, not as broken. */
button.primary:disabled {
  border-color: transparent;
  background: var(--surface-alt);
  color: var(--muted);
  opacity: 1;
  cursor: not-allowed;
}

/* Page titles: plain and the same everywhere, no label above them. */
.page-intro {
  align-items: flex-end;
  margin: 32px 0 20px;
}
.page-intro h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.01em;
}
.page-intro p {
  margin: 6px 0 0;
}
.page-narrow .page-intro {
  margin-top: 0;
}
.ops-advanced > summary {
  margin: 0;
}
.ops-advanced h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}
@media (max-width: 700px) {
  .page-intro {
    margin-top: 16px;
  }
}
.page-narrow .card:last-child {
  border-bottom: 0;
}
.chat-from strong {
  white-space: nowrap;
}
@media (max-width: 700px) {
  /* On a phone the conversation's header is one compact row. */
  .messenger.in-convo .convo-head {
    min-height: 0;
    padding: 8px 12px;
    gap: 10px;
  }
  .messenger.in-convo .convo-head .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .messenger.in-convo .convo-title h1 {
    font-size: 16px;
  }
  /* The name is a button, but not a tall one: the header stays one row. */
  .messenger .convo-head .convo-name,
  .messenger .convo-head .convo-who,
  .messenger .convo-title button.link {
    min-height: 0;
  }
  .messenger.in-convo .convo-title small {
    font-size: 12px;
  }
}

/* Origin files: what people already had, listed quietly in the project's sheet. */
.origin-field {
  display: grid;
  gap: 6px;
}
.origin-field > label {
  font-size: 12px;
  font-weight: 600;
}
.origin-field input[type='file'] {
  padding: 9px;
  font-size: 13px;
}
.origin-field small {
  font-size: 12px;
  line-height: 1.5;
}
.origin-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.origin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.origin-item:first-child {
  border-top: 0;
}
.origin-main {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
.origin-main a {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.origin-main a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.origin-main small {
  font-size: 12px;
  color: var(--muted);
}
.origin-state.done {
  color: var(--accent);
}
.origin-confirm {
  display: flex;
  gap: 6px;
}
button.origin-quiet {
  border-color: transparent;
  background: none;
  color: var(--muted);
}
button.origin-quiet:hover {
  background: var(--surface-alt);
  color: var(--ink);
}
button.origin-danger {
  border-color: var(--red);
  background: var(--red);
  color: var(--on-accent);
}
.origin-reading {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  background: var(--accent-soft);
  font-size: 13px;
}
.origin-reading[data-origin-state='waiting_approval'] {
  background: var(--surface-alt);
}
.origin-reading strong {
  font-weight: 600;
}
.origin-note {
  font-size: 13px;
  color: var(--muted);
}
.origin-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.origin-add small {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
}
.origin-pick {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.origin-pick:hover {
  background: var(--surface-alt);
}
.origin-pick:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.origin-sending {
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 700px) {
  .origin-pick,
  .origin-item button,
  .origin-reading button {
    min-height: 44px;
  }
  .origin-pick {
    padding: 0 14px;
  }
}

/* The project's room is its dashboard: a strip of stages, then what waits for a person, who
   works on what, and the mural; numbers and shortcuts in a side column (below, when narrow).
   Quiet surfaces: lines and space separate the parts, not boxes. */
.convo-main {
  container: convo / inline-size;
}
.dash-scroll {
  scroll-padding-top: 16px;
}
.dash {
  display: grid;
  gap: 24px;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 28px;
}
.dash h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.2px;
}
.dash-quiet {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.dash-section > h2 {
  margin-bottom: 12px;
}
.dash-section-head button.link,
.dash-step-detail button.link {
  font-size: 13px;
  text-decoration: none;
}
.dash-section-head button.link:hover {
  text-decoration: underline;
}

/* The stages, as one line of steps; the current one stands out. */
.dash-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.dash-step-button,
.dash-step-plain {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--ink);
  text-align: left;
}
.dash-step-button:hover {
  background: var(--surface-alt);
}
.dash-step.current .dash-step-button,
.dash-step.current .dash-step-plain,
.dash-step.open .dash-step-button {
  background: var(--accent-soft);
}
.dash-step-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border: 2px solid var(--line);
  border-radius: 50%;
}
.dash-step.done .dash-step-dot {
  background: var(--accent);
  border-color: var(--accent);
}
.dash-step.current .dash-step-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.dash-step.alert .dash-step-dot {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: none;
}
.dash-step.current.alert .dash-step-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 28%, transparent);
}
.dash-step-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.dash-step-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.dash-step.current .dash-step-name {
  color: var(--accent);
}
.dash-step-value {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.dash-step.todo .dash-step-value {
  color: var(--muted);
  font-weight: 500;
}

/* What a step opens under the strip: the documents, or the tasks. */
.dash-step-detail {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.dash-docs,
.dash-tasks {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-doc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  text-align: left;
}
.dash-doc small {
  margin-left: auto;
  font-size: 12px;
}
/* A document whose hat nobody wears, with the way to choose someone beside it. */
.dash-doc-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 8px;
}
.dash-doc-row .dash-doc {
  flex: 1 1 260px;
  width: auto;
}
.dash-doc-row > .link {
  margin-left: auto;
  padding: 0 10px 8px;
  font-size: 13px;
}
.dash-doc-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.dash-doc.done .dash-doc-dot {
  background: var(--accent);
}
.dash-doc.draft .dash-doc-dot,
.dash-doc.waiting .dash-doc-dot,
.dash-doc.stuck .dash-doc-dot {
  background: var(--amber);
}
.dash-tasks li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  font-size: 14px;
}
.dash-tasks li + li {
  border-top: 1px solid var(--line);
}

/* The main column and the side column. */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.dash-main {
  display: grid;
  gap: 32px;
  min-width: 0;
}
@container convo (min-width: 980px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr) 248px;
    gap: 40px;
  }
  .dash-side {
    position: sticky;
    top: 20px;
  }
}

/* What waits for a person: one line each, its action at hand. */
.dash-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--amber) 22%, transparent);
  font-size: 12px;
  vertical-align: 1px;
}
.dash-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-need {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
}
.dash-need-text {
  display: grid;
  gap: 2px;
  flex: 1 1 240px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
}
.dash-need-text span {
  color: var(--muted);
}
.dash-need-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* In the project's sheet: hats the PO's agent covers for now, above the pills. */
.team-covers {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-size: 14px;
}
.team-covers p {
  margin: 0;
}
.team-covers ul {
  margin: 6px 0;
  padding-left: 18px;
}
/* A hat the PO covers for now: work goes on, so it reads calmer than what is stuck. */
.dash-need.covered {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

/* Who works on what now, and what comes next. */
.dash-now-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-now {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}
.dash-now p {
  margin: 0;
  line-height: 1.45;
}
.dash-now .avatar {
  width: 28px;
  height: 28px;
}
.dash-now button.link,
.dash-next button.link {
  color: var(--ink);
  text-align: left;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.dash-sub {
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.dash-next {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
}
.dash-next li::marker {
  color: var(--muted);
}
.dash-next small {
  display: block;
  font-size: 12px;
}

/* The mural: what happened in the project, one feed; people talk in the topics. */
.mural {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mural-more {
  text-align: center;
}
.mural-event {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}
.mural-event-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.mural-event-body p {
  margin: 0;
  line-height: 1.5;
}
/* An agent's answer with no topic (an origin reading) keeps its lines. */
.mural-event.kind-answer .mural-event-body p {
  white-space: pre-line;
}
/* "+ Novo tópico" in the room's header: quiet, where people look for a place to talk. */
.convo-head button.quiet {
  border-color: transparent;
  background: none;
  color: var(--muted);
}
.convo-head button.quiet:hover {
  color: var(--ink);
}
/* On a phone the room's header keeps one line under its name, beside its actions. */
@media (max-width: 600px) {
  .dash-head .convo-title small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .convo-head button.quiet {
    padding-inline: 6px;
  }
}
.dash-topic-new {
  flex-wrap: nowrap;
  align-items: center;
  padding: 0;
}
.dash-topic-new input {
  flex: 1 1 180px;
  min-width: 0;
}
/* What people wrote in the room before it became the dashboard: kept, read-only. */
.mural-old {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.mural-old > button.link {
  color: var(--muted);
  font-size: 13px;
}
.mural-old-list {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.mural-old-head {
  margin: 0 0 2px;
  color: var(--muted);
}
.mural-old-head strong {
  color: var(--ink);
}
.mural-old-text > :first-child {
  margin-top: 0;
}
.mural-old-text > :last-child {
  margin-bottom: 0;
}
.mural-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin: 7px 4px 0;
  border-radius: 50%;
  background: var(--line);
}
.mural-event.kind-spec .mural-dot,
.mural-event.kind-shell .mural-dot,
.mural-event.kind-done .mural-dot,
.mural-event.kind-staging .mural-dot,
.mural-event.kind-release .mural-dot,
.mural-event.kind-origin .mural-dot {
  background: var(--accent);
}
.mural-event.kind-blocked .mural-dot {
  background: var(--red);
}
.mural-event.kind-fix .mural-dot {
  background: var(--amber);
}
.mural-event.kind-staging,
.mural-event.kind-release,
.mural-event.kind-shell,
.mural-event.kind-spec {
  font-weight: 600;
}
.mural-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.mural-meta button.link,
.mural-group button.link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.mural-meta button.link:hover,
.mural-group button.link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.mural-group {
  display: block;
}
.mural-group summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.mural-group summary::-webkit-details-marker {
  display: none;
}
.mural-group summary > .mural-event-body > span:first-child::after {
  content: ' ▾';
  color: var(--muted);
}
.mural-group[open] summary > .mural-event-body > span:first-child::after {
  content: ' ▴';
}
.mural-group ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0 28px;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

/* Numbers and shortcuts, beside the rest. */
.dash-side {
  display: grid;
  gap: 24px;
  min-width: 0;
}
.dash-side-part h2,
.dash-side-part > summary {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.dash-side-part p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
}
.dash-numbers {
  display: grid;
  gap: 2px;
  margin: 0;
}
.dash-numbers div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.dash-numbers div + div {
  border-top: 1px solid var(--line);
}
.dash-numbers dt {
  font-size: 13px;
  color: var(--muted);
}
.dash-numbers dd {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dash-links {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-link {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--accent);
  text-align: left;
}
.dash-link:hover {
  background: var(--surface-alt);
}
.dash-improvements summary {
  cursor: pointer;
}
.dash-improvements ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

/* On a phone: one column in the same order, steps as a short list, 44px to tap. */
@media (max-width: 700px) {
  .dash {
    width: calc(100% - 32px);
    gap: 20px;
    padding-top: 16px;
  }
  .dash-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 2px;
  }
  .dash-step-button,
  .dash-step-plain {
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
  }
  .dash-step-text {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex: 1;
    gap: 12px;
  }
  .dash-step-dot {
    margin-top: 0;
  }
  .dash-step-name {
    font-size: 13px;
  }
  .dash-step-value {
    text-align: right;
    font-size: 13px;
  }
  .dash-grid,
  .dash-main {
    gap: 28px;
  }
  .dash-side {
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
  .dash button:not(.msg-reply) {
    min-height: 44px;
  }
  .dash button.link {
    display: inline-flex;
    align-items: center;
  }
  .dash-link {
    min-height: 44px;
  }
}

/* What CAW watches for the 1-1 code session: a quiet band under the header, one line each
   (or a count that opens the list), with “Parar”. */
.chat-watch {
  margin: 0;
  padding: 4px 24px;
  list-style: none;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
}
.chat-watch ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.chat-watch li,
.chat-watch-many summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.chat-watch li p {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-watch-many summary {
  cursor: pointer;
}
.chat-watch-many li {
  padding-left: 16px;
}
.chat-watch-pulse {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: chat-watch-pulse 2s ease-in-out infinite;
}
@keyframes chat-watch-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-watch-pulse {
    animation: none;
  }
}
.chat-watch .chat-watch-stop {
  flex: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}
.chat-watch .chat-watch-stop:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
}
/* A monitor's notice: the summary in a line, the end of the output folded under it. */
.chat-note-watch {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.chat-note-watch > p {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}
.chat-note-watch details {
  width: min(100%, 640px);
  text-align: center;
}
.chat-note-watch summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.chat-watch-tail {
  margin: 6px 0 0;
  padding: 10px 12px;
  max-height: 280px;
  overflow: auto;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 700px) {
  .chat-watch {
    padding-inline: 16px;
  }
  .chat-watch .chat-watch-stop {
    min-height: 44px;
  }
}

/* Sua conta → Avisos: one line per channel, its action beside it (below it on a phone). */
.notice-channel {
  flex-wrap: wrap;
}
.notice-channel > div:first-child {
  flex: 1 1 260px;
}

/* A document's topic: the line after the last message already taken to the draft. */
.note-marker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.note-marker::before,
.note-marker::after {
  content: '';
  flex: 1;
  border-top: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
}
.note-marker span {
  max-width: 80%;
  text-align: center;
}
.note-marker.running span {
  color: var(--accent);
  animation: chat-watch-pulse 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .note-marker.running span {
    animation: none;
  }
}

/* The open document changed a moment ago: said beside its status, the changed parts marked. */
.spec-fresh {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.spec-changed {
  margin: 0 0 0 -12px;
  padding: 0 0 0 10px;
  border-left: 2px solid var(--accent);
}
.spec-behind {
  margin: 0;
  font-size: 13px;
}

/* The sidebar folds to a rail of marks; a document's topic opens in three columns.
   The rail keeps every item: faces, "#", topics by kind, the account; names show beside them on
   hover and focus. */
.sidebar-header .brand {
  margin-right: auto;
}
.sidebar-header {
  gap: 4px;
}
.messenger .sidebar-header .sidebar-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.messenger .sidebar-header .sidebar-toggle:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
}
.rail-search,
.topic-icon {
  display: none;
}
.rail-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.rail-tip {
  position: fixed;
  z-index: 60;
  max-width: 280px;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--ink) 50%, transparent);
}
.rail-tip[hidden] {
  display: none;
}
@media (min-width: 701px) {
  .messenger {
    transition: grid-template-columns 180ms cubic-bezier(0.2, 0, 0, 1);
  }
  .messenger .sidebar {
    transition: width 180ms cubic-bezier(0.2, 0, 0, 1);
  }
  .messenger.rail {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .messenger.rail .sidebar {
    z-index: 6;
    width: 64px;
    overflow: visible;
  }
  .messenger.rail .sidebar-header {
    justify-content: center;
    padding: 14px 0 6px;
  }
  .messenger.rail .sidebar-header .brand,
  .messenger.rail .sidebar-header > button:not(.sidebar-toggle) {
    display: none;
  }
  .messenger.rail .sidebar-header .sidebar-toggle,
  .messenger.rail .rail-search {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
  }
  .messenger.rail .rail-search:hover {
    background: color-mix(in srgb, var(--ink) 6%, transparent);
    color: var(--ink);
  }
  .messenger.rail .conversations {
    min-height: 0;
    justify-items: center;
    padding: 2px 8px 12px;
    overflow-x: hidden;
    scrollbar-width: none;
  }
  .messenger.rail .convo-search {
    display: none;
  }
  .messenger.rail .convo-group {
    justify-items: center;
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  .messenger.rail .convo-group h3,
  .messenger.rail .topic-link.add,
  .messenger.rail .topic-new {
    display: none;
  }
  .messenger.rail .convo-link {
    position: relative;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    gap: 0;
  }
  .messenger.rail .convo-link .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  .messenger.rail .convo-link-text,
  .messenger.rail .topic-title,
  .messenger.rail .topic-draft,
  .messenger.rail .topic-state,
  .messenger.rail .topic-done-label,
  .messenger.rail .account-toggle > span:not(.avatar) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  /* The open project's topics, gathered under its "#". */
  .messenger.rail .convo-topics {
    justify-items: center;
    gap: 2px;
    margin: 2px 0 4px;
    padding: 4px;
    border-left: 0;
    border-radius: 12px;
    background: color-mix(in srgb, var(--ink) 4%, transparent);
  }
  .messenger.rail .topic-link,
  .messenger.rail .topic-done summary {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 36px;
    padding: 0;
    font-weight: 400;
  }
  .messenger.rail .topic-done {
    display: grid;
    justify-items: center;
    gap: 2px;
  }
  .messenger.rail .topic-done summary {
    list-style: none;
  }
  .messenger.rail .topic-done summary::-webkit-details-marker {
    display: none;
  }
  .messenger.rail .topic-icon {
    display: inline-grid;
    place-items: center;
  }
  .messenger.rail .topic-link.unread,
  .messenger.rail .topic-done[open] > summary {
    color: var(--ink);
  }
  /* A draft waiting in a document: a small amber mark on its icon. */
  .messenger.rail .topic-link.draft .topic-icon::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 2px var(--surface-alt);
  }
  /* Unread counts become dots; the number stays in the button's name. */
  .messenger.rail .sidebar .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 0;
    width: 10px;
    height: 10px;
    padding: 0;
    font-size: 0;
    box-shadow: 0 0 0 2px var(--surface-alt);
  }
  .messenger.rail .topic-link .badge,
  .messenger.rail .topic-done summary .badge {
    top: 3px;
    right: 6px;
    width: 8px;
    height: 8px;
  }
  .messenger.rail .sidebar-footer {
    display: flex;
    justify-content: center;
    padding: 8px 0;
  }
  .messenger.rail .account-toggle {
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
  }
  .messenger.rail .account-menu {
    right: auto;
    left: 8px;
    width: 240px;
  }
}
@media (max-width: 700px) {
  .messenger .sidebar-header .sidebar-toggle {
    display: none;
  }
  .sidebar-header .brand {
    margin-right: 0;
  }
}

/* A document's topic on a wide screen: the conversation (about 40%) beside the document (60%),
   each at a reading width. The document minimizes to a rail; editing it folds the
   conversation to one. */
.doc-tabs {
  display: none;
}
.doc-rail,
.convo-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 14px 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}
.doc-rail {
  border-left: 1px solid var(--line);
}
.convo-rail {
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.doc-rail:hover,
.convo-rail:hover {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--ink);
}
.doc-rail:focus-visible,
.convo-rail:focus-visible {
  outline-offset: -4px;
}
.doc-rail-title,
.convo-rail-label {
  min-height: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  writing-mode: vertical-rl;
}
.doc-rail-state {
  flex: none;
  padding: 8px 2px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  writing-mode: vertical-rl;
}
.doc-rail-state.draft {
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
  color: var(--ink);
}
@media (min-width: 1101px) {
  .convo.doc-cols {
    grid-template-columns: minmax(340px, 2fr) minmax(0, 3fr);
  }
  .convo.doc-cols.doc-min {
    grid-template-columns: minmax(0, 1fr) 52px;
  }
  .convo.doc-cols.doc-edit {
    grid-template-columns: 0 52px minmax(0, 1fr);
  }
  .convo.doc-edit > .convo-main {
    visibility: hidden;
    overflow: hidden;
  }
  /* Beside the document the conversation's title keeps one line; the document names itself. */
  .convo.doc-cols .convo-title h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* The document's text keeps a reading width, centered in its column. */
  .convo.doc-cols .chat-spec {
    padding: 20px max(32px, calc((100% - 760px) / 2)) 40px;
  }
  .convo.doc-edit .chat-spec {
    padding-inline: max(32px, calc((100% - 880px) / 2));
  }
  .convo.doc-edit .spec-edit textarea {
    min-height: calc(100dvh - 240px);
  }
}

/* A narrower conversation (beside its document) keeps its buttons on one line; the hint wraps. */
.chat-composer-bar button {
  white-space: nowrap;
}

/* On a phone: two tabs under the topic's header, the conversation or the document. */
@media (max-width: 700px) {
  .doc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
  }
  .doc-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    transition: none;
  }
  .doc-tabs button:first-child {
    border-radius: var(--radius-control) 0 0 var(--radius-control);
  }
  .doc-tabs button:last-child {
    margin-left: -1px;
    border-radius: 0 var(--radius-control) var(--radius-control) 0;
  }
  .doc-tabs button[aria-selected='true'] {
    position: relative;
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
  }
  .convo.doc-tabs-on.show-doc {
    grid-template-rows: auto minmax(0, 1fr);
  }
  .convo.show-doc .convo-thread,
  .convo.show-doc .convo-compose {
    display: none;
  }
  .convo.show-doc .chat-spec {
    border-left: 0;
  }
}

/* Roles and the audit: Empresa → Papéis, each person's roles in Pessoas, the Auditoria page,
   “Sua atividade” in Sua conta, and whether the audit holds, in Operação. */
.role-card {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.role-card h3 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.role-card p {
  margin: 0;
  font-size: 13px;
}
.role-editor {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.page-narrow .role-editor {
  padding: 16px;
  border: 1px solid var(--line);
}
.role-editor h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}
.role-matrix {
  display: grid;
  gap: 16px;
}
.role-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px 16px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}
.role-group legend {
  padding: 0 6px;
  font-weight: 600;
}
.role-group > p {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: 12px;
}
.role-perm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  cursor: pointer;
}
.role-perm input {
  margin-top: 3px;
  flex: none;
}
.role-perm span {
  display: grid;
  gap: 2px;
}
.role-perm strong {
  font-weight: 500;
}
.role-perm small {
  color: var(--muted);
  font-size: 12px;
}
.role-perm.off {
  cursor: default;
}
.role-perm.off strong {
  color: var(--muted);
}
.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.person-roles {
  margin-top: 6px;
}
.person-roles summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.person-roles-form {
  display: grid;
  gap: 8px;
  margin: 4px 0 8px;
}
.person-row .person-roles-form .pill-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.person-roles-form p {
  margin: 0;
  font-size: 12px;
}
.tag.done {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.tag.attention {
  border-color: var(--amber);
}
.retention-form .row {
  align-items: center;
  gap: 8px;
}
.retention-form input[type='number'] {
  width: 110px;
}
.page-wide {
  max-width: 1180px;
  padding-top: 32px;
}
.audit-integrity {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-control);
  font-size: 13px;
  line-height: 1.6;
}
.audit-integrity.broken {
  border-color: var(--error-line);
  border-left-color: var(--red);
  background: var(--error-bg);
}
.card .audit-integrity {
  margin: 8px 0 0;
}
.audit-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.audit-filters label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.audit-filters select,
.audit-filters input {
  min-height: 36px;
  width: 100%;
  min-width: 0;
}
.audit-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
}
.audit-count {
  margin: 0 0 8px;
  font-size: 12px;
}
.audit-card {
  padding: 0;
  overflow-x: auto;
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.audit-table th,
.audit-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.audit-table thead th {
  border-top: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.audit-table td small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.audit-table time {
  white-space: nowrap;
}
.audit-change summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
}
.audit-change dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  margin: 4px 0 0;
  font-size: 12px;
}
.audit-change dt {
  color: var(--muted);
}
.audit-change dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.audit-page .empty {
  margin: 16px;
}
.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.activity-row + .activity-row {
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.activity-row div:first-child {
  display: grid;
  min-width: 0;
}
.activity-row small {
  font-size: 12px;
  color: var(--muted);
}
.activity-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}
/* On a phone the audit's rows become cards, each cell with its label. */
@media (max-width: 720px) {
  .messenger .tool-main:has(.audit-page) {
    padding: 0 16px 24px;
  }
  .audit-filters {
    grid-template-columns: 1fr 1fr;
  }
  .audit-table thead {
    display: none;
  }
  .audit-table,
  .audit-table tbody,
  .audit-table tr,
  .audit-table td {
    display: block;
    width: 100%;
  }
  .audit-table tr {
    padding: 10px 14px;
    border-top: 1px solid var(--line);
  }
  .audit-table td {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 8px;
    padding: 4px 0;
    border: 0;
  }
  .audit-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }
  .audit-table td > * {
    grid-column: 2;
    justify-self: start;
  }
  .audit-table td > :first-child {
    grid-row: 1;
  }
  .activity-row {
    flex-direction: column;
    gap: 4px;
  }
  .activity-meta {
    justify-items: start;
    text-align: left;
  }
}

/* Atividade da IA: the agents' turns (a tab of the Auditoria for who sees both), and each turn
   opened, the caixa-preta. Outputs, diffs and the conversation are whole: they scroll inside
   their box, never past the page. */
.audit-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.audit-tabs button {
  min-height: 36px;
  margin-bottom: -1px;
  padding: 6px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
}
.audit-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}
.ai-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  grid-column: 1 / -1;
}
.ai-filters .ai-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
}
.ai-filters .ai-check input {
  width: auto;
  min-height: 0;
}
.ai-preset {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  margin: 0 0 12px;
  font-size: 13px;
}
.ai-table button.ai-open {
  display: block;
  padding: 0;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
}
.ai-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.ai-badges:empty {
  display: none;
}
.ai-back {
  margin: 0 0 8px;
}
.ai-section {
  margin: 0 0 16px;
  padding: 16px 18px;
  min-width: 0;
}
.ai-section h2 {
  margin: 0 0 10px;
  font-size: 16px;
}
.ai-section h3 {
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.ai-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 13px;
}
.ai-facts dt {
  color: var(--muted);
}
.ai-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ai-facts code,
.ai-command-head code,
.ai-files code,
.ai-calls code,
.ai-permissions code {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.ai-timeline,
.ai-files,
.ai-did,
.ai-calls,
.ai-permissions {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ai-command,
.ai-did li,
.ai-calls li,
.ai-permissions li {
  padding: 10px 0;
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
  min-width: 0;
}
.ai-command:first-child,
.ai-did li:first-child,
.ai-calls li:first-child,
.ai-permissions li:first-child {
  border-top: 0;
  padding-top: 0;
}
.ai-command-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  justify-content: space-between;
}
.ai-command-head code {
  font-size: 13px;
  font-weight: 600;
}
.ai-command-state {
  font-size: 12px;
  color: var(--muted);
}
.ai-command.failed .ai-command-state {
  color: var(--red);
}
.ai-command-when {
  margin: 2px 0 6px;
  font-size: 12px;
}
.ai-pre {
  max-height: 60vh;
  margin: 6px 0 4px;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}
.ai-output,
.ai-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-diff {
  white-space: pre;
}
.ai-diff span {
  display: block;
  width: max-content;
  min-width: 100%;
}
.ai-diff .d-add,
.ai-file-count .d-add {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.ai-diff .d-del,
.ai-file-count .d-del {
  background: color-mix(in srgb, var(--red) 13%, transparent);
}
.ai-diff .d-hunk {
  color: var(--muted);
}
.ai-diff .d-file {
  margin-top: 8px;
  font-weight: 700;
}
.ai-diff .d-meta {
  color: var(--muted);
}
.ai-file-count .d-add,
.ai-file-count .d-del {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
}
.ai-file {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 13px;
}
.ai-file:first-child {
  border-top: 0;
}
.ai-file-state {
  font-size: 12px;
  color: var(--muted);
}
.ai-file.deleted .ai-file-state {
  color: var(--red);
}
.ai-file-count {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.ai-diff-block {
  margin-top: 10px;
}
.ai-did li,
.ai-calls li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  font-size: 13px;
}
.ai-did li > span {
  flex: 1 1 260px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ai-did li .ai-pre,
.ai-did li > button.link:last-child {
  flex-basis: 100%;
}
.ai-did small,
.ai-calls small,
.ai-calls span {
  font-size: 12px;
  color: var(--muted);
}
.ai-calls code {
  flex: 1 1 260px;
}
.ai-calls .ai-bad,
.ai-denied {
  color: var(--red);
}
.ai-allowed {
  color: var(--accent);
}
.ai-permissions p {
  margin: 4px 0 0;
  font-size: 13px;
}
.ai-gone {
  font-size: 12px;
}
/* Under an agent's answer, quiet: the way to what the turn did. */
.chat-turn-link {
  margin-top: 4px;
  padding-left: 32px;
}
.chat-turn-link button.link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.chat-turn-link button.link:hover,
.chat-turn-link button.link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}
@media (max-width: 700px) {
  .chat-turn-link {
    padding-left: 0;
  }
}
@media (max-width: 720px) {
  .messenger .tool-main:has(.ai-page) {
    padding: 0 16px 24px;
  }
  .ai-section {
    padding: 14px;
  }
  .ai-facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .ai-facts dd {
    margin-bottom: 8px;
  }
  .ai-file {
    grid-template-columns: 1fr auto;
  }
  .ai-file-state {
    grid-column: 1 / -1;
  }
  .ai-pre {
    max-height: 70vh;
  }
}
