/* Dari's look (dari.dev): charcoal, Geist, mint as the one accent. What sits on the page grid is square;
   what is pressed or floats is rounded. Two weights, 450 and 550. Colors are HSL triples, so
   hsl(var(--x) / a) gives any of them at an opacity. The home page and the dashboard share this file. */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --background: 240 2.4% 8%;
  --foreground: 0 0% 92.9%;
  --card: 240 2% 10%;
  --popover: 240 3% 12.9%;
  --muted: 240 3.3% 11.8%;
  --muted-foreground: 240 2.9% 73.3%;
  --faint: 240 2.8% 51.6%;
  --border: 240 1% 19%;
  --input: 240 1% 25%;
  --accent: 240 1.4% 13.5%;
  --brand: 152 63.8% 72.9%;
  --warning: 37.8 57.5% 62.2%;
  --sage: 120 5.3% 52.4%;
  --destructive: 358 66% 54%;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 248px;
}

* { box-sizing: border-box; border-color: hsl(var(--border)); scrollbar-color: hsl(var(--foreground) / 0.24) transparent; scrollbar-width: thin; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: 450 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: hsl(var(--brand)); color: hsl(var(--background)); }
h1, h2, h3, p, pre, dl, dd, form, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1 { font-size: 20px; line-height: 28px; font-weight: 550; letter-spacing: -0.02em; }
h2 { font-size: 16px; line-height: 24px; font-weight: 550; letter-spacing: -0.02em; }
h3 { font-size: 14px; line-height: 20px; font-weight: 550; letter-spacing: -0.01em; }
code, pre { font-family: var(--mono); }
a { color: inherit; }
.muted { color: hsl(var(--muted-foreground)); }
.faint { color: hsl(var(--faint)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Not display: none, which would also hide the gradient the Codex mark is filled with. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mark { flex-shrink: 0; fill: hsl(var(--foreground)); }
.logo { width: 16px; height: 16px; flex-shrink: 0; }
.logo.mono { fill: currentColor; }
.link { color: hsl(var(--foreground)); text-decoration: underline; text-decoration-color: hsl(var(--foreground) / 0.35); text-underline-offset: 4px; transition: text-decoration-color .15s; }
.link:hover { text-decoration-color: hsl(var(--foreground)); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:focus-visible { outline: none; }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
  height: 36px; padding: 0 16px; border: 1px solid transparent; border-radius: 6px;
  font: 550 14px/1 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.lg { height: 40px; }
.btn.block { width: 100%; }
.btn.primary { border-color: hsl(var(--foreground)); background: hsl(var(--foreground)); color: hsl(var(--background)); }
.btn.primary:hover { background: hsl(var(--foreground) / 0.9); }
.btn.outline { border-color: hsl(var(--input)); background: transparent; color: hsl(var(--foreground)); }
.btn.outline:hover { border-color: hsl(var(--foreground) / 0.4); background: hsl(var(--accent)); }
.btn.ghost { background: transparent; color: hsl(var(--foreground)); }
.btn.ghost:hover { background: hsl(var(--accent)); }
.btn.destructive { border-color: hsl(var(--destructive)); background: hsl(var(--destructive)); color: hsl(0 0% 98%); }
.btn.destructive:hover { background: hsl(var(--destructive) / 0.9); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .icon { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); }
.btn.primary .icon { color: inherit; }
.btn.copied .icon { color: hsl(var(--brand)); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.icon-btn.sm { width: 24px; height: 24px; border-radius: 4px; color: hsl(var(--faint)); }
.btn:focus-visible, .icon-btn:focus-visible, .help button:focus-visible, .text-btn:focus-visible, .trigger:focus-visible,
.nav-item:focus-visible, .link:focus-visible, .wordmark:focus-visible, .command:focus-visible, .chip-btn:focus-visible,
.site-nav a:focus-visible, .site-foot a:focus-visible { box-shadow: 0 0 0 1px hsl(var(--brand)); }
/* A quiet action under a form: Cancel, Back. */
.text-btn { display: inline-flex; padding: 2px 4px; border: 0; border-radius: 4px; background: none; color: hsl(var(--muted-foreground)); font: 450 13px/20px var(--sans); text-decoration: none; cursor: pointer; }
.text-btn:hover { color: hsl(var(--foreground)); }

/* Fields */
.input, .select select {
  height: 36px; border: 1px solid hsl(var(--input)); border-radius: 6px; background: hsl(var(--background));
  color: inherit; font: 450 14px var(--sans); transition: border-color .15s;
}
.input { width: 100%; padding: 0 12px; }
.input::placeholder { color: hsl(var(--faint)); }
.input:focus-visible, .select select:focus-visible { border-color: hsl(var(--brand)); box-shadow: 0 0 0 1px hsl(var(--brand)); }
.select { position: relative; display: flex; align-items: center; min-width: 0; }
.select select { appearance: none; width: 100%; padding: 0 32px 0 12px; text-overflow: ellipsis; cursor: pointer; }
.select .icon { position: absolute; right: 10px; width: 14px; height: 14px; color: hsl(var(--faint)); pointer-events: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 550; }
.form { display: grid; gap: 16px; }
.field.left { text-align: left; }

/* Menus: an org switcher, the account. They open from a trigger, close on Esc or a click elsewhere. */
.menu-wrap { position: relative; }
.menu {
  position: absolute; z-index: 40; min-width: 100%; padding: 4px;
  border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--popover));
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}
.menu.down { top: calc(100% + 4px); left: 0; }
.menu.up { bottom: calc(100% + 4px); left: 0; }
.menu-label { padding: 6px 8px 4px; font-size: 12px; color: hsl(var(--faint)); }
.menu-sep { height: 1px; margin: 4px -4px; background: hsl(var(--border)); }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 6px 8px; border: 0; border-radius: 4px;
  background: none; color: hsl(var(--foreground)); font: 450 14px/20px var(--sans); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item .icon { width: 14px; height: 14px; color: hsl(var(--faint)); }
.menu-item .check { margin-left: auto; color: hsl(var(--foreground)); }
.menu-item:hover, .menu-item:focus-visible { background: hsl(var(--foreground) / 0.1); }
.menu-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Help: a heading's helper text, in a tooltip under the heading. */
.heading { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; }
.help { display: inline-flex; }
.help button { display: inline-flex; padding: 0; border: 0; border-radius: 50%; background: none; color: hsl(var(--faint)); cursor: help; }
.help button:hover, .help button:focus-visible { color: hsl(var(--foreground)); }
.help .icon { width: 14px; height: 14px; }
.tip {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  width: max-content; max-width: min(300px, 80vw); padding: 6px 10px;
  border: 1px solid hsl(var(--border)); border-radius: 6px; background: hsl(var(--popover));
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  font: 450 13px/20px var(--sans); letter-spacing: 0; color: hsl(var(--foreground));
}
.help:hover .tip, .help button:focus-visible + .tip { display: block; }

/* Small parts */
.chip { display: inline-flex; align-items: center; flex-shrink: 0; height: 20px; padding: 0 6px; border-radius: 4px; background: hsl(var(--foreground) / 0.07); font-size: 12px; color: hsl(var(--muted-foreground)); }
/* An agent's own mark, and the agents in a row of chips. */
.agent-logo { width: 14px; height: 14px; flex-shrink: 0; }
.agent-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.agent-chips .chip { gap: 6px; height: 24px; padding: 0 8px; font-size: 13px; color: hsl(var(--foreground)); }
.org-letter { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; height: 20px; border-radius: 4px; background: hsl(var(--foreground) / 0.1); font-size: 11px; font-weight: 550; color: hsl(var(--foreground)); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px;
  border: 1px solid hsl(var(--input)); border-radius: 50%; background: hsl(var(--muted)); font-size: 11px; font-weight: 550; color: hsl(var(--foreground));
}
.avatar .icon { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--input)); }
.st-working, .st-online { color: hsl(var(--foreground)); }
.st-working .dot, .st-online .dot { background: hsl(var(--brand)); }
.st-idle .dot { background: hsl(var(--faint)); }
.st-blocked { color: hsl(var(--warning)); }
.st-blocked .dot { background: hsl(var(--warning)); }
.st-offline, .st-unknown { color: hsl(var(--faint)); }
.code { padding: 12px 14px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--foreground) / 0.03); font-size: 12px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { padding: 12px; border: 1px solid; border-radius: 6px; font-size: 13px; line-height: 20px; }
.notice.error { border-color: hsl(var(--destructive) / 0.5); background: hsl(var(--destructive) / 0.1); }
.notice.warning { border-color: hsl(var(--warning) / 0.4); background: hsl(var(--warning) / 0.1); color: hsl(var(--warning)); }
.notice.quiet { border-color: hsl(var(--border)); color: hsl(var(--muted-foreground)); }
.note { font-size: 12px; line-height: 18px; color: hsl(var(--faint)); }

