/* 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.danger {
  color: var(--red);
}
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: 10px;
  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;
}
.nav-caption {
  font-size: 11px;
  letter-spacing: 1.8px;
  margin: 24px 12px 8px;
  color: var(--muted);
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 11px;
  color: var(--muted);
}
.sidebar-bottom p {
  margin: 7px 0;
}
.online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--sage);
  border-radius: 50%;
  margin-right: 6px;
}
.sidebar-bottom button {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  margin-top: 10px;
  font-size: 11px;
}
.main {
  grid-column: 2;
  padding: 0 42px 40px;
  min-width: 0;
}
.topbar {
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
  gap: 15px;
}
.topbar .breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.topbar strong {
  color: var(--ink);
  font-weight: 600;
}
.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: 10px;
  letter-spacing: 0.4px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: nowrap;
}
.tag.green {
  background: var(--success-bg);
  border-color: var(--success-line);
  color: var(--success);
}
.tag.amber {
  background: var(--warning-bg);
  border-color: var(--warning-line);
  color: var(--amber);
}
.tag.red {
  background: var(--error-bg);
  border-color: var(--error-line);
  color: var(--red);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--surface);
}
.stat {
  padding: 20px 23px;
  border-right: 1px solid var(--line);
}
.stat:last-child {
  border: 0;
}
.stat .number {
  font-size: 30px;
  margin: 9px 0 5px;
  font-weight: 600;
  letter-spacing: -1px;
}
.stat small {
  font-size: 11px;
}
.grid {
  display: grid;
  gap: 20px;
}
.grid.two {
  grid-template-columns: 1.5fr 1fr;
}
.grid.equal {
  grid-template-columns: 1fr 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;
}
.card-title {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-bottom: 20px;
}
.card-title h2,
.card-title h3 {
  margin: 0;
}
.empty {
  padding: 35px 20px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  border: 1px dashed var(--line);
  border-radius: 4px;
}
.empty strong {
  display: block;
  color: var(--ink);
  margin-bottom: 7px;
}
.stage-list {
  display: grid;
  gap: 0;
}
.stage-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.stage-item:last-child {
  border: 0;
}
.stage-number {
  border: 1px solid var(--line);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
}
.stage-item h3 {
  margin: 0 0 5px;
}
.stage-item p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.activity {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.activity:last-child {
  border: 0;
}
.activity-mark {
  width: 8px;
  height: 8px;
  background: var(--sage);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.activity p {
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}
.activity small {
  font-size: 10px;
}
.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;
}
.chat-history {
  min-height: 260px;
  max-height: 480px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 5px 0 20px;
}
.chat-bubble {
  padding: 15px 18px;
  border-radius: 4px;
  background: var(--surface-alt);
  max-width: 90%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
  font-size: 13px;
}
.chat-bubble.human {
  align-self: flex-end;
  background: var(--accent-soft);
}
.chat-bubble .eyebrow {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
}
.chat-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}
.chat-form textarea {
  min-height: 75px;
}
.run-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  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;
}
.code {
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.logs {
  background: var(--log-bg);
  color: var(--log-ink);
  font-family: var(--font-mono);
  white-space: pre-wrap;
  padding: 20px;
  border-radius: 4px;
  max-height: 480px;
  overflow: auto;
  font-size: 11px;
  line-height: 1.8;
}
.terminal-view {
  display: grid;
  gap: 14px;
}
.terminal-intro,
.terminal-run-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.terminal-intro {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--surface-alt);
  border-radius: 5px;
}
.terminal-intro h3,
.terminal-intro p {
  margin: 0;
}
.terminal-intro p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}
.terminal-active {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}
.terminal-active > h4,
.terminal-run-history > h4,
.terminal-files > h4,
.terminal-checks > h4 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.terminal-run {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-alt);
}
.terminal-run-header {
  align-items: center;
}
.terminal-run-header strong {
  color: var(--accent);
}
.terminal-run-header span {
  color: var(--muted);
}
.terminal-summary,
.terminal-note {
  margin: 9px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.terminal-note {
  padding: 9px 11px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
}
.terminal-live,
.terminal-files,
.terminal-checks {
  margin-top: 12px;
}
.terminal-live,
.terminal-files details,
.terminal-events,
.terminal-technical {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
.terminal-live > summary,
.terminal-files details > summary,
.terminal-events > summary,
.terminal-technical > summary {
  cursor: pointer;
  padding: 9px 11px;
  color: var(--text);
  font-weight: 600;
}
.terminal-live > .markdown {
  padding: 0 12px 12px;
  max-height: 55vh;
  overflow: auto;
}
.terminal-files {
  display: grid;
  gap: 7px;
}
.terminal-files details > summary span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.terminal-files pre.logs {
  margin: 0;
  max-height: 60vh;
  border-radius: 0 0 4px 4px;
}
.terminal-checks p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.terminal-run-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.terminal-events {
  padding: 0 12px;
}
.terminal-event {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
}
.terminal-event:first-of-type {
  border-top: 0;
}
.terminal-event time {
  color: var(--muted);
  font:
    11px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.terminal-event strong {
  font-size: 12px;
}
.terminal-event p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.terminal-run-history {
  display: grid;
  gap: 8px;
}
.terminal-technical {
  padding: 0 12px;
}
.terminal-technical pre {
  margin: 0 0 12px;
}
@media (max-width: 650px) {
  .terminal-intro {
    flex-direction: column;
  }
  .terminal-event {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.doc-list button {
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 11px;
}
.editor {
  min-height: 360px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.markdown {
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.markdown h1 {
  font-size: 27px;
}
.markdown h2 {
  font-size: 21px;
}
.markdown h3 {
  font-size: 17px;
}
.markdown pre {
  background: var(--surface-alt);
  padding: 15px;
  white-space: pre-wrap;
  border-radius: 4px;
}
.markdown ul {
  padding-left: 20px;
}
.markdown code {
  background: var(--surface-alt);
  font-size: 12px;
  padding: 2px 4px;
}
.form {
  display: grid;
  gap: 17px;
}
.task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.task:last-child {
  border: 0;
}
.task h3 {
  margin-bottom: 7px;
}
.task p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.task .row {
  align-content: flex-start;
}
.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;
}
.checks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.checks input {
  width: auto;
}
.login {
  width: min(470px, calc(100% - 40px));
  margin: 12vh auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  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%;
}
.path {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--on-accent);
  padding: 13px 20px;
  border-radius: 4px;
  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:not(:has(.message-context-menu)) #dialog-body {
  max-height: calc(85vh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
dialog::backdrop {
  background: var(--backdrop);
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 20px;
  padding: 2px 9px;
}
.diff-add {
  background: var(--success-bg);
  display: block;
}
.diff-remove {
  background: var(--error-bg);
  display: block;
}
.diff {
  font:
    11px/1.8 ui-monospace,
    monospace;
  white-space: pre-wrap;
}
.asset-frame {
  width: 100%;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.ux-preview-panel {
  margin: 0 18px 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised, var(--surface));
}
.ux-preview-panel > summary {
  cursor: pointer;
  font-weight: 650;
}
.ux-preview-panel .asset-frame {
  display: block;
  height: min(62vh, 620px);
  margin: 10px 0 6px;
  background: var(--asset-frame);
}
.ux-preview-panel > small {
  color: var(--muted);
}
.asset-image {
  max-width: 100%;
  max-height: 450px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table th {
  text-align: left;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.table td,
.table th {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.footer-note {
  font-size: 11px;
  margin-top: 22px;
  color: var(--muted);
}
.mobile-brand {
  display: none;
}
.error-panel {
  padding: 20px;
  border: 1px solid var(--error-line);
  border-radius: 4px;
  color: var(--red);
  background: var(--error-bg);
}
.spinner {
  width: 12px;
  height: 12px;
  display: inline-block;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@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.equal {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .doc-layout {
    grid-template-columns: 1fr;
  }
  .doc-list {
    flex-direction: row;
    overflow: auto;
  }
  .doc-list button {
    min-width: 180px;
  }
  .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,
  .sidebar-bottom,
  .nav-caption {
    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;
  }
  .topbar {
    height: 60px;
    margin-bottom: 22px;
  }
  .page-intro {
    flex-direction: column;
  }
  .stat {
    padding: 15px;
  }
  .card {
    padding: 18px;
  }
  .stats {
    margin-bottom: 20px;
  }
  .stage-item {
    grid-template-columns: 27px 1fr auto;
    gap: 8px;
  }
  .task {
    grid-template-columns: 1fr;
  }
  .login {
    padding: 28px;
  }
  .tag {
    font-size: 11px;
  }
  .tabs {
    gap: 20px;
  }
}

.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-bubble.streaming {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  color: var(--muted);
  font-size: 12px;
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
}
.typing-dots i {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing-pulse 1.2s ease-in-out infinite;
}
.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing-pulse {
  0%,
  70%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots i {
    animation: none;
    opacity: 0.7;
  }
}

.sidebar button.nav .nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  text-align: center;
  letter-spacing: 0;
  font-weight: 700;
}
.sidebar button.nav .nav-badge.needs-answer {
  background: var(--warning-bg);
}
.chat-bubble.progress {
  background: var(--surface-alt);
  border: 1px dashed var(--line);
  font-size: 13px;
}
.consultation-panel {
  border: 1px solid var(--line);
  background: var(--surface-alt);
  border-radius: 4px;
  padding: 16px;
  margin: 12px 0 20px;
}
.consultation-panel p {
  margin-bottom: 8px;
}
.decision-in-chat {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

/* Compact bubbles size themselves to the text instead of filling the flex row. */
.chat-history {
  gap: 10px;
}
.chat-bubble {
  align-self: flex-start;
  width: fit-content;
  max-width: min(90%, 720px);
  padding: 10px 13px;
  line-height: 1.5;
  white-space: normal;
}
.chat-bubble .eyebrow {
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.chat-bubble.human {
  align-self: flex-end;
}
.chat-bubble.progress {
  padding: 8px 12px;
}
.settings-personal {
  margin-bottom: 20px;
}
.agent-profile {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
}
.agent-profile summary {
  cursor: pointer;
  font-weight: 600;
}
.agent-profile[open] summary {
  margin-bottom: 16px;
}
.agent-profile textarea {
  min-height: 110px;
}
.sidebar button.nav > span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Keep all navigation reachable when the fixed sidebar exceeds the viewport. */
.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;
  }
}

