* { box-sizing: border-box; }

html { background: var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { margin: 0; }
h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 13px; font-weight: 500; margin-bottom: 6px; }

code { font: 13px var(--mono); overflow-wrap: anywhere; }

.num { text-align: right; }
.lead { font-size: 16px; margin: 0; }


/* Top bar, profile menu and tabs: one 1120px column with the page, like aylon.co's nav. */
.topbar { background: var(--ground); border-bottom: 1px solid var(--border); }
.topbar-inner, .tabs { max-width: 1120px; margin: 0 auto; padding: 0 32px; box-sizing: border-box; }
.topbar-inner { display: flex; align-items: center; gap: 14px; min-height: 72px; }
.wordmark { color: var(--text); font: 500 20px/1 var(--sans); letter-spacing: -0.03em; }
.wordmark:hover { color: var(--text); }
.org-pill { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile { margin-left: auto; position: relative; }
.profile summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; color: var(--text); }
.profile summary::-webkit-details-marker { display: none; }
.profile summary:hover, .profile[open] summary { background: var(--neutral-bg); }
.profile summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-light); display: inline-flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px; flex: none; }
.profile-name { font-size: 14px; font-weight: 500; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px var(--shadow); padding: 6px; z-index: 20; display: flex; flex-direction: column; }
.profile-who { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--divider); margin-bottom: 6px; overflow-wrap: anywhere; }
.profile-full { font-weight: 500; }
.profile-menu a, .menu-logout { display: block; color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.profile-menu a:hover, .menu-logout:hover { background: var(--neutral-bg); color: var(--text); }
.profile-menu a[aria-current="page"] { font-weight: 500; background: var(--neutral-bg); }
.profile-menu form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--divider); }
.menu-logout { width: 100%; text-align: left; background: transparent; border: 0; color: var(--error-text); min-height: 40px; }
.menu-logout:hover { color: var(--error-text); }
.theme-toggle { margin-left: auto; display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--muted); }
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle + .profile { margin-left: 0; }
.theme-toggle .icon-moon, :root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.tabs { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: var(--muted); padding: 12px 0; border-bottom: 2px solid transparent; font-size: 15px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 500; border-bottom-color: var(--accent); }

/* Buttons and forms */
button { font: inherit; cursor: pointer; }
.btn-outline {
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 0 14px;
  min-height: 36px;
  font-weight: 500;
  transition: border-color .15s ease;
}
.btn-outline:hover { border-color: var(--muted); color: var(--text); }
.btn-primary {
  background: var(--text);
  color: var(--on-light);
  border: 0;
  border-radius: 10px;
  padding: 0 22px;
  min-height: 46px;
  font-weight: 500;
  transition: opacity .15s ease;
}
.btn-primary:hover { opacity: 0.88; color: var(--on-light); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a.btn-primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.narrow { max-width: 480px; margin: 0 auto; padding: 88px 24px; display: flex; flex-direction: column; gap: 24px; }
.form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions > button { flex: 1 1 180px; }
.connect-scope { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
/* One style for every input and select: the same height, border, radius and padding. */
.field input, .field select, .filter input, .filter select, .row-form select {
  font: 14px var(--sans);
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  width: 100%;
  min-width: 0;
}
.field select, .filter select, .row-form select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238B8B93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.narrow .field input { font-size: 15px; height: 48px; padding: 0 14px; border-radius: 10px; }
.field input:focus, .field select:focus, .filter input:focus, .filter select:focus, .row-form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.error-message { color: var(--error-text); margin: 0; overflow-wrap: anywhere; }

/* Page */
.page { max-width: 1120px; margin: 0 auto; padding: 32px 32px 72px; box-sizing: border-box; display: flex; flex-direction: column; gap: 24px; }
.display { font: 500 28px/1.15 var(--display); letter-spacing: -0.035em; }
.narrow .display { font-size: 42px; line-height: 1.02; letter-spacing: -0.04em; }
.title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.session-title { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.back { font-size: 14px; align-self: flex-start; }

/* Live indicator */
.live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 13px var(--mono);
  color: var(--neutral-text);
  background: var(--neutral-bg);
  border-radius: 999px;
  padding: 6px 12px;
}
.live-pill .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--faint); }
.live-pill.on { color: var(--ok-text); background: var(--ok-bg); }
.live-pill.on .dot { background: var(--accent); }

