:root {
  --ink: #16191d;
  --muted: #5c6570;
  --line: #d9dee4;
  --accent: #1d4ed8;
  --surface: #f5f7fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  max-width: 44rem;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}

header {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* The sign-in affordance is deliberately not a button: it buys conversation
   persistence, which is worth offering and not worth interrupting for. */
button.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
}

a {
  color: var(--accent);
}

section {
  margin-top: 2rem;
}

/* Deliberately quiet: it is context, not a call to action. Someone who never
   looks at it should not notice it, and someone running low should find the
   number without hunting. */
#budget {
  margin-bottom: 1.25rem;
}

#budget-track {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

#budget-fill {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

#budget.low #budget-fill {
  background: #b45309;
}

#budget.spent #budget-fill {
  background: #b91c1c;
}

#budget-note {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 400;
}

#account {
  font-size: 0.875rem;
}

#chat-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

button {
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  background: var(--muted);
  cursor: default;
}

#progress:empty {
  display: none;
}

#progress {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

#transcript {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

#transcript li {
  margin-bottom: 1.25rem;
}

.who {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#transcript p {
  margin: 0;
  white-space: pre-wrap;
}

#transcript .user p {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--surface);
}

.tools {
  margin-top: 0.4rem !important;
  color: var(--muted);
  font-size: 0.8125rem;
}

#composer {
  display: flex;
  gap: 0.5rem;
}

#composer input {
  flex: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.pass {
  color: #15803d;
}

.fail {
  color: #b91c1c;
}

/* Content the model chose to show rather than say. Rendered as text in every
   case — display_output offers no html format, because tool results influence
   what the model writes and markup from that path would be an injection. */
.shown {
  margin-top: 0.4rem;
  padding: 0.6rem 0.8rem;
  border-left: 2px solid var(--line);
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-x: auto;
}

.shown.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface);
  border-left-color: var(--accent);
}
