/* Reference lock: existing Attio product canvas; n8n flow; restrained report tables. */
body {
  font-feature-settings: "ss03";
}
h1 {
  text-wrap: balance;
}
.eyebrow {
  color: #687384;
}
.subtitle {
  color: #687384;
}
.sidebar {
  overflow-y: auto;
}
.sidebar nav a {
  padding-block: 9px;
}
.agent-heading {
  align-items: flex-start;
}
.agent-heading h1 {
  max-width: 660px;
  line-height: 1.18;
  font-size: 30px;
}
.agent-heading .heading-actions {
  padding-top: 24px;
}
.button-link {
  display: inline-flex;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}
.button-link:hover {
  background: var(--ash);
}
.system-note,
.simulation-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  margin-bottom: 24px;
  background: #f8f9fb;
  font-size: 12px;
}
.system-note > div {
  flex: 1;
}
.system-note b,
.system-note span:not(.status-square) {
  display: block;
}
.system-note b {
  margin-bottom: 5px;
  font-weight: 500;
}
.system-note span {
  color: #69717e;
  line-height: 1.5;
}
.status-square {
  width: 9px;
  height: 9px;
  background: #a3aab4;
  border-radius: 3px;
  flex: none;
}
.simulation-bar {
  background: #f6f9fe;
  border-color: #dbe5f6;
  justify-content: space-between;
}
.simulation-bar > div:first-child {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}
.simulation-bar > div:first-child > span:last-child {
  width: 100%;
  color: #687384;
  margin-top: 1px;
}
.simulation-bar b {
  font-size: 12px;
  font-weight: 500;
}
.simulation-bar button {
  font-size: 11px;
}
.agent-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 8px 21px 24px;
  gap: 10px;
}
.agent-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 8px;
  padding: 15px 12px;
  text-align: left;
  min-width: 0;
  white-space: normal;
  background: #fff;
}
.agent-node:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -11px;
  top: 53px;
  background: #fff;
  color: #a7aeb7;
  font-size: 11px;
  z-index: 1;
}
.agent-node strong {
  font-weight: 600;
  font-size: 12px;
  margin: 16px 0 7px;
}
.agent-node > span:not(.node-top) {
  font-size: 10px;
  line-height: 1.6;
  color: #6b7583;
  min-height: 32px;
}
.agent-node small {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 12px;
  color: #687384;
  font-weight: 400;
  font-size: 9px;
  line-height: 1.5;
}
.node-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.node-index {
  border: 1px solid var(--line);
  background: #f8f9fb;
  border-radius: 6px;
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 500;
  flex: none;
}
.dot.green {
  background: #347457;
}
.loop-track {
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  background: #fafbfc;
  border-radius: 0 0 8px 8px;
}
.loop-track > span:first-child {
  color: var(--blue);
  font-size: 21px;
}
.loop-track > span:nth-child(3) {
  color: #687384;
  flex: 1;
}
.loop-track b {
  font-weight: 500;
  white-space: nowrap;
}
.loop-track a {
  white-space: nowrap;
}
.agent-next {
  display: flex;
  gap: 15px;
  padding: 8px 22px 28px;
}
.agent-next h3 {
  font-size: 14px;
  font-weight: 500;
}
.agent-next p {
  font-size: 12px;
  line-height: 1.8;
  color: #687384;
  max-width: 420px;
  margin: 0 0 12px;
}
.agent-next a {
  font-size: 11px;
}
.compact-coverage {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 3px;
  margin-bottom: 17px;
}
.compact-coverage i {
  height: 9px;
  background: #e7ebf0;
  border-radius: 2px;
}
.expanded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.expanded .agent-node {
  padding: 18px;
}
.expanded .agent-node::after {
  display: none;
}
.expanded .agent-node p {
  font-size: 12px;
  color: #687384;
  line-height: 1.7;
  font-weight: 400;
  margin-top: 14px;
}
.rule-list {
  padding: 4px 22px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.rule-list div {
  min-width: 0;
}
.rule-list b {
  font-size: 12px;
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}
.rule-list span {
  color: #687384;
  font-size: 12px;
  line-height: 1.7;
  display: block;
}
.rule-list.vertical {
  grid-template-columns: 1fr;
  gap: 24px;
}
.learning-loop {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 0 24px;
  flex-wrap: wrap;
}
.learning-loop > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.learning-loop > div > span {
  color: #8e97a3;
  font-size: 10px;
}
.learning-loop b {
  font-size: 11px;
  font-weight: 500;
}
.loop-return {
  color: var(--blue);
  font-size: 11px;
  margin-left: auto;
}
.learning-table th,
.learning-table td {
  padding: 17px 22px;
}
.variant-label {
  display: flex;
  align-items: center;
  gap: 11px;
}
.variant-label > span {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  background: #f0f3f7;
  border-radius: 6px;
  color: #5d6878;
  font-weight: 500;
}
.variant-label b {
  font-size: 12px;
  font-weight: 500;
  display: block;
}
.variant-label small {
  display: block;
  font-size: 10px;
  color: #687384;
  margin-top: 5px;
}
.learning-decision {
  padding: 23px 22px;
  display: flex;
  gap: 26px;
  align-items: center;
  background: #fafbfc;
}
.learning-decision > div:first-child {
  flex: 1;
}
.learning-decision h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 8px 0;
}
.learning-decision p {
  font-size: 12px;
  line-height: 1.7;
  color: #687384;
  max-width: 650px;
  margin: 0;
}
.split-meter {
  width: 200px;
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 7px;
  flex-wrap: wrap;
  color: #687384;
  font-size: 10px;
}
.split-meter > div {
  width: 100%;
  height: 8px;
  display: flex;
  background: #e7ebf0;
  border-radius: 4px;
  overflow: hidden;
}
.allocation-a {
  background: #a7b1bf;
}
.allocation-b {
  background: #607caa;
}
.dialogue-grid {
  display: grid;
  grid-template-columns: 270px 1fr;
}
.conversation-list {
  border-right: 1px solid var(--line);
}
.conversation-item {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-radius: 0;
  background: #f2f5fa;
  white-space: normal;
}
.conversation-item b {
  font-size: 12px;
  font-weight: 500;
}
.conversation-item small {
  display: block;
  margin-top: 6px;
  color: #687384;
  font-size: 10px;
}
.conversation-item:not(.active) {
  background: #fff;
}
.message-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.conversation-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.conversation-note {
  padding: 20px;
  font-size: 11px;
  line-height: 1.7;
  color: #687384;
}
.conversation {
  min-width: 0;
}
.message-timeline {
  padding: 5px 24px 26px;
}
.message-event {
  color: #687384;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 22px;
}
.message {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 85%;
  margin: 0 0 22px;
}
.message small {
  color: #687384;
  font-size: 10px;
}
.message p {
  font-size: 12px;
  line-height: 1.8;
  margin: 10px 0 0;
}
.message.outgoing {
  margin-left: auto;
  background: #f6f8fb;
}
.next-reply {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.next-reply b {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.next-reply p {
  font-size: 11px;
  color: #687384;
  line-height: 1.7;
}
.cost-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cost-metrics .metric-value {
  font-size: 28px;
}
.budget-list {
  padding: 0 22px;
}
.budget-row {
  padding: 5px 0 22px;
}
.budget-row > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.budget-row b,
.budget-row strong {
  font-weight: 500;
}
.budget-row p {
  margin: 8px 0 12px;
  font-size: 11px;
  color: #687384;
}
.budget-track {
  height: 5px;
  background: #f0f2f6;
  border-radius: 4px;
  overflow: hidden;
}
.budget-track i {
  display: block;
  height: 100%;
  background: #7b8da6;
  border-radius: inherit;
}
@media (max-width: 1200px) {
  .agent-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .agent-node::after {
    display: none;
  }
  .agent-heading {
    flex-wrap: wrap;
  }
  .agent-heading .heading-actions {
    padding-top: 0;
  }
  .dialogue-grid {
    grid-template-columns: 220px 1fr;
  }
}
@media (max-width: 760px) {
  .agent-heading h1 {
    font-size: 26px;
  }
  .agent-flow,
  .expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px 14px 18px;
  }
  .agent-node {
    padding: 13px 10px;
  }
  .agent-node small {
    font-size: 10px;
  }
  .agent-node > span:not(.node-top) {
    font-size: 11px;
  }
  .system-note,
  .simulation-bar {
    flex-wrap: wrap;
    padding: 15px;
  }
  .system-note > div {
    min-width: 200px;
  }
  .loop-track {
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
  }
  .loop-track > span:nth-child(3) {
    flex-basis: 100%;
    order: 3;
    line-height: 1.7;
  }
  .loop-track a {
    margin-left: auto;
  }
  .rule-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .learning-decision {
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
  }
  .split-meter {
    width: 100%;
  }
  .learning-loop {
    gap: 12px;
  }
  .loop-return {
    margin-left: 0;
  }
  .dialogue-grid {
    grid-template-columns: 1fr;
  }
  .conversation-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .conversation-note {
    padding: 15px 20px;
  }
  .message-timeline {
    padding-inline: 16px;
  }
  .message {
    max-width: 94%;
  }
  .cost-metrics {
    grid-template-columns: 1fr;
  }
  .panel-bottom {
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.6;
  }
}

.flow-panel {
  margin-bottom: 24px;
}
#main > .panel + .panel {
  margin-top: 24px;
}
.maintenance {
  margin-top: 18px;
}
.maintenance summary {
  cursor: pointer;
  font-size: 12px;
  color: #687384;
}

.learning-scroll-hint {
  display: none;
}
@media (max-width: 760px) {
  .learning-scroll-hint {
    display: block;
    margin: 0;
    padding: 0 16px 12px;
    color: #687384;
    font-size: 11px;
  }
}
