:root {
  --bg: #F2EBDD; --card: #FBF8F1; --ink: #2A2621; --line: #DAD0BC;
  --terracotta: #C1613D; --ochre: #C99A3E; --sage: #4B7A5E;
  --terracotta-text: #8A3F26; --sage-text: #2F5943; --ochre-tint: #EFE2C8;
  --display: Outfit, "Segoe UI", system-ui, sans-serif;
  --body: Manrope, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.6 var(--body); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
h1, h2, h3, strong.brand { font-family: var(--display); line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 6vw, 48px); margin: .2em 0 .6em; }
h3 { font-size: clamp(19px, 3vw, 22px); font-weight: 600; margin: 0 0 .3em; }
.eyebrow { font: 600 13px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--terracotta-text); margin: 0; }
.screen { max-width: 440px; padding: 64px 16px; margin: 0 auto; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: .6em .75em; width: 100%; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.btn { font: 700 16px var(--body); background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink); border-radius: 9px; padding: .7em 1.3em; cursor: pointer; }
.btn:hover { transform: translateY(-1px); opacity: .9; }
.btn.outline { background: transparent; color: var(--ink); }
.btn.outline:hover { background: var(--ink); color: var(--bg); }
.btn.small { font-size: 14px; padding: .4em .9em; }
.btn.sage { background: var(--sage-text); border-color: var(--sage-text); }
.error { color: var(--terracotta-text); min-height: 1.4em; margin: 0; }
.muted { color: #5c554b; font-size: 15px; }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tabs button { font: 600 15px var(--body); background: none; border: 0; border-radius: 999px; padding: .45em .9em; color: var(--ink); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.panel { max-width: 1000px; margin: 0 auto; padding: 16px; }
.row { display: flex; gap: 8px; align-items: center; }
.messages { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.messages li { max-width: 85%; padding: .6em .9em; border-radius: 14px; background: var(--card); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.messages li.user { justify-self: end; background: var(--ochre-tint); }
.messages li .meta { display: block; font-size: 12.5px; color: #5c554b; margin-top: 4px; }
.composer { display: grid; grid-template-columns: 1fr; gap: 8px; position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
@media (min-width: 640px) { .composer { grid-template-columns: 160px 1fr auto; align-items: end; } }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card, .cards li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-wrap: anywhere; }
.cards li { cursor: pointer; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .1em .65em; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.state.completed::before { background: var(--sage); }
.state.running::before, .state.queued::before { background: var(--ochre); }
.state.failed::before, .state.blocked::before, .state.waiting_for_approval::before { background: var(--terracotta); }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px; overflow-x: auto; font-size: 13px; white-space: pre-wrap; }
.glow { width: 52px; height: 52px; border-radius: 48% 52% 55% 45% / 50% 45% 55% 50%; background: radial-gradient(circle at 35% 35%, #E7C57C, var(--terracotta) 72%); box-shadow: 0 0 24px rgba(193,97,61,.28), 0 0 48px rgba(193,97,61,.14); opacity: .85; }
.glow.small { width: 22px; height: 22px; }
@media (prefers-reduced-motion: no-preference) {
  .glow { animation: wobble 5.5s ease-in-out infinite; }
  @keyframes wobble { 50% { border-radius: 52% 48% 45% 55% / 45% 55% 50% 50%; transform: scale(1.03); } }
}
[hidden] { display: none !important; }

.codes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; display: grid; grid-template-columns: repeat(2, 1fr); gap: .25rem 1.5rem; padding-left: 1.5rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