.group-members {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) repeat(3, minmax(65px, auto));
  gap: 12px;
  align-items: center;
  overflow-x: auto;
}

.access-grid label {
  margin: 0;
  text-align: center;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}

.reply-preview {
  /* impeccable-disable-next-line side-tab: quoted reply, the messaging convention */
  border-left: 3px solid var(--line);
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.chat-bubble.interrupted {
  opacity: 0.7;
  border: 1px dashed var(--line);
}

* {
  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: 4px;
    background-clip: padding-box;
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: var(--scroll-thumb-hover);
  }
}

@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
    scrollbar-width: auto;
  }
}

.provider-login-output {
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.provider-connect {
  max-width: 780px;
}
.provider-login-link {
  font-weight: 600;
}
.provider-auth-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin: 12px 0;
}
.provider-auth-value .row {
  display: flex;
  min-width: 0;
  gap: 8px;
}
.provider-auth-value input {
  min-width: 0;
  font-family: var(--font-mono);
}
.provider-auth-code {
  letter-spacing: 0.08em;
}
@media (max-width: 560px) {
  .provider-auth-value {
    grid-template-columns: 1fr;
  }
  .provider-auth-value > button {
    justify-self: start;
  }
}

.chat-team {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}
.chat-team summary {
  cursor: pointer;
}
.chat-team .row {
  padding: 6px 0;
}
#chat-pending {
  scroll-margin: 16px;
}

/* Working surfaces follow the document grid rather than a stack of floating cards. */
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: 3px;
  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;
}
.nav-caption {
  margin-top: 27px;
}
.topbar {
  height: 72px;
}
.card {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 22px 0;
}
.grid {
  gap: 28px;
}
.card-title {
  margin-bottom: 18px;
}
.stats {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: transparent;
}
.stat {
  padding: 18px 22px;
}
.stat .number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  letter-spacing: -1px;
}
.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);
}
.stage-number {
  border-radius: 3px;
  font-family: var(--font-mono);
}
.chat-bubble {
  border-radius: 4px;
}
.chat-bubble.human {
  border: 1px solid var(--line);
}
.notice {
  border-left-color: var(--focus);
}
.table {
  font-variant-numeric: tabular-nums;
}
.table th {
  background: var(--surface-alt);
  font-weight: 600;
}
.table th,
.table td {
  padding: 13px 14px;
  vertical-align: top;
}
.table tbody tr:hover {
  background: var(--surface-alt);
}
.table td:has(> .code) {
  font-family: var(--font-mono);
}
.consumption-table th:nth-child(n + 3),
.consumption-table td:nth-child(n + 3) {
  text-align: right;
}
.consumption-table td:nth-child(n + 3) {
  font-family: var(--font-mono);
}
.table td.code {
  text-align: left;
}
.code,
.path,
.logs,
.editor,
.diff,
.markdown code {
  font-family: var(--font-mono);
}
.path {
  font-size: 11px;
}
.sidebar button.nav .nav-badge {
  border-radius: 3px;
  background: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--line);
}
.sidebar button.nav .nav-badge.needs-answer {
  background: var(--warning-bg);
  color: var(--amber);
  border-color: var(--warning-line);
}
#toast {
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--focus);
  border-radius: 4px;
}
#toast.error {
  background: var(--error-bg);
  color: var(--red);
  border-color: var(--error-line);
}
.login {
  border-radius: 6px;
}
.login .brand {
  color: var(--ink);
}
.typing-dots i {
  background: var(--focus);
}
@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;
  }
  .table th,
  .table td {
    padding: 10px 8px;
  }
  .stat {
    padding: 15px;
  }
  .topbar {
    height: auto;
    min-height: 60px;
    padding: 12px 0;
    flex-wrap: wrap;
  }
}
@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;
}