/* Cards and tiles */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; min-width: 0; }
.card.flush { overflow: hidden; }
.card-head {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  border-bottom: 1px solid var(--divider);
}
.card-head.column { flex-direction: column; align-items: flex-start; }
.empty { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.empty p { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.tile { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.tile-label { font-size: 14px; color: var(--muted); }
.tile-value { font: 30px var(--mono); letter-spacing: -0.03em; line-height: 1.2; }
.tile-value.small-value { font-size: 22px; }
.tile-note { font-size: 13px; color: var(--muted); }
.bar { height: 6px; background: var(--row-line); border-radius: 999px; }
.bar-fill { height: 6px; background: var(--text); border-radius: 999px; }
.bar-fill.bar-full { background: var(--error-text); }

/* Budgets */
.budget { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.budget-text { color: var(--muted); white-space: nowrap; }
.budget-cell { width: 240px; }
.budget-card { padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.budget-card > .stack-xs { flex: 1 1 280px; max-width: 480px; }
.row-muted td { color: var(--muted); }
.table-budgets { min-width: 640px; }
.budget-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.budget-input { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--input-border); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.budget-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.budget-input span { color: var(--muted); font: 13px var(--mono); }
.budget-input input { border: 0; outline: 0; width: 90px; padding: 7px 0; font: 14px var(--mono); background: transparent; color: var(--text); }
.budget-form + .error-message { margin-top: 6px; font-size: 13px; }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 12px var(--mono);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-ok { background: var(--ok-bg); color: var(--ok-text); }
.chip-error { background: var(--error-bg); color: var(--error-text); }
.chip-running { background: var(--neutral-bg); color: var(--neutral-text); }
.pulse { width: 7px; height: 7px; border-radius: 999px; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 1.2s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.25; } }
}

/* Tables */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 14px; }
.table th {
  text-align: left;
  font: 500 12px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 20px;
  white-space: nowrap;
}
.table th.num { text-align: right; }
.table td { padding: 11px 20px; border-top: 1px solid var(--row-line); vertical-align: middle; }
.table td.mono { font-size: 13px; }
.table tr.row-error td { background: var(--error-row); }
.sid {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.tool-link { color: var(--text); font-size: 13px; }
/* Takes the leftover width and cuts long arguments with an ellipsis. */
.tool-cell { max-width: 0; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-recent { min-width: 560px; }
.nowrap { white-space: nowrap; }
.args { overflow-wrap: anywhere; }

.look-empty { margin: 0; padding: 16px 20px; }

/* Session timeline */
.call-head, .call-row {
  display: grid;
  grid-template-columns: 32px 92px minmax(0, 1fr) 80px 72px 64px 150px;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
}
.call-head {
  font: 500 12px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.calls { margin: 0; padding: 0; list-style: none; }
.call { border-top: 1px solid var(--row-line); }
.call.error { background: var(--error-row); border-top-color: var(--error-line); }
.call-row { cursor: pointer; list-style: none; font-size: 14px; }
.call-row::-webkit-details-marker { display: none; }
.call-row:hover { background: var(--hover); }
details[open] > .call-row { background: var(--neutral-bg); }
.call-n { color: var(--faint); font-size: 12px; }
.call-time { color: var(--muted); font-size: 13px; }
.call-tool { min-width: 0; overflow-wrap: anywhere; }
.call-tool .mono { font-size: 13px; font-weight: 500; }
.call-tool .args { color: var(--faint); font-size: 13px; }
.call-latency, .call-results, .call-cost { font-size: 13px; color: var(--muted); }
.call-error { grid-column: 3 / -1; color: var(--error-text); font-size: 13px; overflow-wrap: anywhere; }
.call-body {
  padding: 4px 20px 20px 156px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.call-body section { min-width: 0; }
.code {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font: 12.5px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 360px;
  overflow: auto;
}
.empty pre { margin: 0; border: 1px solid var(--border); background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 14px 16px; font: 13px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Phone widths */
@media (max-width: 720px) {
  .topbar-inner, .tabs { padding: 0 16px; }
  .tabs { gap: 20px; }
  .org-pill { max-width: 120px; }
  .profile-name { display: none; }
  .page { padding: 24px 16px 56px; }
  .narrow { padding: 48px 16px; }
  .display { font-size: 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 24px; }
  .call-head { display: none; }
  .call-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "tool tool tool status" "time latency cost ." "error error error error";
    gap: 4px 12px;
    padding: 12px 16px;
  }
  .call-n, .call-results { display: none; }
  .call-tool { grid-area: tool; }
  .call-status { grid-area: status; }
  .call-time { grid-area: time; }
  .call-latency { grid-area: latency; text-align: left; }
  .call-cost { grid-area: cost; text-align: left; }
  .call-error { grid-area: error; }
  .call-body { padding: 4px 16px 16px; grid-template-columns: minmax(0, 1fr); }
  .card-head { padding: 14px 16px; }
  .table th, .table td { padding-left: 16px; padding-right: 16px; }
  /* Budgets: agent and spend on one line, the form below, so Save stays in view. */
  .table-budgets { min-width: 0; }
  .table-budgets thead { display: none; }
  .table-budgets tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 16px; border-top: 1px solid var(--row-line); }
  .table-budgets tr:first-child { border-top: 0; }
  .table-budgets td { padding: 0; border: 0; }
  .table-budgets td:nth-child(1) { grid-area: 1 / 1; }
  .table-budgets td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; }
  .table-budgets td:nth-child(3), .table-budgets td:nth-child(4) { display: none; }
  .table-budgets td:nth-child(5) { grid-area: 1 / 2; }
  .table-budgets td:nth-child(5)::after { content: " spent"; color: var(--muted); font-family: var(--sans); }
  /* An agent's sessions: id and status, then the budget bar; started and calls are on the session page. */
  .table-agent-sessions { min-width: 0; }
  .table-agent-sessions thead { display: none; }
  .table-agent-sessions tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--row-line); }
  .table-agent-sessions tr:first-child { border-top: 0; }
  .table-agent-sessions td { padding: 0; border: 0; }
  .table-agent-sessions td:nth-child(1) { grid-area: 1 / 1; min-width: 0; }
  .table-agent-sessions td:nth-child(1) .sid { max-width: 100%; }
  .table-agent-sessions td:nth-child(2) { grid-area: 1 / 2; }
  .table-agent-sessions td:nth-child(6) { grid-area: 1 / 3; }
  .table-agent-sessions td:nth-child(3), .table-agent-sessions td:nth-child(4) { display: none; }
  .table-agent-sessions td:nth-child(5) { grid-area: 2 / 1 / 3 / 4; width: auto; }
}

/* Phase 4: balance, ledger, tool health, all calls */
.balance-card { padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.chip-check { background: var(--error-bg); color: var(--error-text); }
.table-ledger { min-width: 560px; }
.table-health { min-width: 960px; }
.table-health td, .table-health th { white-space: nowrap; }
.table-all-calls { min-width: 760px; }
/* One filter bar: a grid of equal-width fields, the button in the last cell on the field baseline. */
.filters { padding: 16px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px 16px; }
.filter { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.filter-actions { display: flex; align-items: center; gap: 12px; min-height: 38px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 14px 20px; border-top: 1px solid var(--row-line); font-size: 14px; }
@media (max-width: 720px) {
  .filters { padding: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .filters-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.filters .btn-primary, .inline-form .btn-primary { min-height: 38px; padding: 0 16px; }

/* Tools */
.tool-about { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--divider); }
.tool-about p { margin: 0; }
/* A 2-column definition grid (Provider | REST, MCP | Usage); one column on a phone. */
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 40px; }
.facts div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.facts .endpoint { display: block; width: fit-content; margin-bottom: 6px; max-width: 100%; background: var(--neutral-bg); border-radius: 6px; padding: 3px 8px; overflow-wrap: anywhere; }
.table-inputs { min-width: 640px; }
.table-providers { min-width: 720px; }
.table-providers td { vertical-align: top; }
.input-default { white-space: nowrap; }
@media (max-width: 720px) {
  .tool-about { padding: 14px 16px 16px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  /* A tool's inputs: name, type and required or default on one line, the description below. */
  .table-inputs { min-width: 0; }
  .table-inputs thead { display: none; }
  .table-inputs tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 12px 16px; border-top: 1px solid var(--row-line); }
  .table-inputs tr:first-child { border-top: 0; }
  .table-inputs td { padding: 0; border: 0; }
  .table-inputs td.input-default { white-space: normal; overflow-wrap: anywhere; }
  .table-inputs td:nth-child(4) { grid-column: 1 / -1; }
}

/* Phase 7 alignment pass */
.page > * { min-width: 0; max-width: 100%; }

/* Stat tiles: five across when there is room, 3 + 2 on a tablet, 2 + 2 + 1 on a phone. */
.tile-value { overflow-wrap: anywhere; }
.tiles-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tiles-5 > * { grid-column: span 2; }
.tiles-5 > :nth-child(n + 4) { grid-column: span 3; }
@media (min-width: 1112px) {
  .tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tiles-5 > *, .tiles-5 > :nth-child(n + 4) { grid-column: auto; }
}
@media (max-width: 720px) {
  .tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles-5 > *, .tiles-5 > :nth-child(n + 4) { grid-column: auto; }
  .tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Cells: names with a badge stay on one line; long values cut with an ellipsis (and a title). */
.name-cell { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.suffix { color: var(--muted); font-size: 13px; }
.trunc { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.trunc-lg { max-width: 420px; }
.table th.actions, .table td.actions { text-align: right; white-space: nowrap; }
.table-keys { min-width: 980px; }
.table-keys td.label { min-width: 140px; }
.table-members { min-width: 760px; }

/* Forms that sit on one row on a desktop and stack on a phone, like the filter bars. */
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 0; }
.inline-form .field { flex: 1 1 220px; max-width: 420px; min-width: 0; }
.inline-form .field.narrow-field { flex: 0 1 160px; }
.inline-form > p { flex-basis: 100%; margin: 0; }
.inline-form > button { min-height: 38px; }
@media (max-width: 720px) {
  .inline-form .field, .inline-form .field.narrow-field { flex: 1 1 100%; max-width: none; }
  .inline-form > button { width: 100%; }
}
.card.form > .stack-sm, .card.form > form { min-width: 0; }

/* A table row's actions: the role select and its button, and Remove, on one line. */
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
.row-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.row-form select { height: 36px; width: auto; min-width: 110px; }
.btn-danger { color: var(--error-text); border-color: var(--error-line); }
.btn-danger:hover { border-color: var(--error-text); background: var(--error-bg); }

/* Phone tabs: scroll sideways, fade at an edge that has more behind it. */
@media (max-width: 720px) {
  .tabs.fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .tabs.fade-start { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
  .tabs.fade-start.fade-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
}

/* Fix round 1 */
.filters-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters-five .filter-actions { grid-column: 1 / -1; }
@media (min-width: 860px) {
  .filters-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .filters-five .filter-actions { grid-column: auto; }
}
time { white-space: nowrap; }
/* The actions column stays in view at the right edge of a scrolling table. */
.table th.actions, .table td.actions { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px var(--shadow); }
.table tr.row-error td.actions { background: var(--error-row); }

/* The Keys page's tool picker. */
.tool-picker { border: 1px solid var(--border); border-radius: 10px; margin: 0; padding: 14px 16px 16px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tool-picker legend { font-size: 14px; font-weight: 500; padding: 0 6px; }
.tool-mode { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.tool-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; }
.tool-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tool-group label, .tool-mode label { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.tool-group input, .tool-mode input { accent-color: var(--accent); margin: 0; }

/* Overview: the balance card, onboarding for a fresh organization, and a card per agent. */
.overview-balance { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.balance-facts { display: flex; flex-wrap: wrap; gap: 6px 28px; color: var(--muted); font-size: 14px; }
.balance-facts strong { color: var(--text); font-weight: 500; }
.balance-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.balance-actions a { display: inline-flex; align-items: center; color: var(--text); }
.balance-warning { margin: 0; color: var(--error-text); background: var(--error-bg); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.onboarding { min-width: 0; }
.onboarding .get-started { padding-top: 8px; }
.get-started { width: 100%; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.get-started h2 { font-size: 18px; font-weight: 500; margin: 0; }
.get-started h2.muted { font-size: 16px; }
.get-started p { margin: 0; }
.get-started-fast { display: flex; flex-direction: column; gap: 14px; padding: 24px; background: var(--surface); border: 1px solid var(--accent-line); border-radius: 16px; min-width: 0; }
.get-started-fast .setup-prompt { font-size: 14px; padding: 14px 16px; border-radius: 10px; background: var(--code-bg); color: var(--code-text); border: 1px solid var(--border); overflow-wrap: anywhere; }
.get-started-fast .btn-primary { align-self: flex-start; min-height: 48px; padding: 0 22px; font-size: 15px; background: var(--accent); }
.agent-tabs { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; min-width: 0; }
.agent-tabs .client-picker { display: flex; width: auto; gap: 4px; padding: 8px; background: none; border-radius: 0; border-bottom: 1px solid var(--border); }
.agent-tabs .client-picker label { min-height: 44px; padding: 0 16px; border-radius: 10px; }
.agent-tabs .client-picker label:has(input:checked) { background: var(--accent-tint); color: var(--accent); box-shadow: none; }
.agent-tabs .client-panel { padding: 24px; }
.agent-tabs .client-panel > p { margin: 0 0 14px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; }
.copy-row code { flex: 1 1 300px; min-width: 0; font: 14px var(--mono); padding: 12px 14px; border-radius: 10px; background: var(--code-bg); color: var(--code-text); border: 1px solid var(--border); overflow-wrap: anywhere; }
.copy-row .btn-outline { min-height: 48px; padding: 0 20px; color: var(--text); }
.sign-in-status { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px; border: 1px dashed var(--input-border); color: var(--muted); font-size: 14px; }
.sign-in-status .status-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--accent); }
.sign-in-status.is-connected { color: var(--text); border-style: solid; border-color: var(--accent-line); }
.sign-in-status.is-connected .status-dot { background: var(--accent); }
.agent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.agent-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.agent-card p { margin: 0; }
.agent-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
.agent-name { font: 500 15px var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.agent-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agent-stats dt { color: var(--muted); font-size: 12px; }
.agent-stats dd { margin: 0; font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.tool-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tool-tags li { font-size: 12px; background: var(--neutral-bg); color: var(--neutral-text); border-radius: 6px; padding: 3px 8px; }
.agent-card-link { font-weight: 500; font-size: 14px; margin-top: auto; }
@media (max-width: 720px) {
  .overview-balance { padding: 18px; }
  .agent-card { padding: 18px; }
}

/* Sub-views inside a tab, such as Observability's Calls and Health. */
.subnav { display: inline-flex; gap: 2px; padding: 3px; background: var(--neutral-bg); border-radius: 10px; width: fit-content; }
.subnav a { color: var(--muted); padding: 6px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px var(--shadow); }

/* Sign-in: one card, centred in the space under the top bar. */
.signin { min-height: calc(100vh - 73px); box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 48px 16px 96px; }
.signin-card { width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.signin-card p { margin: 0; }
.signin-title { font: 500 28px/1.15 var(--sans); letter-spacing: -0.03em; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border-radius: 10px; background: var(--text); color: var(--on-light); font-weight: 500; font-size: 15px; }
.btn-google:hover { background: var(--inverse-hover); color: var(--on-light); }
.btn-google:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.signin-note { font-size: 13px; color: var(--muted); padding-top: 20px; border-top: 1px solid var(--divider); }
@media (max-width: 720px) {
  .signin { align-items: flex-start; min-height: 0; padding-top: 40px; }
  .signin-card { padding: 24px; }
}

/* Early access: unlimited credits and free tools. */
.credits-line .tile-value { font-family: var(--sans); font-weight: 500; letter-spacing: -0.03em; }
.credits-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* Onboarding: the agent picker, copyable commands and example prompts. */
.step-body { flex: 1 1 auto; min-width: 0; }
.client-panel { display: none; }
:is(.get-started, .connect):has(input[value="claude-code"]:checked) .client-panel[data-client="claude-code"],
:is(.get-started, .connect):has(input[value="cursor"]:checked) .client-panel[data-client="cursor"],
:is(.get-started, .connect):has(input[value="claude-desktop"]:checked) .client-panel[data-client="claude-desktop"],
:is(.get-started, .connect):has(input[value="codex"]:checked) .client-panel[data-client="codex"],
:is(.get-started, .connect):has(input[value="antigravity"]:checked) .client-panel[data-client="antigravity"],
:is(.get-started, .connect):has(input[value="other"]:checked) .client-panel[data-client="other"] { display: block; }

.client-panel > p { margin: 0 0 8px; }
.copy-block { display: flex; align-items: center; gap: 12px; background: var(--code-bg); color: var(--code-text); border: 1px solid var(--border); border-radius: 10px; padding: 12px 12px 12px 16px; min-width: 0; }
.copy-block pre, .copy-block p { flex: 1 1 auto; min-width: 0; margin: 0; }
.copy-block pre { font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--code-text); }
.copy-btn { flex: none; min-height: 30px; padding: 0 12px; font-size: 13px; }
/* Code blocks stay dark in both themes, so their Copy button keeps light text. */
.copy-block:not(.prompt) .copy-btn { color: var(--code-text); border-color: rgba(255, 255, 255, 0.24); }
.copy-block:not(.prompt) .copy-btn:hover { color: var(--code-text); border-color: rgba(255, 255, 255, 0.45); }
.setup-prompt p { font-size: 14px; }
.prompts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.prompt { background: transparent; color: var(--text); align-items: center; }
.prompt p { font-size: 14px; }

/* Keys: the tool picker sits under Advanced on the create form. */
.advanced { border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.advanced > summary { cursor: pointer; padding: 12px 16px; font-size: 14px; font-weight: 500; color: var(--muted); }
.advanced > summary:hover, .advanced[open] > summary { color: var(--text); }
.advanced > .tool-picker { border: 0; border-top: 1px solid var(--divider); border-radius: 0; }

/* A group's status: running, ok and failed counts side by side. */
.chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* A new key: the Copy button with its note, then the note that replaces it. */
.copy-key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.copied-note { margin: 0; color: var(--ok-text); }