/* A command or link you click to copy. */
.copy + .copy { margin-top: 12px; }
.copy .label { margin-bottom: 6px; font-size: 12px; color: hsl(var(--faint)); }
.command {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 12px 9px 14px;
  border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--foreground) / 0.025);
  color: hsl(var(--foreground)); font: 12.5px/20px var(--mono); text-align: left; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.command:hover { border-color: hsl(var(--brand) / 0.45); background: hsl(var(--foreground) / 0.05); }
.command .prompt { flex-shrink: 0; color: hsl(var(--faint)); user-select: none; }
.command .text { flex: 1; min-width: 0; overflow-wrap: break-word; }
.command .piece { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.command .icon { flex-shrink: 0; width: 14px; height: 14px; margin-top: 3px; color: hsl(var(--faint)); transition: color .15s; }
.command:hover .icon { color: hsl(var(--foreground)); }
.command.copied { border-color: hsl(var(--brand) / 0.45); }
.command.copied .icon { color: hsl(var(--brand)); }
/* Numbered steps, each over its command. */
.steps-list { display: grid; gap: 16px; padding: 0; margin: 0; list-style: none; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; line-height: 20px; color: hsl(var(--muted-foreground)); }
.step-n { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; height: 20px; border: 1px solid hsl(var(--input)); border-radius: 50%; font-size: 11px; font-weight: 550; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }

/* The wordmark: the round mark beside the name. */
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-width: 0; border-radius: 6px; color: hsl(var(--foreground)); font-size: 15px; font-weight: 550; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }

