:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --ink: #191816;
  --muted: #69645d;
  --line: #ddd7ce;
  --accent: #b52a2a;
  --accent-2: #245c73;
  --soft: #f0ece4;
  --code: #27231f;
  --code-bg: #f5f1ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

.agent-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(12px);
}

.agent-brand {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.agent-bar nav {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.9rem;
  white-space: nowrap;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

section {
  border-top: 1px solid var(--line);
  padding: 34px 0;
}

.intro {
  border-top: 0;
  min-height: 48vh;
  display: grid;
  align-content: center;
}

.mark {
  width: 54px;
  height: 54px;
  object-fit: contain;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 500;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
}

h3 {
  font-size: 1rem;
}

.lede {
  max-width: 760px;
  margin: 22px 0 0;
  font-size: 1.12rem;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 34px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.facts div {
  background: var(--paper);
  padding: 18px;
  min-width: 0;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
}

code {
  color: var(--code);
  background: var(--code-bg);
  border: 1px solid var(--line);
  padding: 0.12rem 0.28rem;
  border-radius: 4px;
  font-size: 0.9em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.agent-shell {
  width: min(900px, calc(100% - 32px));
  padding: 48px 0 72px;
}

.agent-shell h1 {
  max-width: none;
  font-size: clamp(2.35rem, 6vw, 4.2rem);
}

.agent-kicker {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.agent-note {
  max-width: 780px;
  margin: 18px 0 34px;
  color: var(--muted);
  font-size: 1.05rem;
}

.agent-prompt {
  max-height: none;
  overflow: visible;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 28px 0 0;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.94rem;
  line-height: 1.65;
}

.agent-prompt code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 30px;
  align-items: start;
}

form label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.search-row {
  display: flex;
  gap: 10px;
}

input {
  flex: 1;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 12px 14px;
  font: inherit;
}

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

button:hover {
  background: #932020;
}

.hint,
.status {
  color: var(--muted);
  margin: 12px 0 0;
}

.error {
  color: var(--accent);
}

.results {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
}

.result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.result-heading {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
}

.result-heading > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-2);
  font-weight: 700;
}

.result p {
  margin: 6px 0 0;
  color: var(--muted);
}

.result dl {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 700;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 12px 0 0;
}

.prompt-section {
  padding-bottom: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.prompt {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.agent-footer {
  width: min(900px, calc(100% - 32px));
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 780px) {
  .agent-bar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .agent-bar nav {
    width: 100%;
    justify-content: space-between;
  }

  main {
    padding-top: 28px;
  }

  .facts,
  .search-panel,
  .result dl {
    grid-template-columns: 1fr;
  }

  .search-row,
  .section-heading,
  footer {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    min-height: 46px;
  }
}