/* Conversation workspace: independent list, timeline and composer. */
.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: 8px;
}
.sidebar-header button {
  border: 0;
  background: transparent;
  font-size: 18px;
}
.messenger .workspace-picker {
  margin: 0;
  padding: 10px 20px 18px;
  font-size: 10px;
  letter-spacing: 1px;
}
.workspace-picker select {
  font-size: 12px;
  letter-spacing: 0;
}
.conversation-list-heading {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}
.conversation-list-heading h2 {
  font-size: 20px;
  margin-bottom: 3px;
}
.conversation-list-heading small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.conversation-list {
  display: flex;
  flex-direction: column;
}
.conversation-entry {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  padding: 15px 20px;
  border: 0;
  border-radius: 0;
  text-align: left;
  background: transparent;
  position: relative;
}
.conversation-entry + .conversation-entry::after {
  content: '';
  position: absolute;
  top: 0;
  left: 76px;
  right: 20px;
  height: 1px;
  background: var(--line);
  opacity: 0.5;
}
.conversation-entry.active {
  background: var(--accent-soft);
}
.conversation-entry.active::before {
  content: '';
  width: 3px;
  background: var(--focus);
  position: absolute;
  inset: 12px auto 12px 0;
}
.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;
}
.avatar.large {
  width: 88px;
  height: 88px;
  font-size: 26px;
  margin-bottom: 15px;
}
.conversation-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.conversation-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.conversation-title strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-title small {
  font:
    10px ui-monospace,
    'Courier New',
    monospace;
}
.conversation-preview {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-role {
  font-size: 10px;
  color: var(--muted);
}
.conversation-badge {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  text-align: center;
  background: var(--accent);
  color: var(--on-accent);
}
.conversation-badge.needs-answer {
  color: var(--amber);
  background: var(--warning-bg);
  border: 1px solid var(--warning-line);
}
.project-tools {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 16px 14px;
}
.project-tools > summary {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
}
.project-tools nav {
  padding-top: 10px;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 10px;
  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;
}
.messenger .chat-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.conversation-header {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 28px;
  min-height: 78px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.conversation-details {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 0;
  min-width: 0;
}
.conversation-details:hover {
  background: transparent;
}
.conversation-details > span:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.conversation-details strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.conversation-details small {
  font-size: 11px;
}
.mobile-back {
  display: none;
}
.chat-main > .tabs {
  padding: 0 28px;
  margin: 0;
  gap: 22px;
  flex-shrink: 0;
}
.chat-main > .tabs button {
  padding: 10px 0;
  font-size: 11px;
}
.chat-main > .card:not(.chat-panel),
.chat-main > .doc-layout {
  margin: 0;
  padding: 24px 28px;
  overflow: auto;
  min-height: 0;
}
.chat-main .chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border: 0;
  padding: 0;
  margin: 0;
}
.chat-panel .chat-meta,
.chat-panel .group-members {
  display: none;
}
.chat-panel .chat-history {
  min-height: 0;
  max-height: none;
  flex: 1;
  overflow-y: auto;
  padding: 26px clamp(20px, 4vw, 64px);
  gap: 12px;
}
.chat-history > .empty {
  align-self: center;
  margin: auto;
  background: transparent;
  max-width: 400px;
}
.chat-panel .chat-form {
  flex-shrink: 0;
  padding: 14px 28px 12px;
  background: var(--surface);
  gap: 8px;
}
.chat-form .message-label {
  flex: 1;
  min-width: 0;
}
.composer-input {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.chat-form textarea {
  min-height: 44px;
  height: 44px;
  max-height: 160px;
  padding: 10px 12px;
  font-weight: 400;
  font-size: 13px;
}
.attach-button {
  width: 40px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 23px;
  padding: 0;
  flex-shrink: 0;
}
.send-button {
  height: 44px;
  flex-shrink: 0;
}
.composer-help {
  font-size: 10px;
  color: var(--muted);
  padding-left: 50px;
}
.composer-help summary {
  cursor: pointer;
}
.composer-help small {
  display: block;
  padding-top: 5px;
  line-height: 1.6;
}
.chat-panel .consultation-panel {
  margin: 0 28px 8px;
  padding: 10px 12px;
  font-size: 11px;
  max-height: 110px;
  overflow: auto;
}
.chat-bubble {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 32px 12px 14px;
  max-width: min(85%, 720px);
}
.chat-bubble.human {
  background: var(--accent-soft);
}
.chat-bubble .eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: none;
}
.message-options {
  position: absolute;
  right: 5px;
  top: 4px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  opacity: 0;
}
.chat-bubble:hover .message-options,
.chat-bubble:focus-within .message-options {
  opacity: 1;
}
.message-options:focus-visible {
  opacity: 1;
}
.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.composer-attachment {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  max-width: 100%;
}
.composer-attachment span {
  overflow-wrap: anywhere;
}
.chat-attachment {
  margin-top: 9px;
  max-width: 360px;
}
.attachment-image {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}
.attachment-image img {
  display: block;
  max-width: 100%;
  max-height: 300px;
  border-radius: 3px;
}
.attachment-file {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 0;
  font-size: 12px;
}
.attachment-file > span:nth-child(2) {
  flex: 1;
  overflow-wrap: anywhere;
}
.attachment-file small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}
.chat-attachment audio {
  max-width: 100%;
  height: 40px;
}
.conversation-profile {
  text-align: center;
  margin-bottom: 24px;
}
.conversation-profile p {
  font-size: 12px;
  color: var(--muted);
}
.conversation-profile + .form {
  margin-bottom: 28px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
dialog:has(.message-context-menu) {
  width: 220px;
  padding: 6px;
  margin: auto;
}
dialog:has(.message-context-menu)[style*='left:'] {
  margin: 0;
}
dialog:has(.message-context-menu)::backdrop {
  background: transparent;
}
dialog:has(.message-context-menu) .dialog-close {
  display: none;
}
.message-context-menu {
  display: grid;
  gap: 3px;
}
.message-context-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
}
.message-context-menu button:hover {
  background: var(--surface-alt);
}
@media (hover: none) {
  .message-options {
    opacity: 1;
  }
}
@media (min-width: 1700px) {
  .messenger {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .messenger {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .conversation-header,
  .chat-panel .chat-form {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (max-width: 650px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }
  dialog:not(:has(.message-context-menu)) {
    position: fixed;
    inset: 5dvh 10px auto;
    margin: 0 auto;
    width: calc(100vw - 20px);
    max-width: none;
    max-height: 90dvh;
    padding: 18px 14px 14px;
    overflow: hidden;
    scroll-behavior: auto;
  }
  dialog:not(:has(.message-context-menu)) #dialog-body {
    max-height: calc(90dvh - 64px);
    padding-top: 44px;
  }
  dialog:not(:has(.message-context-menu)) .dialog-close {
    position: absolute;
    z-index: 2;
    top: 6px;
    right: 6px;
    background: var(--surface);
  }
  dialog:not(:has(.message-context-menu)) .row {
    flex-wrap: wrap;
  }
  dialog:not(:has(.message-context-menu)) .row > button {
    flex: 1 1 auto;
  }
  dialog:not(:has(.message-context-menu)) input,
  dialog:not(:has(.message-context-menu)) textarea,
  dialog:not(:has(.message-context-menu)) select {
    font-size: 16px;
  }
  .messenger {
    display: block;
  }
  .messenger .sidebar {
    height: 100dvh;
  }
  .messenger .sidebar .brand {
    font-size: 40px;
  }
  .messenger .sidebar .brand small {
    display: block;
  }
  .messenger .sidebar nav {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .messenger .main {
    display: none;
  }
  .messenger.conversation-open .sidebar {
    display: none;
  }
  .messenger.conversation-open .main {
    display: flex;
    grid-column: auto;
  }
  .messenger.conversation-open .tool-main {
    display: block;
    padding: 0 18px 24px;
  }
  .mobile-back {
    display: block;
    border: 0;
    padding: 6px;
  }
  .conversation-header {
    padding: 12px;
    gap: 8px;
  }
  .conversation-details {
    flex: 1;
    gap: 8px;
  }
  .conversation-details small {
    font-size: 10px;
  }
  .conversation-details .avatar {
    width: 36px;
    height: 36px;
  }
  .chat-main > .tabs {
    padding: 0 16px;
    gap: 18px;
  }
  .chat-panel .chat-history {
    padding: 18px 12px;
  }
  .chat-panel .chat-form {
    padding: 10px 12px;
  }
  .chat-panel .consultation-panel {
    margin-left: 12px;
    margin-right: 12px;
  }
  .chat-bubble {
    max-width: 94%;
  }
  .message-options {
    opacity: 1;
  }
  .send-button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .composer-input {
    gap: 6px;
  }
  .composer-help {
    padding-left: 40px;
  }
}

.no-conversations {
  padding: 8px 20px 20px;
  font-size: 12px;
}
.company-shortcut {
  padding: 0 20px 16px;
}
.company-shortcut button {
  width: 100%;
  text-align: left;
}
.company-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow: auto;
  margin-bottom: 20px;
}

/* Familiar messenger proportions, expressed in the Ze neutral/petroleum palette. */
.messenger {
  grid-template-columns: 360px minmax(0, 1fr);
}
.sidebar-header {
  padding: 16px 20px 10px;
}
.sidebar-header .brand small {
  margin-top: 5px;
}
.messenger .workspace-picker {
  padding: 8px 20px 12px;
}
.conversation-list-heading {
  padding: 12px 20px 8px;
}
.conversation-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 16px 12px;
  padding: 0 12px;
  background: var(--surface-alt);
  border-radius: 8px;
}
.conversation-search > span {
  font-size: 24px;
  color: var(--muted);
}
.conversation-search input {
  background: transparent;
  border: 0;
  min-width: 0;
  padding: 10px 0;
  font-size: 13px;
}
.conversation-search:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.conversation-entry {
  padding: 13px 16px;
  gap: 12px;
}
.conversation-entry[hidden] {
  display: none;
}
.conversation-entry .avatar {
  width: 48px;
  height: 48px;
}
.conversation-entry.active {
  background: var(--surface-alt);
}
.conversation-entry.active::before {
  display: none;
}
.conversation-title strong {
  font-size: 14px;
}
.conversation-preview {
  font-size: 13px;
}
.conversation-role {
  display: none;
}
.conversation-header {
  min-height: 68px;
  padding: 10px 22px;
}
.chat-main > .tabs {
  gap: 18px;
  padding: 0 22px;
  background: var(--surface);
}
.chat-main > .tabs button {
  padding: 7px 0;
  font-size: 10px;
}
.chat-panel .chat-history {
  gap: 7px;
  padding: 24px clamp(18px, 5vw, 80px);
  background-color: var(--paper);
  background-image: radial-gradient(var(--line) 0.6px, transparent 0.6px);
  background-size: 24px 24px;
}
.chat-panel .chat-bubble {
  padding: 8px 28px 8px 12px;
  border: 0;
  border-radius: 0 8px 8px 8px;
  max-width: min(78%, 680px);
  font-size: 13px;
  box-shadow: 0 1px 0 var(--line);
}
.chat-panel .chat-bubble.human {
  background: var(--accent-soft);
  border-radius: 8px 0 8px 8px;
}
.chat-panel .po-action-message {
  border: 1px solid var(--line);
  background: var(--surface);
}
.po-action-message p {
  margin: 5px 0 8px;
}
.chat-panel .chat-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -6px;
  /* impeccable-disable-next-line border-accent-on-rounded: bubble tail drawn with borders */
  border-top: 7px solid var(--surface);
  border-left: 7px solid transparent;
}
.chat-panel .chat-bubble.human::before {
  left: auto;
  right: -6px;
  border-left: 0;
  border-right: 7px solid transparent;
  border-top-color: var(--accent-soft);
}
.chat-panel .chat-form {
  padding: 10px 20px 8px;
}
.chat-form textarea {
  background: var(--paper);
  border-color: transparent;
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 46px;
}
.composer-input {
  align-items: center;
}
.send-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
}
.composer-help {
  padding-left: 50px;
}
@media (max-width: 900px) {
  .messenger {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .messenger {
    grid-template-columns: minmax(0, 1fr);
  }
  .conversation-header {
    padding: 10px 12px;
  }
  .chat-panel .chat-history {
    padding: 18px 14px;
  }
  .chat-panel .chat-bubble {
    max-width: 92%;
  }
  .chat-panel .chat-form {
    padding: 10px 12px 8px;
  }
}

/* Formatação discreta nas conversas, incluindo respostas anteriores. */
.chat-markdown {
  white-space: normal;
  overflow-x: auto;
  max-width: 100%;
  line-height: 1.55;
}
.chat-markdown p {
  margin: 0 0 0.55em;
}
.chat-markdown > :first-child {
  margin-top: 0;
}
.chat-markdown > :last-child {
  margin-bottom: 0;
}
.chat-markdown h1,
.chat-markdown h2,
.chat-markdown h3,
.chat-markdown h4,
.chat-markdown h5,
.chat-markdown h6 {
  font-size: 1em;
  line-height: 1.5;
  margin: 0.7em 0 0.35em;
}
.chat-markdown ul,
.chat-markdown ol {
  padding-left: 1.4em;
  margin: 0.4em 0;
}
.chat-markdown pre {
  white-space: pre;
  overflow-x: auto;
  padding: 10px;
  background: var(--accent-soft);
  border-radius: 4px;
}
.chat-markdown code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.chat-expanded {
  margin-top: 8px;
}
.chat-expanded summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}
.chat-expanded[open] summary {
  margin-bottom: 10px;
}