/* ———— One-off screens: sign in, create an org, join one, approve a machine. A centred column, no card. ———— */
.solo { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; padding: 48px 24px 24px; }
.solo-in { width: 100%; max-width: 360px; margin: auto; padding-bottom: 24px; }
.solo-in > .mark { display: block; width: 36px; height: 36px; margin: 0 auto 24px; }
.screen { display: grid; gap: 32px; text-align: center; }
.screen > h1 { overflow-wrap: anywhere; }
.screen-head { display: grid; gap: 8px; }
.screen-head p { font-size: 14px; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.screen .stack { display: grid; gap: 12px; text-align: left; }
.screen .after { display: flex; justify-content: center; margin-top: -16px; }
.screen .why { margin-top: -16px; font-size: 13px; line-height: 20px; color: hsl(var(--foreground)); }
.screen .notice { text-align: left; }
.screen .notice code { font-size: 12px; }
/* The code a machine shows: big and spaced, to check against the terminal at a glance. */
.otp { padding: 18px 12px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--foreground) / 0.03); font: 500 24px/32px var(--mono); letter-spacing: 0.16em; text-indent: 0.16em; }
.otp + .note { margin-top: 10px; }
/* Label-and-value rows: every row the same height whatever it holds. */
.rows { border-top: 1px solid hsl(var(--border)); text-align: left; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid hsl(var(--border)); }
.row > .faint { flex-shrink: 0; font-size: 13px; }
.row > strong { min-width: 0; font-weight: 550; overflow-wrap: anywhere; text-align: right; }
.row .select { width: min(200px, 60%); }
.who-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; padding-top: 16px; font-size: 13px; color: hsl(var(--faint)); text-align: center; }
.who-line strong { font-weight: 450; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }

