/* 53AI Agents interaction reference, ISAAC palette. */
.ag-page {
  height: calc(100dvh - 79px);
  min-height: 540px;
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr);
  color: var(--ink, #203332);
  margin: 0;
  background: var(--paper, #eeede6);
}
.ag-history {
  padding: 24px 14px;
  border-right: 1px solid var(--line, #d5d8ce);
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: auto;
}
.ag-new {
  background: var(--action, #a63f21);
  color: var(--on-action, #fffaf2);
  border: 0;
  border-radius: 8px;
  padding: 11px 8px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}
.ag-history-label {
  font-size: 11px;
  color: var(--muted, #66726b);
  margin: 22px 8px 8px;
}
.ag-history > a {
  padding: 9px 8px;
  border-radius: 7px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 12px;
  color: inherit;
  text-decoration: none;
}
.ag-history > a.active,
.ag-history > a:hover {
  background: var(--accent-soft, #f5e4d8);
  color: var(--action, #a63f21);
}
.ag-shortcuts {
  margin-top: auto;
  padding: 24px 8px 6px;
  display: grid;
  gap: 14px;
  font-size: 12px;
}
.ag-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface, #f5f4ed);
}
.ag-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line, #d5d8ce);
  position: relative;
}
.ag-tabs {
  display: flex;
  gap: 5px;
  background: var(--paper, #eeede6);
  border-radius: 9px;
  padding: 4px;
}
.ag-tabs button {
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 9px 18px;
  font-size: 15px;
  color: inherit;
  cursor: pointer;
}
.ag-tabs button[aria-pressed="true"] {
  background: var(--surface-soft, #f7f6f1);
  box-shadow: 0 1px 4px #20333212;
  color: var(--action, #a63f21);
}
.ag-delete {
  position: absolute;
  right: 16px;
  font-size: 11px;
  color: var(--muted, #66726b);
  border: 0;
  background: none;
  cursor: pointer;
}
.ag-messages {
  flex: 1;
  overflow: auto;
  scroll-behavior: smooth;
  padding: 30px clamp(20px, 5vw, 84px) 16px;
  min-height: 0;
}
.ag-welcome {
  min-height: 240px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.ag-welcome h1 {
  font-size: 26px;
  margin: 4px 0;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.ag-welcome p {
  font-size: 13px;
  color: var(--muted, #66726b);
  max-width: 450px;
  text-align: center;
}
.ag-council {
  max-width: 820px;
  margin: 10px auto 20px;
  border: 1px solid var(--line, #d5d8ce);
  border-radius: 12px;
  padding: 14px;
}
.ag-council h2 {
  background: var(--action, #a63f21);
  color: var(--on-action, #fffaf2);
  font-size: 20px;
  text-align: center;
  margin: 0 0 15px;
  padding: 12px;
  border-radius: 8px;
}
.ag-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ag-card {
  background: var(--surface-soft, #f7f6f1);
  border: 1px solid var(--line, #d5d8ce);
  border-radius: 5px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition:
    transform 0.16s,
    border-color 0.16s;
}
.ag-card:hover {
  border-color: var(--action, #a63f21);
  transform: translateY(-2px);
}
.ag-card p {
  font-size: 13px;
  color: var(--muted, #66726b);
  line-height: 1.8;
  margin: 12px 0 0;
}
.ag-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}
.ag-card-title b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  background: #ddd8c5;
  color: #66462d;
  border-radius: 5px;
}
.ag-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.ag-tags em {
  font-size: 11px;
  font-style: normal;
  background: #ede5ce;
  color: #806321;
  padding: 2px 5px;
  border-radius: 3px;
}
.ag-user {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 12px;
  margin: 5px 0 30px;
}
.ag-user > div {
  max-width: 80%;
  background: var(--accent-soft, #f5e4d8);
  border-radius: 12px 3px 12px 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.ag-user > span {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-muted, #e5e5dc);
  font-size: 11px;
}
.ag-assistant {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 36px;
  font-size: 14px;
}
.ag-logo {
  padding-top: 4px;
}
.ag-timeline {
  border-left: 1px solid #d5b4a3;
  padding: 0 0 0 19px;
  position: relative;
  margin-bottom: 18px;
}
.ag-understanding {
  color: var(--action, #a63f21);
  font-weight: 600;
  position: relative;
  line-height: 28px;
}
.ag-understanding:before {
  content: "";
  position: absolute;
  left: -24px;
  top: 10px;
  background: var(--action, #a63f21);
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.ag-summary {
  font-size: 13px;
  line-height: 1.8;
  margin: 8px 0 14px;
}
.ag-steps {
  border: 1px solid #d8cbbd;
  border-radius: 6px;
  background: var(--surface-soft, #f7f6f1);
  font-size: 12px;
}
.ag-steps > summary {
  padding: 11px 12px;
  cursor: pointer;
}
.ag-steps > summary > span {
  float: right;
  color: var(--muted, #66726b);
  font-size: 11px;
}
.ag-step {
  border-top: 1px solid var(--line, #d5d8ce);
}
.ag-step > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.ag-step summary i {
  font-style: normal;
  width: 16px;
  color: var(--action, #a63f21);
}
.ag-step summary small {
  margin-left: auto;
  color: var(--muted, #66726b);
}
.ag-step > p {
  padding: 0 14px;
  line-height: 1.7;
}
.ag-step.running summary i {
  animation: ag-spin 1.6s linear infinite;
}
.ag-code {
  border: 1px solid var(--line, #d5d8ce);
  border-radius: 4px;
  margin: 12px;
  overflow: hidden;
}
.ag-code header {
  padding: 7px 12px;
  background: var(--surface-muted, #e5e5dc);
  font: 600 12px monospace;
}
.ag-code pre {
  font:
    12px/1.7 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px;
  margin: 0;
  max-height: 320px;
  overflow: auto;
  background: var(--surface-soft, #f7f6f1);
}
.ag-finish {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--action, #a63f21);
}
.ag-answer {
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.ag-answer h1,
.ag-answer h2,
.ag-answer h3 {
  font-size: 17px;
  margin-top: 20px;
}
.ag-answer table {
  width: 100%;
  display: block;
  overflow: auto;
}
.ag-answer pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ag-sources {
  font-size: 12px;
  margin: 14px 0;
}
.ag-sources pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.7;
}
.ag-result-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  align-items: center;
  font-size: 11px;
}
.ag-result-actions button,
.ag-result-actions a {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted, #66726b);
  cursor: pointer;
  text-decoration: none;
}
.ag-result-actions a:hover {
  color: var(--action, #a63f21);
}
#ag-form {
  margin: 8px clamp(18px, 4vw, 60px) 17px;
  border: 1px solid #c2c7bc;
  border-radius: 13px;
  background: var(--paper, #eeede6);
  padding: 15px 16px 10px;
  box-shadow: 0 3px 14px #20333205;
}
#ag-text {
  resize: none;
  background: none;
  border: 0;
  outline: none;
  box-shadow: none;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  min-height: 76px;
  padding: 0;
  color: inherit;
}
.ag-composer-tools {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 12px;
}
.ag-composer-tools select {
  max-width: 140px;
  padding: 4px 6px;
  border: 1px solid var(--line, #d5d8ce);
  border-radius: 5px;
  background: var(--surface, #f5f4ed);
  color: inherit;
}
.ag-knowledge {
  position: relative;
}
.ag-knowledge summary {
  cursor: pointer;
  list-style: none;
}
.ag-knowledge > div {
  position: absolute;
  bottom: 26px;
  left: 0;
  width: 260px;
  max-height: 250px;
  overflow: auto;
  background: var(--surface, #f5f4ed);
  border: 1px solid var(--line, #d5d8ce);
  box-shadow: 0 8px 30px #20333218;
  border-radius: 8px;
  padding: 14px;
  z-index: 5;
}
.ag-knowledge label {
  display: flex;
  gap: 8px;
  margin: 9px 0;
}
.ag-thinking {
  display: flex;
  align-items: center;
  gap: 5px;
}
.ag-thinking input {
  accent-color: var(--action, #a63f21);
}
.ag-model {
  margin-left: auto;
  color: var(--muted, #66726b);
}
.ag-send {
  border: 0;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  background: var(--action, #a63f21);
  color: var(--on-action, #fffaf2);
  cursor: pointer;
  padding: 3px 9px;
}
.ag-send[data-ag-stop] {
  border-radius: 7px;
  font-size: 12px;
}
.ag-send:disabled {
  opacity: 0.5;
  cursor: wait;
}
.ag-input-note {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted, #66726b);
  margin-top: 7px;
}
.ag-input-note button {
  font-size: 10px;
  background: none;
  border: 0;
  color: var(--action, #a63f21);
  cursor: pointer;
}
.ag-muted {
  font-size: 12px;
  color: var(--muted, #66726b);
  line-height: 1.7;
}
.ag-error {
  color: #a53322;
}
.ag-breath {
  animation: ag-breath 1.4s ease-in-out infinite;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.aa-page {
  max-width: 1180px;
  margin: auto;
  padding: 32px 28px 40px;
}
.aa-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.aa-heading h1 {
  font-size: 28px;
  margin: 8px 0;
}
.aa-heading p {
  font-size: 13px;
  color: var(--muted, #66726b);
}
.aa-tag {
  font-size: 12px;
  border: 1px solid var(--line, #d5d8ce);
  padding: 7px 12px;
  border-radius: 20px;
}
.aa-limits {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.aa-limits span {
  font-size: 12px;
  background: var(--surface-muted, #e5e5dc);
  padding: 5px 10px;
  border-radius: 5px;
}
.aa-sandbox-edit {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}
.aa-sandbox-edit label {
  display: grid;
  gap: 10px;
  font-size: 13px;
}
.aa-sandbox-edit textarea {
  width: 100%;
  font:
    13px/1.8 ui-monospace,
    monospace;
  background: var(--surface, #f5f4ed);
  border: 1px solid var(--line, #d5d8ce);
  padding: 16px;
  border-radius: 8px;
  color: inherit;
  tab-size: 4;
}
.aa-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  margin: 18px 0;
  flex-wrap: wrap;
}
.aa-actions p {
  font-size: 12px;
  color: var(--muted, #66726b);
  margin-right: auto;
}
.aa-runs {
  margin-top: 35px;
}
.aa-runs h2 {
  font-size: 18px;
}
.aa-run {
  border: 1px solid var(--line, #d5d8ce);
  border-radius: 7px;
  margin: 12px 0;
  background: var(--surface, #f5f4ed);
  padding: 14px;
}
.aa-run > summary {
  display: flex;
  gap: 20px;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
}
.aa-run > summary small {
  margin-left: auto;
}
.aa-run pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.aa-run .ag-code {
  margin: 12px 0;
}
.aa-access-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
}
.aa-access-layout > aside {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.aa-access-layout > aside button {
  text-align: left;
  padding: 11px 14px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: inherit;
  cursor: pointer;
}
.aa-access-layout > aside button.active {
  background: var(--accent-soft, #f5e4d8);
  color: var(--action, #a63f21);
}
.aa-panel {
  border: 1px solid var(--line, #d5d8ce);
  background: var(--surface, #f5f4ed);
  border-radius: 10px;
  padding: 24px;
}
.aa-panel h2 {
  font-size: 20px;
}
.aa-panel select {
  margin: 0 15px;
  padding: 8px 12px;
  background: var(--paper, #eeede6);
  border: 1px solid var(--line, #d5d8ce);
  border-radius: 6px;
}
.aa-permission-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line, #d5d8ce);
  border-radius: 8px;
  margin: 22px 0;
}
.aa-permission-pick > section {
  padding: 18px;
  max-height: 430px;
  overflow: auto;
}
.aa-permission-pick > section + section {
  border-left: 1px solid var(--line, #d5d8ce);
}
.aa-permission-pick input[type="search"] {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line, #d5d8ce);
  border-radius: 6px;
  background: var(--paper, #eeede6);
}
.aa-permission-pick h3 {
  font-size: 12px;
  color: var(--muted, #66726b);
  margin: 20px 0 10px;
}
.aa-permission-pick label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  font-size: 13px;
}
.aa-permission-pick label[hidden] {
  display: none;
}
.aa-permission-pick input[type="checkbox"] {
  accent-color: var(--action, #a63f21);
}
#aa-picked {
  display: grid;
  gap: 8px;
}
#aa-picked button {
  text-align: left;
  padding: 9px 12px;
  background: var(--accent-soft, #f5e4d8);
  color: var(--action, #a63f21);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}
@keyframes ag-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ag-breath {
  50% {
    opacity: 0.5;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ag-step.running summary i,
  .ag-breath {
    animation: none;
  }
  .ag-messages {
    scroll-behavior: auto;
  }
  .ag-card {
    transition: none;
  }
}
@media (max-width: 1100px) {
  .ag-delete {
    position: static;
    margin-left: 10px;
  }
  .ag-tabs button {
    padding: 8px 12px;
  }
  .ag-page {
    grid-template-columns: 144px minmax(0, 1fr);
  }
  .ag-messages {
    padding: 22px;
  }
  .ag-model {
    display: none;
  }
  .ag-send {
    margin-left: auto;
  }
}
@media (max-width: 760px) {
  .ag-page {
    margin: 0;
    grid-template-columns: 1fr;
    height: calc(100dvh - 125px);
  }
  .ag-history {
    display: none;
  }
  .ag-header {
    padding: 8px;
  }
  .ag-tabs button {
    font-size: 13px;
  }
  .ag-welcome h1 {
    font-size: 22px;
  }
  .ag-cards {
    grid-template-columns: 1fr;
  }
  .ag-assistant {
    gap: 7px;
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .ag-logo img {
    width: 22px;
    height: 22px;
  }
  .ag-messages {
    padding: 18px 12px;
  }
  #ag-form {
    margin: 8px 10px 12px;
    padding: 12px;
  }
  .ag-composer-tools {
    gap: 7px;
  }
  .ag-thinking {
    font-size: 10px;
  }
  .ag-composer-tools select {
    max-width: 100px;
  }
  .ag-step summary small {
    display: none;
  }
  .aa-sandbox-edit,
  .aa-access-layout {
    grid-template-columns: 1fr;
  }
  .aa-access-layout > aside {
    flex-direction: row;
    overflow: auto;
  }
  .aa-access-layout > aside button {
    white-space: nowrap;
  }
  .aa-panel {
    padding: 14px;
  }
  .aa-heading {
    align-items: flex-start;
  }
  .aa-permission-pick > section {
    padding: 10px;
  }
}

body:has(.ag-page) .footer {
  display: none;
}

.ag-step[open] > :not(summary) {
  animation: ag-reveal 180ms ease-out;
}
@keyframes ag-reveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ag-step[open] > :not(summary) {
    animation: none;
  }
}