.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;
}
.execution-bar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  flex-shrink: 0;
}
.execution-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
}
.execution-summary > strong {
  font-size: 13px;
}
.execution-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 48vw;
}
.chat-history {
  background: var(--chat-bg);
}
.chat-bubble {
  background: var(--bubble-agent);
  border-radius: 4px 17px 17px 17px;
  border: 1px solid var(--line);
  padding: 10px 13px;
  max-width: min(78%, 680px);
}
.chat-bubble.human {
  background: var(--bubble-human);
  border-radius: 17px 4px 17px 17px;
}
.message-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  padding-right: 18px;
}
.message-author strong {
  font-size: 13px;
  color: var(--accent);
}
.message-author time {
  margin-left: auto;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0.7;
}
.message-author .avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 11px;
  background: var(--avatar);
  color: var(--on-avatar);
}
.message-author .human-avatar {
  background: var(--avatar-human);
}
.chat-bubble .chat-text {
  font-size: 14px;
  line-height: 1.55;
}
.company-document {
  padding: 22px 0;
  max-width: 960px;
  overflow-wrap: anywhere;
}
.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 .company-history {
  height: 330px;
  overflow-y: auto;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 8px;
  background: var(--chat-bg);
}
.wizard-main details {
  margin: 20px 0;
}
.crawl-progress {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 6px;
  margin: 18px 0;
  background: var(--surface);
}
@media (max-width: 700px) {
  .execution-bar {
    padding: 9px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .execution-summary small {
    max-width: 85vw;
  }
  .chat-bubble {
    max-width: 92%;
  }
  .message-author {
    flex-wrap: wrap;
  }
  .wizard-main {
    padding: 18px;
  }
  .wizard-header {
    padding: 20px;
  }
  .wizard-steps {
    gap: 4px 12px;
  }
}

.chat-panel .chat-history {
  background: var(--chat-bg);
}
.chat-panel .chat-bubble {
  background: var(--bubble-agent);
  border: 1px solid var(--line);
  border-radius: 4px 17px 17px 17px;
  padding: 10px 30px 10px 13px;
  box-shadow: none;
}
.chat-panel .chat-bubble.human {
  background: var(--bubble-human);
  border-radius: 17px 4px 17px 17px;
}
.chat-panel .chat-bubble::before {
  border-top-color: var(--bubble-agent);
}
.chat-panel .chat-bubble.human::before {
  border-top-color: var(--bubble-human);
}
:root[data-theme] .message-author strong {
  color: var(--author);
}
.conversation-entry[data-role='business'] .avatar,
.conversation-entry[data-role='product'] .avatar {
  background: var(--avatar-product);
  color: var(--on-role-avatar);
}
.conversation-entry[data-role='business'] .avatar,
.conversation-entry[data-role='scrum'] .avatar {
  background: var(--avatar-scrum);
  color: var(--on-role-avatar);
}
.conversation-entry[data-role='security'] .avatar,
.conversation-entry[data-role='qa'] .avatar {
  background: var(--avatar-qa);
  color: var(--on-role-avatar);
}

/* Provider quota: persistent notice inside the sticky execution controls. */
.execution-bar:has(.provider-limit-banner) {
  flex-wrap: wrap;
}
.provider-limit-banner {
  flex: 0 0 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
}
.provider-limit-banner span {
  line-height: 1.5;
  color: var(--text);
}

.wizard-shell > .provider-limit-banner {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--surface);
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.main > .provider-limit-banner {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--surface);
}