/* ———— The signed-in app: a sidebar beside the page. ———— */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; height: 100svh;
  border-right: 1px solid hsl(var(--border)); background: hsl(var(--background));
}
.sb-head { display: flex; align-items: center; height: 56px; flex-shrink: 0; padding: 0 16px; border-bottom: 1px solid hsl(var(--border)); }
.sb-head .mark { width: 24px; height: 24px; }
.sb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 8px; }
.sb-group + .sb-group { margin-top: 16px; }
.sb-label { display: flex; align-items: center; height: 32px; padding: 0 8px; font-size: 12px; font-weight: 550; color: hsl(var(--sage)); }
.sb-group ul { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 6px;
  color: hsl(var(--muted-foreground)); font-size: 14px; text-decoration: none; transition: background-color .15s, color .15s;
}
.nav-item .icon { color: hsl(var(--faint)); }
.nav-item:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.nav-item:hover .icon { color: hsl(var(--foreground)); }
.nav-item[aria-current="page"] { background: hsl(var(--accent)); color: hsl(var(--foreground)); font-weight: 550; }
.nav-item[aria-current="page"] .icon { color: hsl(var(--brand)); }
.nav-item .count { margin-left: auto; font-size: 12px; font-weight: 450; color: hsl(var(--faint)); font-variant-numeric: tabular-nums; }
.nav-item .out { margin-left: auto; width: 14px; height: 14px; opacity: 0; transition: opacity .15s; }
.nav-item:hover .out { opacity: 1; }
/* Triggers: the org switcher and the account. */
.trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 0 10px; border: 1px solid hsl(var(--input));
  border-radius: 6px; background: transparent; color: hsl(var(--foreground)); font: 450 14px var(--sans); text-align: left; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.trigger:hover, .trigger[aria-expanded="true"] { border-color: hsl(var(--foreground) / 0.4); background: hsl(var(--accent)); }
.trigger > .icon { width: 14px; height: 14px; margin-left: auto; color: hsl(var(--faint)); }
.trigger:disabled { cursor: default; }
.trigger:disabled:hover { border-color: hsl(var(--input)); background: transparent; }
.org-trigger { height: 36px; }
.sb-org { padding: 12px 12px 0; }
.sb-org .menu { right: 0; max-height: 60vh; overflow-y: auto; }
.sb-foot { flex-shrink: 0; padding: 12px; border-top: 1px solid hsl(var(--border)); }
.account { height: 48px; padding: 0 8px; border-color: transparent; }
.account:hover, .account[aria-expanded="true"] { border-color: transparent; }
.account-text { display: grid; min-width: 0; line-height: 18px; }
.account-text .name { font-size: 13px; font-weight: 550; }
.account-text .sub { font-size: 12px; color: hsl(var(--faint)); }
.sb-foot .menu { right: 0; }

.topbar { display: none; }
.scrim { display: none; }
.content { min-width: 0; }
.page { max-width: 1160px; margin: 0 auto; padding: 28px 32px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; margin-bottom: 24px; }
.page-head h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-actions { display: flex; flex-shrink: 0; gap: 8px; }
/* Lined up with the page under it: 1096px wide, centred, never closer than 32px to the edges. */
.content > .notice { margin: 24px max(32px, calc((100% - 1096px) / 2)) 0; }

