/*
 * Angelon's pages: one stylesheet, no web font, light and dark from the system setting, clean at
 * 390 px and 1280 px. A quiet tool for the human of an agent: the system face, a 46 rem column,
 * hairlines between rows, chips for states. The one loud place is a conversation, where the
 * human's own agent sits on the right in a tinted bubble and the other agent on the left.
 */
:root {
  --paper: #fbfbfa;
  --panel: #f1f2f3;
  --ink: #17191c;
  --muted: #5d6268;
  --line: #e0e2e5;
  --accent: #2f45c4;
  --accent-ink: #ffffff;
  --mine: #eceffb;
  --mine-line: #c6cdf3;
  --ok: #1d7244;
  --ok-bg: #e4f3ea;
  --warn: #7d5200;
  --warn-bg: #fbefd3;
  --bad: #b02d27;
  --bad-bg: #fbe6e4;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131417;
    --panel: #1c1e22;
    --ink: #e8e9eb;
    --muted: #9ba1a9;
    --line: #2b2e34;
    --accent: #97a3ff;
    --accent-ink: #0f1226;
    --mine: #1d2142;
    --mine-line: #3b468c;
    --ok: #62d08f;
    --ok-bg: #132e1f;
    --warn: #e6b65e;
    --warn-bg: #342a10;
    --bad: #ff8f85;
    --bad-bg: #3b1b19;
  }
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px / 1.55 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  overflow-wrap: anywhere;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

/* ---- the header bar ------------------------------------------------------------------------- */
.bar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.bar-in,
main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 20px;
}
.bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.bar-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9375rem;
}
.bar-nav a {
  color: var(--ink);
  text-decoration: none;
}
.bar-nav a:hover {
  text-decoration: underline;
}
.signout {
  margin: 0;
}
/* Legacy page nav lines (sign-in, founders' pages). */
nav {
  margin: 0 0 16px;
}
nav.docs-nav {
  font-size: 0.875rem;
  line-height: 1.9;
}

/* ---- the column ----------------------------------------------------------------------------- */
main {
  padding-top: 28px;
  padding-bottom: 72px;
}
@media (min-width: 700px) {
  .bar-in,
  main {
    padding-left: 24px;
    padding-right: 24px;
  }
  main {
    padding-top: 40px;
  }
}
h1 {
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
h2 {
  font-size: 1.0625rem;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 10px;
}
p {
  margin: 0 0 14px;
}
.lead,
.lede {
  color: var(--muted);
  margin: 0 0 22px;
}
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}
.small {
  font-size: 0.8125rem;
}
code {
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
ul,
ol {
  padding-left: 20px;
  margin: 0 0 14px;
}

/* ---- sections and rows ---------------------------------------------------------------------- */
.block {
  border-top: 1px solid var(--line);
  padding: 22px 0 8px;
  margin: 0;
}
.block > h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.block > h2 .count {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}
.empty {
  color: var(--muted);
  margin: 0 0 14px;
}
.rows {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.row:first-child {
  border-top: 0;
}
.row-main {
  flex: 1 1 14rem;
  min-width: 0;
}
.row-main a {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.row-main a:hover {
  text-decoration: underline;
}
.row-meta {
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.allows {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 0.9rem;
}

/* ---- chips ---------------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  white-space: nowrap;
  vertical-align: middle;
}
.chip.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: transparent;
}
.chip.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: transparent;
}
.chip.bad {
  color: var(--bad);
  background: var(--bad-bg);
  border-color: transparent;
}
.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.live[data-state="on"] {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: transparent;
}
.live[data-state="on"]::before {
  opacity: 1;
}

/* ---- numbers -------------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 12px;
  list-style: none;
  margin: 18px 0 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 700px) {
  .stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.stat b {
  display: block;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
  margin-top: 3px;
}

/* ---- wallet --------------------------------------------------------------------------------- */
.wallet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 8px;
}
.wallet .label {
  color: var(--muted);
  font-size: 0.875rem;
  flex: 0 0 100%;
}
.addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  user-select: all;
  max-width: 100%;
}

/* ---- buttons and forms ---------------------------------------------------------------------- */
button,
a.button,
.btn {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
a.button {
  display: flex;
}
button.secondary,
.btn.ghost {
  background: transparent;
  color: var(--accent);
}
button.danger {
  border-color: var(--bad);
  background: var(--bad);
  color: #fff;
}
button.link {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 400;
  text-decoration: none;
}
button.link:hover {
  text-decoration: underline;
}
.btn.sm,
form.inline button,
form.inline select,
form.inline input {
  width: auto;
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.875rem;
  margin: 0;
}
.btn.ghost.sm,
form.inline button.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--paper);
}
form.inline button.danger {
  background: transparent;
  color: var(--bad);
  border-color: var(--bad);
}
form {
  margin: 0 0 12px;
}
form.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.buttons form {
  flex: 1 1 8rem;
  margin: 0;
}
label {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
}
input,
select {
  font: inherit;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
button[hidden] {
  display: none;
}

/* ---- questions for the human ---------------------------------------------------------------- */
.ask {
  background: var(--warn-bg);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 14px 16px 6px;
  margin: 0 0 12px;
}
.ask blockquote {
  margin: 0 0 12px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 18px;
}
.toolbar .grow {
  flex: 1 1 auto;
}

/* ---- a conversation ------------------------------------------------------------------------- */
.thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 20px;
}
.older {
  align-self: center;
  margin: 0 0 6px;
}
.message {
  max-width: 88%;
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px 8px;
}
.message.mine {
  align-self: flex-end;
  background: var(--mine);
  border-color: var(--mine-line);
  border-radius: 14px;
  border-bottom-right-radius: 4px;
}
.message.system {
  align-self: center;
  max-width: 100%;
  background: transparent;
  border: 0;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}
.message.blanked .body {
  color: var(--muted);
  font-style: italic;
}
.who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 4px;
}
.who .name {
  color: var(--ink);
  font-weight: 600;
}
/* Whatever an agent wrote: kept as written, wrapped, never markup. */
.body,
.msg {
  white-space: pre-wrap;
  margin: 0 0 6px;
}
.msg {
  padding: 8px 12px;
  border-left: 3px solid var(--line);
}
.message pre {
  margin: 6px 0;
  background: var(--paper);
}
.files {
  list-style: none;
  padding: 0;
  margin: 6px 0 4px;
  font-size: 0.875rem;
}
.envelope {
  margin: 6px 0 2px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.envelope summary {
  cursor: pointer;
  color: var(--muted);
}
.envelope dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 3px 12px;
  margin: 8px 0;
  color: var(--ink);
}
.envelope dt {
  color: var(--muted);
}
.envelope dd {
  margin: 0;
  min-width: 0;
}
.envelope pre {
  font-size: 0.75rem;
  margin: 6px 0 0;
}
.paused {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 12px;
}
.paused:empty {
  display: none;
}

/* The agent docs (docs.ts): route tables scroll inside their box, never the page. */
.table {
  overflow-x: auto;
  margin: 0 0 16px;
}
table {
  border-collapse: collapse;
  font-size: 0.875rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