.agent-activity {
  align-items: flex-start;
}
.agent-activity .typing-dots {
  margin-top: 7px;
}
.activity-label {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
.activity-description {
  display: block;
  max-width: 64ch;
  margin-top: 3px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  font-style: italic;
}

.chat-main > .stage-review-notice {
  margin: 0;
  padding: 12px 22px;
  flex-shrink: 0;
  border-radius: 0;
}
.stage-review-notice p {
  margin: 4px 0 8px;
}

/* A single project history, with quiet filters and an explicit recipient. */
.timeline-filter,
.timeline-recipient {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.timeline-filter {
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.timeline-filter select,
.timeline-recipient select {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding: 6px 10px;
}
.timeline-recipient {
  flex-wrap: wrap;
}
.chat-panel > .stage-review-notice {
  margin: 0;
  max-height: 110px;
  overflow: auto;
  flex-shrink: 0;
}
.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;
}
@media (max-width: 600px) {
  .timeline-filter {
    padding: 8px 12px;
  }
}
.timeline-review-summary {
  padding: 8px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  max-height: 150px;
  overflow: auto;
  flex-shrink: 0;
}

/* Conversation first: one header, contextual actions and a quiet composer. */
.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-picker {
  padding: 8px 18px 12px;
}
.workspace-navigation {
  margin: 0 12px 8px;
  padding-bottom: 8px;
  gap: 0;
}
.workspace-navigation .nav {
  padding: 10px;
  font-size: 12px;
}
.conversation-list-heading {
  border-top: 0;
  padding: 14px 18px 6px;
}
.conversation-list-heading h2 {
  font-size: 17px;
}
.conversation-list-heading > small {
  display: none;
}
.conversation-search {
  margin: 8px 16px 12px;
}
.project-focus-header {
  padding: 14px 22px;
  min-height: 78px;
  background: var(--surface);
  gap: 12px;
  position: relative;
  z-index: 12;
  box-shadow: 0 1px 0 var(--line);
}
.project-chat-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.project-chat-identity > div {
  min-width: 0;
}
.project-chat-identity strong {
  font-size: 15px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-chat-identity small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
}
.project-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-header-actions > button {
  border: 0;
  background: transparent;
}
.work-status-dot,
.attention-dot {
  height: 7px;
  width: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--sage);
  display: inline-block;
  margin-right: 3px;
}
.work-status-dot.stopped {
  background: var(--amber);
}
.execution-options {
  position: relative;
}
.execution-options > summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 22px;
  border-radius: 8px;
}
.execution-options > summary::-webkit-details-marker,
.composer-routing > summary::-webkit-details-marker {
  display: none;
}
.execution-options > summary:hover {
  background: var(--surface-alt);
}
.chat-tools-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  max-width: calc(100vw - 28px);
  max-height: 70dvh;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px #00000014;
  display: grid;
  gap: 12px;
  z-index: 30;
}
.chat-tools-popover strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chat-tools-popover label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.chat-tools-popover p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.chat-tools-links {
  display: grid;
  gap: 3px;
}
.chat-tools-popover button {
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 8px 10px;
}
.chat-tools-popover button:hover,
.chat-tools-popover button.active {
  background: var(--accent-soft);
}
.project-chat-toolbar {
  padding: 8px 22px;
  flex-shrink: 0;
  background: var(--surface-alt);
}
.active-chat-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.attention-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-line);
  flex-shrink: 0;
}
.attention-dot {
  background: var(--amber);
}
.attention-strip > span:nth-child(2) {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.attention-strip strong {
  font-size: 12px;
  color: var(--amber);
}
.attention-strip small {
  color: var(--muted);
  font-size: 12px;
}
.attention-strip button {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--warning-line);
  color: var(--amber);
  border-radius: 8px;
  font-weight: 600;
}
.action-center {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}
.action-item {
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
  border-radius: 10px;
  padding: 16px;
  background: var(--surface-alt);
}
.action-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.action-item-title .avatar {
  height: 28px;
  width: 28px;
  min-width: 28px;
  font-size: 11px;
}
.action-item-title small {
  margin-left: auto;
  color: var(--muted);
}
.action-item p {
  line-height: 1.55;
  margin: 12px 0;
}
.task-human-review > summary {
  cursor: pointer;
  line-height: 1.4;
}
.task-human-review > summary span {
  color: var(--muted);
}
.task-human-review .row {
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.task-human-review .row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.composer-routing {
  position: relative;
  font-size: 11px;
  color: var(--muted);
  align-self: flex-start;
}
.composer-routing > summary {
  cursor: pointer;
  list-style: none;
  padding: 1px 6px 5px;
}
.composer-routing > label,
.composer-routing > small {
  padding: 8px 6px;
}
.composer-routing > small {
  display: block;
}
.chat-main .chat-panel .chat-form {
  padding: 8px 22px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  gap: 3px;
}
.chat-form .composer-input {
  gap: 10px;
  align-items: flex-end;
}
.chat-form textarea[name='chat'] {
  min-height: 44px;
  max-height: 140px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  resize: none;
}
.chat-form .attach-button {
  background: transparent;
  border: 0;
  height: 44px;
  width: 34px;
}
.chat-form .send-button {
  height: 44px;
  width: 44px;
  min-width: 44px;
  border-radius: 14px;
}
.chat-panel .chat-history {
  padding: 24px clamp(18px, 4vw, 72px);
}
.chat-panel .chat-bubble {
  border-radius: 6px 18px 18px 18px;
  border-color: transparent;
  box-shadow: 0 1px 1px #0000000d;
}
.chat-panel .chat-bubble.human {
  border-radius: 18px 6px 18px 18px;
}

@media (max-width: 700px) {
  .messenger {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .project-focus-header {
    padding: 12px;
    min-height: 70px;
  }
  .project-chat-identity {
    gap: 8px;
  }
  .project-chat-identity > .avatar {
    display: none;
  }
  .project-header-actions {
    gap: 2px;
  }
  .project-header-actions > button {
    font-size: 11px;
    padding: 7px;
  }
  .compact-estimate {
    display: none;
  }
  .attention-strip {
    padding: 8px 12px;
  }
  .attention-strip > span:nth-child(2) {
    display: grid;
    gap: 2px;
  }
  .chat-main .chat-panel .chat-form {
    padding: 6px 12px 10px;
  }
}
@media (max-width: 600px) {
  .messenger {
    grid-template-columns: 1fr;
  }
}

/* Agent identity uses a restrained hue, shared by messages and progress. */
.agent-support,
.agent-business {
  --agent-hue: 188;
}
.agent-business {
  --agent-hue: 36;
}
.agent-product {
  --agent-hue: 330;
}
.agent-tech {
  --agent-hue: 210;
}
.agent-scrum {
  --agent-hue: 266;
}
.agent-dev {
  --agent-hue: 176;
}
.agent-security {
  --agent-hue: 12;
}
.agent-qa {
  --agent-hue: 124;
}
.agent-operations {
  --agent-hue: 42;
}
[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);
}
.chat-panel .chat-bubble[class*='agent-'] {
  background: var(--agent-bg);
  border-color: var(--agent-border);
}
.chat-panel .chat-bubble[class*='agent-']::before {
  border-top-color: var(--agent-bg);
}
.chat-panel .chat-bubble[class*='agent-'] .message-author strong {
  color: var(--agent-color);
}
.message-author .avatar[class*='agent-'] {
  background: hsl(var(--agent-hue, 188) 26% 42%);
}
.project-workbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 22px;
  background: var(--agent-bg);
  border-bottom: 1px solid var(--agent-border);
  flex-shrink: 0;
  color: var(--agent-color);
  font-size: 12px;
}
.project-workbar strong {
  font-size: 12px;
  font-weight: 600;
}
.project-workbar .work-status-dot {
  background: var(--agent-color);
}
.project-workbar .work-status-dot.stopped {
  background: var(--amber);
}
.project-workbar small {
  margin-left: auto;
  color: var(--muted);
  white-space: nowrap;
}
.project-workbar button {
  margin-left: auto;
  border: 0;
  padding: 3px 8px;
  background: transparent;
  color: var(--agent-color);
  font-size: 11px;
}
.project-workbar small + button {
  margin-left: 6px;
}
@media (max-width: 700px) {
  .project-workbar {
    padding: 7px 12px;
  }
  .project-workbar strong {
    font-size: 11px;
  }
}
.review-file {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
  background: var(--surface-alt);
}
.review-file h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.review-file p {
  font-size: 12px;
  color: var(--muted);
}
.review-diff {
  margin: 12px 0 0;
  font:
    12px/1.7 ui-monospace,
    monospace;
  overflow: auto;
  max-height: 360px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.review-diff span {
  display: block;
  padding: 0 6px;
}
.review-diff .diff-added {
  background: var(--success-bg);
  color: var(--success);
}
.review-diff .diff-removed {
  background: var(--error-bg);
  color: var(--red);
}
.review-modal-actions {
  position: sticky;
  bottom: -24px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dependent-stages {
  display: block;
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.5;
}
.action-item > button + button {
  margin-left: 8px;
}

/* A compact execution strip, separate from the conversation identity. */
.compact-execution {
  padding: 8px 16px;
  gap: 12px;
  min-height: 44px;
  align-items: center;
  flex-wrap: wrap;
}
.compact-execution .execution-summary {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  flex: 1;
  min-width: 0;
}
.compact-execution .execution-summary > small {
  margin: 0;
  font-size: 11px;
}
.compact-execution .execution-summary > small[title] {
  max-width: 48ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stage-status {
  background: color-mix(in srgb, var(--agent-color, var(--accent)) 16%, var(--surface));
  color: var(--agent-color, var(--text));
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
}
.execution-actions-menu {
  position: relative;
  flex: none;
  margin-left: auto;
}
.execution-actions-menu > summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-alt);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.execution-actions-menu > summary::-webkit-details-marker {
  display: none;
}
.execution-actions-menu > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.execution-actions-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 6px;
  width: max-content;
  min-width: 210px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 32px #0003;
}
.execution-actions-popover button {
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  text-align: left;
  white-space: normal;
}
.header-project-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}
.conversation-header > .row {
  flex-shrink: 0;
}
.chat-main .chat-meta {
  display: none;
}
.idea-references {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.visual-preview {
  margin: 14px 0;
}
.visual-preview .asset-frame {
  width: 100%;
  min-height: 420px;
  background: var(--asset-frame);
}
@media (max-width: 760px) {
  .conversation-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .header-project-actions {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
  .compact-execution {
    flex-wrap: nowrap;
    align-items: center;
  }
  .compact-execution .execution-summary {
    flex: 1 1 auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .compact-execution .execution-summary > small {
    max-width: 100%;
  }
  .execution-actions-menu > summary {
    width: 44px;
    height: 44px;
  }
  .execution-actions-popover {
    top: calc(100% + 6px);
    right: 8px;
    max-height: min(70dvh, 420px);
    overflow-y: auto;
  }
  .compact-execution .execution-summary > small[title] {
    max-width: 32ch;
  }
  .visual-preview .asset-frame {
    min-height: 320px;
  }
}
.task-tracking {
  overflow-x: auto;
}
.task-tracking table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.task-tracking th,
.task-tracking td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.task-tracking th {
  font-size: 11px;
  color: var(--muted);
}
.task-tracking td:first-child {
  min-width: 220px;
}
.task-references {
  display: grid;
  gap: 10px;
}
.consolidated-plan {
  max-height: 58vh;
  overflow-y: auto;
  padding: 12px;
}

.company-workspaces {
  display: grid;
  gap: 1rem;
}

.company-usage-heading {
  margin: 1rem 0;
}

.company-usage-stats .stat {
  min-width: 0;
}

.usage-bars {
  display: flex;
  align-items: end;
  gap: 0.3rem;
  min-height: 9rem;
  overflow-x: auto;
  padding: 0.75rem 0 0;
}

.usage-bar-column {
  display: flex;
  flex: 1 0 1.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 0.35rem;
  min-height: 8rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.usage-bar {
  width: min(100%, 1.25rem);
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--focus);
}

/* One integration per pane, shared by onboarding and regular settings. */
.integration-settings {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: clip;
  background: var(--surface);
  margin-top: 20px;
}
.integration-navigation {
  padding: 8px;
  min-width: 0;
}
.integration-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 14px 12px;
  text-align: left;
  background: transparent;
  color: var(--ink);
}
.integration-entry.active {
  background: var(--chat-bg);
  box-shadow: inset 3px 0 var(--accent);
}
.integration-entry:hover {
  background: var(--chat-bg);
}
.integration-entry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.integration-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 24px;
}
.integration-entry-text {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.integration-entry-text strong {
  font-size: 14px;
}
.integration-entry-text small {
  color: var(--muted);
  line-height: 1.4;
  font-size: 12px;
}
.integration-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.integration-chevron {
  color: var(--muted);
  font-size: 22px;
}
.integration-panel {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 24px;
}
.integration-panel-heading {
  margin-bottom: 24px;
}
.integration-panel-heading h2 {
  margin: 6px 0;
}
.integration-panel-heading p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.integration-panel .card {
  min-width: 0;
  padding: 18px 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.integration-panel .card + .card {
  border-top: 1px solid var(--line);
}
.integration-panel input,
.integration-panel select,
.integration-panel textarea {
  max-width: 100%;
  min-width: 0;
}
.integration-panel .run-card {
  min-width: 0;
  overflow-wrap: anywhere;
}
.integration-panel .row {
  flex-wrap: wrap;
}
.integration-panel .form {
  max-width: 100%;
}
.integration-panel pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.integration-back {
  display: none;
}
@media (max-width: 760px) {
  .integration-settings {
    grid-template-columns: minmax(0, 1fr);
  }
  .integration-navigation {
    display: block;
  }
  .integration-panel {
    display: none;
    border-left: 0;
    padding: 18px;
  }
  .integration-settings.show-detail .integration-navigation {
    display: none;
  }
  .integration-settings.show-detail .integration-panel {
    display: block;
  }
  .integration-back {
    display: inline-flex;
    margin-bottom: 20px;
  }
  .integration-panel .run-card .row button {
    flex: 1 1 auto;
  }
}
.integration-status dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr);
  gap: 8px 16px;
}
.integration-status dt {
  color: var(--muted);
}
.integration-status dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.integration-overview-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
@media (max-width: 540px) {
  .integration-status dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .integration-status dd {
    margin-bottom: 8px;
  }
}

/* Project shortcuts and settings use the same list/detail pattern as integrations. */
.project-shortcuts {
  margin-top: auto;
}
.project-shortcuts nav {
  display: grid;
}
.project-shortcuts .nav {
  width: 100%;
  text-align: left;
}
.settings-layout .grid.equal {
  grid-template-columns: minmax(0, 1fr);
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.settings-row:hover {
  background: var(--surface-2);
}
.settings-row > span:not(.avatar) {
  min-width: 0;
}
.settings-row > span:last-child {
  margin-left: auto;
}
.settings-row strong,
.settings-row small {
  display: block;
  overflow-wrap: anywhere;
}
.settings-row small {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.5;
}
.settings-row .avatar {
  flex-shrink: 0;
}
.tool-group {
  margin-top: 22px;
}
.tool-group h3 {
  color: var(--muted);
  font-size: 13px;
}
.agent-settings-form {
  max-width: 720px;
}
.settings-layout .integration-panel {
  min-height: 420px;
}
.agent-settings-form {
  gap: 14px;
}
.agent-settings-form textarea {
  min-height: 100px;
}

.resolution-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--attention-line);
  background: var(--surface);
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 8;
}
.resolution-banner span {
  flex: 1;
}
.resolution-banner.needs-resolution {
  border-bottom-color: var(--attention);
  background: color-mix(in srgb, var(--attention) 14%, var(--surface));
}

