:root {
  --ink: #161710;
  --muted: #66685d;
  --paper: #f1efe5;
  --panel: #faf9f3;
  --line: #d8d5c8;
  --acid: #d9ff58;
  --coral: #ff765f;
  --blue: #6ebcff;
  --violet: #a99bff;
  --shadow: 0 24px 70px rgba(34, 35, 26, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.is-hidden { display: none !important; }

.topbar {
  height: 82px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--acid); font-weight: 900; letter-spacing: -1px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -0.02em; }
.brand small { color: var(--muted); margin-top: 2px; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.safe-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.safe-dot { width: 9px; height: 9px; border-radius: 50%; background: #60b643; box-shadow: 0 0 0 4px #60b64322; }
.logout { color: var(--muted); font-size: 13px; }

main { width: min(1240px, 90vw); margin: 0 auto; }
.hero { padding: 90px 0 70px; position: relative; }
.hero::after { content: ""; position: absolute; width: 210px; height: 210px; right: 4vw; top: 70px; border: 1px solid #c6c2b5; border-radius: 50%; box-shadow: inset 0 0 0 38px var(--paper), inset 0 0 0 39px #c6c2b5; opacity: .65; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .16em; }
h1 { margin: 0; max-width: 800px; font-size: clamp(58px, 8vw, 112px); line-height: .86; letter-spacing: -.075em; font-weight: 850; }
h1 span { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.hero-copy { max-width: 560px; margin: 34px 0 0; font-size: 18px; line-height: 1.6; color: var(--muted); }
.environment-row { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.environment { display: inline-flex; background: var(--ink); color: white; padding: 10px 14px; border-radius: 99px; font-size: 12px; }
.publish-status { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); padding: 9px 13px; border-radius: 99px; font-size: 12px; font-weight: 750; }
.publish-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.publish-status.is-up-to-date::before { background: #60b643; }
.publish-status.is-publishing::before, .publish-status.is-preparing::before { background: var(--blue); animation: breathe 1.2s ease-in-out infinite alternate; }
.publish-status.is-needs-attention::before { background: var(--coral); }

.agent-section { padding: 38px 0 100px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 34px; }
h2 { margin: 0; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.055em; line-height: 1; }
.section-note { margin: 0; max-width: 390px; color: var(--muted); line-height: 1.55; }
.agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.agent-card {
  min-height: 330px; padding: 22px; border: 1px solid var(--line); background: var(--panel); border-radius: 2px;
  text-align: left; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; position: relative; overflow: hidden;
}
.agent-card::before { content: ""; position: absolute; inset: auto -55px -75px auto; width: 180px; height: 180px; border-radius: 50%; background: var(--accent); opacity: .25; }
.agent-card:hover { transform: translateY(-7px); box-shadow: var(--shadow); border-color: var(--ink); }
.accent-coral { --accent: var(--coral); }.accent-lime { --accent: var(--acid); }.accent-blue { --accent: var(--blue); }.accent-violet { --accent: var(--violet); }
.card-number { font: 700 12px ui-monospace, monospace; color: var(--muted); }
.card-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); font-size: 24px; font-weight: 900; }
.card-content { align-self: end; max-width: 85%; }
.card-content strong, .card-content small { display: block; }
.card-content strong { font-size: 27px; letter-spacing: -.045em; margin-bottom: 12px; }
.card-content small { color: var(--muted); line-height: 1.55; font-size: 14px; }
.card-arrow { justify-self: end; align-self: end; font-size: 28px; z-index: 1; }

.workbench { padding: 70px 0 100px; }
.workbench-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.workbench-head > div:first-child { max-width: 760px; }
.workbench-head h2 { font-size: clamp(46px, 6vw, 78px); }
.workbench-head p:not(.eyebrow) { color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 650px; }
.back-button { border: 0; background: transparent; padding: 0; margin-bottom: 34px; color: var(--muted); }
.status-chip { background: var(--acid); border: 1px solid var(--ink); padding: 10px 15px; border-radius: 99px; font-weight: 750; font-size: 12px; }
.workbench-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); min-height: 650px; border: 1px solid var(--line); border-top: 0; background: var(--panel); box-shadow: var(--shadow); }
.input-panel, .result-panel { padding: clamp(24px, 4vw, 48px); }
.input-panel { border-right: 1px solid var(--line); }
.input-panel > label, .burst-panel > label, .scenario-row label, .correction-box label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 12px; }
.test-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 26px; border: 1px solid var(--line); background: #e8e5d9; }
.test-mode button { border: 0; background: transparent; padding: 11px 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.test-mode button.is-active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 5px #16171018; }
.starter-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.starter-prompts button { border: 1px solid var(--line); border-radius: 99px; background: white; padding: 8px 11px; font-size: 12px; text-align: left; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); background: white; border-radius: 0; padding: 16px; line-height: 1.5; outline: none; }
textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px #d9ff5844; }
textarea.needs-input { border-color: var(--coral); animation: nudge .2s ease 2; }
.scenario-row { margin: 20px 0; }
select { width: 100%; border: 1px solid var(--line); background: white; padding: 13px; }
.burst-panel { margin-bottom: 20px; }
.buffer-summary { display: grid; gap: 12px; margin-bottom: 20px; padding: 15px; border: 1px solid var(--line); background: #f0eedf; }
.buffer-summary > div { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; }
.buffer-summary > div > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--acid); font-weight: 900; letter-spacing: 1px; }
.buffer-summary p, .buffer-summary strong, .buffer-summary small { display: block; margin: 0; }
.buffer-summary strong { font-size: 13px; }.buffer-summary small { color: var(--muted); margin-top: 3px; font-size: 11px; }
.buffer-summary button { justify-self: start; border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 0 0 2px; font-size: 11px; font-weight: 750; }
.burst-messages { display: grid; gap: 9px; margin: 18px 0 10px; }
.burst-message { display: grid; grid-template-columns: 30px 1fr 44px; gap: 8px; align-items: center; }
.burst-message > span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font: 750 10px ui-monospace, monospace; }
.burst-message label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.burst-message input { width: 100%; min-width: 0; border: 1px solid var(--line); background: white; padding: 12px 13px; }
.burst-message input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px #d9ff5844; }
.burst-message input[aria-invalid="true"] { border-color: var(--coral); box-shadow: 0 0 0 3px #ff786544; }
.burst-message .remove-message { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
.add-message-button { min-height: 44px; border: 0; background: transparent; padding: 10px 0; color: var(--muted); font-size: 12px; font-weight: 750; }
.field-error { margin: 0 0 4px; color: #8b2014; font-size: 12px; font-weight: 750; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.primary-button { width: 100%; border: 1px solid var(--ink); background: var(--ink); color: white; padding: 17px 20px; display: flex; justify-content: space-between; font-weight: 800; }
.primary-button:hover { background: #303126; }.primary-button:disabled { opacity: .55; cursor: wait; }
.input-footnote { color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-panel { display: grid; min-width: 0; align-items: center; background: #e8e5d9; }
.empty-result, .running-result, .error-result { text-align: center; max-width: 390px; margin: auto; }
.empty-symbol { width: 70px; height: 70px; display: grid; place-items: center; background: var(--blue); border-radius: 50%; margin: 0 auto 22px; font-size: 30px; }
.result-panel h3 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.035em; }
.result-panel p { color: var(--muted); line-height: 1.5; }
.pulse-ring { width: 58px; height: 58px; border: 7px solid #ffffff88; border-top-color: var(--ink); border-radius: 50%; margin: 0 auto 22px; animation: spin 1s linear infinite; }
.watch-steps { width: min(420px, 100%); margin: 28px auto 0; display: grid; gap: 8px; text-align: left; }
.watch-step { display: grid; grid-template-columns: 32px 1fr; gap: 11px; align-items: center; opacity: .45; }
.watch-step > span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); font: 750 11px ui-monospace, monospace; }
.watch-step p { margin: 0; line-height: 1.2; }.watch-step strong, .watch-step small { display: block; }.watch-step strong { font-size: 12px; }.watch-step small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.watch-step.done, .watch-step.active { opacity: 1; }.watch-step.done > span { background: var(--acid); border-color: var(--ink); }.watch-step.active > span { background: var(--blue); border-color: var(--ink); box-shadow: 0 0 0 5px #6ebcff33; }
.completed-steps { grid-template-columns: repeat(4, 1fr); width: 100%; margin: 18px 0 20px; gap: 12px; }
.completed-steps .watch-step { grid-template-columns: 28px 1fr; gap: 7px; }.completed-steps .watch-step > span { width: 27px; height: 27px; }.completed-steps .watch-step small { display: none; }
.completed-result { align-self: stretch; min-width: 0; }
.result-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.evaluation-pill { white-space: nowrap; border: 1px solid var(--line); padding: 7px 10px; border-radius: 99px; background: white; font-size: 11px; font-weight: 750; }
.evaluation-pill.pass { background: #d6f4ca; }.evaluation-pill.fail { background: #ffd2ca; }
.combined-preview { margin: 18px 0 0; padding: 12px 0; border-top: 1px solid var(--line); }
.combined-preview summary { font-size: 12px; font-weight: 800; }
.combined-preview pre { max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 12px 0 0; padding: 14px; border: 1px solid var(--line); background: white; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
#result-output { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 22px 0; padding: 20px; background: #171810; color: #f5f3e9; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; border-radius: 2px; }
.trace { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.trace summary { font-size: 13px; font-weight: 750; }
.trace dl { margin: 15px 0 0; }.trace dl div { display: flex; justify-content: space-between; padding: 6px 0; gap: 20px; font-size: 12px; }.trace dt { color: var(--muted); }.trace dd { margin: 0; text-align: right; }
.feedback-row { display: flex; gap: 10px; margin-top: 18px; }
.feedback-button, .correction-box button, .error-result button { flex: 1; border: 1px solid var(--ink); background: transparent; padding: 11px; font-weight: 750; }
.feedback-button:hover, .correction-box button:hover { background: white; }
.correction-box { margin-top: 18px; padding: 18px; border: 1px solid var(--line); background: white; }
.correction-box button { width: 100%; margin-top: 10px; background: var(--acid); }
.error-result button { margin-top: 10px; background: var(--coral); }
.load-error, .login-error { color: #9e2d1d; }

footer { width: min(1240px, 90vw); margin: 0 auto; padding: 28px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.login-body { display: grid; place-items: center; padding: 30px; background: var(--ink); }
.login-card { width: min(440px, 100%); background: var(--paper); padding: clamp(30px, 6vw, 58px); box-shadow: 18px 18px 0 var(--acid); }
.login-card h1 { font-size: 53px; line-height: .92; margin-bottom: 24px; }
.login-copy { color: var(--muted); line-height: 1.5; }.login-card label { display: block; font-size: 13px; font-weight: 800; margin: 25px 0 8px; }
.login-card input { width: 100%; padding: 14px; border: 1px solid var(--line); background: white; }
.login-card button { width: 100%; margin-top: 12px; padding: 14px; border: 1px solid var(--ink); background: var(--ink); color: white; font-weight: 800; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { to { opacity: .28; } }
@keyframes nudge { 50% { transform: translateX(5px); } }
@media (max-width: 900px) {
  .hero::after { display: none; }.agent-grid { grid-template-columns: 1fr; }.agent-card { min-height: 220px; }
  .workbench-grid { grid-template-columns: 1fr; }.input-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-panel { min-height: 520px; }.section-heading { align-items: start; flex-direction: column; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 20px; }.brand small { display: none; }.safe-badge { font-size: 10px; }.topbar-actions { gap: 12px; }
  main { width: min(100% - 32px, 1240px); }.hero { padding: 60px 0 50px; }h1 { font-size: 58px; }
  .workbench-head { align-items: start; flex-direction: column; }.status-chip { order: -1; }
  .feedback-row { flex-direction: column; }.completed-steps { grid-template-columns: 1fr 1fr; }.login-card { box-shadow: 10px 10px 0 var(--acid); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