/* Stat tiles: one outer rule, hairlines between cells. */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 24px; border: 1px solid hsl(var(--border)); background: hsl(var(--border)); }
.tile { min-width: 0; padding: 12px 16px 14px; background: hsl(var(--card)); }
.tile dt, .tile .detail { font-size: 12px; color: hsl(var(--muted-foreground)); }
.tile dd { margin-top: 6px; font-size: 24px; line-height: 32px; font-weight: 550; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile .detail { margin-top: 2px; min-height: 18px; }
.tile .detail.warn { color: hsl(var(--warning)); }

/* Panels and tables: square, ruled. */
.panel { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 12px; border-bottom: 1px solid hsl(var(--border)); text-align: left; font-size: 12px; font-weight: 550; color: hsl(var(--faint)); white-space: nowrap; }
td { height: 44px; padding: 6px 12px; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td .chip { margin-left: 8px; }
td .btn.sm { height: 28px; margin: -4px 0; }
.name-cell { font-weight: 550; }
/* The name cell takes the width the other columns leave, and clips what does not fit. */
.person-td { width: 100%; max-width: 0; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-text { min-width: 0; line-height: 18px; }
.person-line { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.person-line .chip { margin: 0; font-weight: 450; }
.person-email { font-size: 12px; color: hsl(var(--faint)); }

/* The messages row spans all five columns, so the widths of the columns shown must add up to 100%:
   a fixed-layout table hands any remainder to the hidden ones. The last column takes what is left. */
.agents { table-layout: fixed; }
.agents th:nth-child(1) { width: 34%; }
.agents th:nth-child(2) { width: 12%; }
.agents th:nth-child(3) { width: 8%; }
.agents th:nth-child(4) { width: 24%; }
.agents td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.agent { cursor: pointer; }
tr.agent td { transition: background-color .15s; }
tr.agent:hover td, tr.agent.open td { background: hsl(var(--accent)); }
tr.agent td:first-child { padding-left: 8px; }
tr.agent.sub td:first-child { padding-left: 32px; }
.agent-id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.agent-id .chip { margin: 0; }
.agent-id .icon { transition: transform .15s; }
tr.agent.open .agent-id .icon { transform: rotate(90deg); color: hsl(var(--foreground)); }
.id { overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12px; }
.path { font-family: var(--mono); font-size: 12px; color: hsl(var(--muted-foreground)); }
/* An open agent's latest messages. */
tr.transcript td { height: auto; padding: 0; background: hsl(var(--background)); white-space: normal; }
.entries { display: grid; gap: 12px; max-height: 480px; padding: 14px 16px 14px 40px; overflow-y: auto; font-size: 13px; }
.entry-meta { font-size: 12px; color: hsl(var(--faint)); }
.entry-body { max-width: 96ch; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
/* A run of tool calls: its last few, a line each, cut at the edge (the full line is the tooltip). */
.entry.tool .entry-body { display: grid; gap: 6px; max-width: none; font-family: var(--mono); font-size: 12px; white-space: normal; color: hsl(var(--muted-foreground)); }
.tool-more { color: hsl(var(--faint)); }
.tool-line { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
.tool-time { grid-row: span 2; color: hsl(var(--faint)); }
.tool-text { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-result { color: hsl(var(--faint)); }
.tool-result.failed { color: hsl(var(--destructive)); }
.entry.error .entry-body { color: hsl(var(--destructive)); }

/* Empty states: what to do next, with the command. */
.empty { padding: 20px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.empty > p { max-width: 60ch; margin-top: 4px; font-size: 13px; line-height: 20px; color: hsl(var(--muted-foreground)); }
.empty > .copies, .empty > .btn { margin-top: 16px; }
.empty > .agent-chips { margin-top: 14px; }
.empty .copies { max-width: 720px; }

/* A section under a page's main table, such as invites nobody has used. */
.section { margin-top: 32px; }
.section > .heading { margin-bottom: 12px; }
.more { display: flex; justify-content: center; margin-top: 16px; }

/* The activity log: when, what, and from where. */
.activity td { font-size: 13px; }
.activity td:first-child { width: 1%; white-space: nowrap; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.activity td:last-child { width: 1%; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: hsl(var(--faint)); }
.event { line-height: 20px; overflow-wrap: anywhere; }
.event .id { font-size: 12px; }
.event .chip { margin: 0 0 0 8px; }
.chip.refused { background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); }
/* A table too wide for a phone scrolls inside its panel, not the page. */
.panel.scroll { overflow-x: auto; }
.panel.scroll td, .panel.scroll th { white-space: nowrap; }

/* Connections: a row each. */
.conn { display: grid; gap: 4px; padding: 16px; border-bottom: 1px solid hsl(var(--border)); }
.conn:last-child { border-bottom: 0; }
.conn-head { display: flex; align-items: center; gap: 12px; min-height: 24px; }
.conn-head h2 { font-size: 15px; line-height: 22px; letter-spacing: -0.01em; }
.conn-head .docs { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: hsl(var(--muted-foreground)); text-decoration: none; border-radius: 4px; }
.conn-head .docs:hover { color: hsl(var(--foreground)); }
.conn-head .docs .icon { width: 14px; height: 14px; }
.conn-about { max-width: 72ch; font-size: 13px; line-height: 20px; color: hsl(var(--muted-foreground)); }
.conn-detail { font-size: 12px; line-height: 18px; color: hsl(var(--faint)); overflow-wrap: anywhere; }
.conn .copy { margin-top: 8px; max-width: 720px; }
.conn .link { justify-self: start; margin-top: 4px; font-size: 13px; }

/* Dialog */
dialog { width: calc(100% - 32px); max-width: 520px; padding: 0; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--card)); color: inherit; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5); }
dialog:focus { outline: none; }
dialog::backdrop { background: rgb(0 0 0 / 0.6); backdrop-filter: blur(2px); }
.dialog-in { padding: 24px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-head .icon-btn { margin: -4px -8px -4px 0; }
.dialog-text { color: hsl(var(--muted-foreground)); }
.dialog-text code { font-size: 13px; white-space: nowrap; }
#dialog-body > .field { margin-top: 16px; }
td.acts { white-space: nowrap; }
td.acts .btn + .btn { margin-left: 4px; }
.conn-head .docs + .btn { margin: -4px -12px -4px 0; }
#dialog-body > .note { margin-top: 12px; }
#dialog-body > .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 1080px) {
  .page { padding-left: 24px; padding-right: 24px; }
  .content > .notice { margin-left: 24px; margin-right: 24px; }
}

/* Phones and narrow windows: the sidebar becomes a drawer under a top bar. */
@media (max-width: 860px) {
  .shell { display: block; }
  .topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--background));
  }
  .topbar .mark { width: 24px; height: 24px; }
  .topbar-org { min-width: 0; margin-right: auto; padding-left: 12px; border-left: 1px solid hsl(var(--border)); font-size: 14px; color: hsl(var(--muted-foreground)); }
  .sidebar { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: min(288px, 86vw); height: auto; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s .2s; }
  .shell.drawer .sidebar { transform: none; visibility: visible; transition: transform .2s ease; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5); }
  .shell.drawer .scrim { display: block; position: fixed; z-index: 45; inset: 0; background: rgb(0 0 0 / 0.6); }
  .page { padding: 20px 16px 48px; }
  .content > .notice { margin: 16px 16px 0; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Under 16px, phones zoom the page when a field takes focus. */
  .input, .select select { font-size: 16px; }
  .agents th:nth-child(3), .agents td:nth-child(3), .agents th:nth-child(5), .agents td:nth-child(5), .agent-id .chip { display: none; }
  .agents th:nth-child(1) { width: 46%; }
  .agents th:nth-child(2) { width: 22%; }
  .agents th:nth-child(4) { width: 32%; }
  .entries { padding-left: 16px; }
}
@media (max-width: 560px) {
  /* A person's actions go on a line of their own under the name, which keeps its width. */
  .people, .people thead, .people tbody { display: block; }
  .people tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid hsl(var(--border)); }
  .people tbody tr:last-child { border-bottom: 0; }
  .people th, .people td { display: flex; align-items: center; border-bottom: 0; }
  .people th:last-child, .people td.acts:empty { display: none; }
  .people td { height: auto; min-height: 44px; }
  .people .person-td { width: auto; max-width: none; }
  .people td.acts { grid-column: 1 / -1; min-height: 0; padding: 0 12px 10px 38px; }
  .tile { padding: 10px 12px; }
  .tile dd { font-size: 20px; line-height: 28px; }
  .agents th:nth-child(4), .agents td:nth-child(4) { display: none; }
  .agents th:nth-child(1) { width: 68%; }
  .agents th:nth-child(2) { width: 32%; }
  .wide { display: none; }
  .page-head { flex-wrap: wrap; }
  .solo { padding-top: 32px; }
  .empty { padding: 16px; }
}

/* ———— The home page (contextdrop.dev). ———— */
.site { --gutter: max(24px, calc(50vw - 560px)); }
.site-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; padding: 0 var(--gutter); border-bottom: 1px solid hsl(var(--border)); }
.site-top .mark { width: 24px; height: 24px; }
.site-nav { display: flex; align-items: center; gap: 24px; font-size: 13px; }
.site-nav a:not(.btn) { color: hsl(var(--muted-foreground)); text-decoration: none; border-radius: 4px; }
.site-nav a:not(.btn):hover { color: hsl(var(--foreground)); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 120px var(--gutter); border-bottom: 1px solid hsl(var(--border)); }
.hero h1 { font-size: 44px; line-height: 1.12; font-weight: 500; letter-spacing: -0.03em; }
.hero h1 u { text-decoration: underline; text-decoration-color: hsl(var(--brand)); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.lead { max-width: 46ch; margin-top: 20px; font-size: 17px; line-height: 1.65; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-actions .btn { height: 40px; padding: 0 18px; }
.steps { display: grid; gap: 16px; min-width: 0; }
.step-label { margin-bottom: 8px; font-size: 12px; color: hsl(var(--faint)); }
.steps .note { font-size: 13px; line-height: 20px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 72px var(--gutter) 0; border: 1px solid hsl(var(--border)); }
.facts > div { padding: 28px 28px 32px; }
.facts > div + div { border-left: 1px solid hsl(var(--border)); }
.facts h2 { margin-bottom: 8px; font-size: 18px; line-height: 26px; font-weight: 500; letter-spacing: -0.015em; color: hsl(var(--sage)); }
.facts p { font-size: 15px; line-height: 1.6; color: hsl(var(--foreground)); text-wrap: pretty; }
.demo { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 48px; align-items: center; padding: 72px var(--gutter); }
.demo h2 { font-size: 24px; line-height: 32px; font-weight: 500; letter-spacing: -0.02em; }
.demo p { max-width: 40ch; margin-top: 12px; font-size: 15px; line-height: 1.65; color: hsl(var(--muted-foreground)); }
.terminal { min-width: 0; margin: 0; padding: 16px 18px; overflow-x: auto; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--foreground) / 0.025); font-size: 12.5px; line-height: 1.75; color: hsl(var(--muted-foreground)); white-space: pre; }
.terminal b { font-weight: 450; color: hsl(var(--foreground)); }
.terminal i { font-style: normal; color: hsl(var(--faint)); }
.terminal .ok { color: hsl(var(--brand)); }
.site-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 28px var(--gutter) 40px; border-top: 1px solid hsl(var(--border)); font-size: 13px; color: hsl(var(--muted-foreground)); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-foot a { border-radius: 4px; text-decoration: underline; text-decoration-color: hsl(var(--foreground) / 0.35); text-underline-offset: 4px; }
.site-foot a:hover { text-decoration-color: currentColor; }

@media (max-width: 960px) {
  .hero, .demo { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 40px; padding-top: 72px; padding-bottom: 72px; }
  .facts { grid-template-columns: minmax(0, 1fr); margin-top: 48px; }
  .facts > div + div { border-left: 0; border-top: 1px solid hsl(var(--border)); }
  .demo { gap: 24px; padding-top: 48px; padding-bottom: 56px; }
}
@media (max-width: 560px) {
  .site-top { height: 60px; }
  .site-nav { gap: 16px; }
  .site-nav .wide-only { display: none; }
  .hero h1 { font-size: 34px; }
  .lead { font-size: 16px; }
  .facts > div { padding: 22px 20px 24px; }
}