@media (max-width: 650px) {
  .resolution-banner {
    gap: 5px;
    padding: 6px 10px;
  }
  .resolution-banner > span {
    flex: 1 1 100%;
    font-size: 11px;
    line-height: 1.25;
  }
  .resolution-banner > button {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    margin: 0;
    padding: 6px;
    font-size: 11px;
    line-height: 1.25;
  }
  .attention-strip {
    gap: 6px;
    padding: 7px 10px;
    font-size: 11px;
    line-height: 1.35;
  }
  .attention-strip button {
    margin-left: 0;
    padding: 6px 8px;
  }
  .task-human-review {
    padding: 9px 11px;
    margin-bottom: 12px;
  }
  .task-human-review > p {
    margin: 8px 0;
  }
  .task-human-review .row {
    align-items: flex-start;
    flex-direction: column;
  }
}

#app:has(> .resolution-banner) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
#app > .resolution-banner {
  position: relative;
  flex: none;
}
#app > .resolution-banner + .layout.messenger {
  flex: 1;
  height: auto;
  min-height: 0;
}
#app > .resolution-banner + .layout.messenger .sidebar {
  height: 100%;
}

.po-progress-history {
  width: min(720px, 100%);
  margin: 14px auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.po-progress-history > summary {
  padding: 10px 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.po-progress-list {
  display: grid;
  gap: 8px;
  max-height: 40vh;
  overflow: auto;
  padding: 0 10px 10px;
}
.po-progress-list .chat-bubble {
  margin: 0;
  box-shadow: none;
}

/* Frequent destinations stay reachable after the conversation list collapses on phones. */
.mobile-primary-navigation {
  display: none;
}
@media (max-width: 650px) {
  :root {
    --mobile-primary-nav-height: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-primary-navigation {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    align-items: stretch;
    min-height: var(--mobile-primary-nav-height);
    padding: 4px 4px env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -4px 14px #00000012;
  }
  .mobile-primary-navigation .nav {
    display: grid;
    grid-template-rows: 23px 16px;
    place-content: center;
    justify-items: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 4px 1px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .mobile-primary-navigation .nav.active {
    background: var(--accent-soft);
    color: var(--ink);
    font-weight: 650;
  }
  .mobile-primary-navigation .nav.active::before {
    display: none;
  }
  .mobile-primary-navigation .nav-mark,
  .mobile-primary-navigation .nav-mark svg {
    width: 21px;
    height: 21px;
  }
  .messenger {
    height: calc(100dvh - var(--mobile-primary-nav-height));
    min-height: 0;
  }
  #app:has(> .resolution-banner) > .resolution-banner + .layout.messenger {
    margin-bottom: var(--mobile-primary-nav-height);
  }
  #toast {
    right: 12px;
    bottom: calc(var(--mobile-primary-nav-height) + 8px);
    left: 12px;
    width: auto;
    max-width: none;
    text-align: center;
  }
}

/* Project overview: one clear next step, with the operational detail one tap away. */
.overview-focus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 8px 0 20px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(125deg, var(--surface), var(--surface-alt));
  box-shadow: 0 10px 28px #0000000a;
}
.overview-focus.needs-you {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: linear-gradient(125deg, var(--accent-soft), var(--surface));
}
.overview-focus.needs-attention {
  border-color: var(--warning-line);
  background: linear-gradient(125deg, var(--warning-bg), var(--surface));
}
.overview-focus.is-working {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}
.focus-copy {
  min-width: 0;
  max-width: 760px;
}
.focus-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}
.focus-copy h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 29px);
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.focus-copy p {
  max-width: 68ch;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.focus-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: none;
  gap: 10px;
}
.focus-actions button.primary {
  min-height: 44px;
  padding: 11px 19px;
  border-radius: 10px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 22%, transparent);
}
.focus-count,
.overview-links > span {
  color: var(--muted);
  font-size: 12px;
}
.working-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}
.overview-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
}
.overview-details {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.overview-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 14px 18px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  list-style-position: inside;
}
.overview-details > summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
  text-align: right;
}
.overview-details[open] > summary {
  border-bottom: 1px solid var(--line);
}
.overview-details > .grid,
.overview-details > .card,
.overview-details > .stats {
  margin: 14px;
}
.overview-details .card {
  border-radius: 12px;
}
.overview-details .tag.neutral {
  color: var(--muted);
  background: var(--surface-alt);
}
.overview-stats {
  opacity: 0.86;
}
.page-intro h1 {
  letter-spacing: -0.035em;
}
.card,
.run-card,
.overview-details,
.overview-focus {
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

@media (max-width: 650px) {
  .overview-focus {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    margin: 4px 0 14px;
    padding: 19px 17px;
    border-radius: 14px;
  }
  .focus-copy h2 {
    font-size: 21px;
  }
  .focus-copy p {
    font-size: 13px;
  }
  .focus-actions {
    justify-content: stretch;
  }
  .focus-actions button {
    width: 100%;
    min-height: 44px;
  }
  .overview-links {
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .overview-details > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 13px 14px;
  }
  .overview-details > summary span {
    padding-left: 18px;
    text-align: left;
  }
  .overview-details > .grid,
  .overview-details > .card,
  .overview-details > .stats {
    margin: 9px;
  }
  .overview-details .stage-item {
    grid-template-columns: 27px minmax(0, 1fr);
  }
  .overview-details .stage-item > .row {
    grid-column: 2;
    flex-wrap: wrap;
  }
}

/* Human decisions have one stable, full-width home on desktop and mobile. */
.pending-screen {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px;
}
.pending-screen h1 {
  margin-bottom: 8px;
}
.pending-list {
  display: grid;
  gap: 14px;
}
.pending-card,
.pending-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  overflow-wrap: anywhere;
}
.pending-card h2 {
  font-size: 1.1rem;
  margin: 0 0 14px;
}
.pending-card p {
  margin: 12px 0;
  line-height: 1.5;
}
.pending-card > button {
  min-height: 44px;
}
.pending-detail {
  margin-top: 20px;
  scroll-margin-top: 120px;
}
.pending-master-access {
  margin-top: 28px;
  opacity: 0.85;
}
.pending-master-access summary {
  cursor: pointer;
}
.pending-screen pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
}
.pending-screen input,
.pending-screen textarea,
.pending-screen select {
  font-size: 16px;
}
@media (max-width: 600px) {
  .pending-screen {
    padding: 12px;
  }
  .pending-card,
  .pending-detail {
    padding: 16px;
  }
  .pending-card > button {
    width: 100%;
  }
}

.flow-status .flow-incident.needs-you {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 6px;
}
.flow-status ul {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.2rem;
}

/* Links that act as buttons (open the running application). */
a.button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 13px;
  text-decoration: none;
}
a.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
a.button.primary:hover {
  background: var(--accent-hover);
}
a.button.small {
  padding: 5px 10px;
  font-size: 0.9em;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
}
.usage-table th,
.usage-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
}

/* An installation's logo in the header, with Zé's mark beside it. */
.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);
}
