:root {
  --bg: #eef0ea;
  --surface: #fbfcf8;
  --ink: #22201c;
  --muted: #5f625a;
  --line: #d5d8cd;
  --green: #1e4d3a;
  --green-ink: #f4f7f2;
  --green-soft: #dde8df;
  --kraft: #b8915a;
  --kraft-soft: #efe4d0;
  --cherry: #a8322d;
  --cherry-soft: #f5dedb;
  --ok: #2e6b3f;
  --code-bg: #1b1f1c;
  --code-ink: #dfe6de;
  --code-muted: #8e9a90;
  --code-key: #9fcfae;
  --code-str: #e2c38f;
  --radius: 14px;
  --font: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131614;
    --surface: #1b1f1c;
    --ink: #ebeae3;
    --muted: #a3a89e;
    --line: #2f3530;
    --green: #86c09f;
    --green-ink: #0f1a14;
    --green-soft: #22352a;
    --kraft: #d6b98a;
    --kraft-soft: #3a3124;
    --cherry: #ec8a82;
    --cherry-soft: #3d2220;
    --ok: #8fd0a2;
    --code-bg: #0e110f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font);
  padding-inline: clamp(16px, 4vw, 48px);
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--kraft); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .86em; background: var(--green-soft); padding: .05em .35em; border-radius: 5px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; line-height: 1.1; margin: 0; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* header */
.top {
  max-width: 1320px; margin: 0 auto; padding-top: 22px;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px 24px;
}
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.wordmark {
  font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; color: var(--green);
  text-decoration: none; letter-spacing: -.045em; line-height: .9;
  font-variation-settings: "opsz" 96;
}
.brand-sub { color: var(--muted); }
.wallet {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px;
}
.wallet-label { font-size: .75rem; color: var(--muted); }
.wallet-amount { font-family: var(--mono); font-weight: 500; font-size: 1rem; transition: color .6s; }
.wallet-amount.dropped { color: var(--cherry); }
.tabs {
  grid-column: 1 / -1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line); margin-top: 6px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto; text-decoration: none; color: var(--muted); padding: 10px 12px 11px;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.tabs a.learn-link { margin-left: auto; color: var(--green); font-weight: 600; }

.intro { max-width: 1320px; margin: 18px auto 0; }
.intro-line { max-width: 72ch; margin: 0; color: var(--muted); }
.setup { margin: .5rem 0 0; font-size: .9rem; color: var(--kraft); }
.setup.bad { color: var(--cherry); }

main { max-width: 1320px; margin: 0 auto; padding-block: 26px 40px; }
.demo-head { margin-bottom: 20px; }
.demo-head h1 { font-size: clamp(2rem, 4.2vw, 3rem); color: var(--ink); letter-spacing: -.03em; }
.explain { max-width: 66ch; margin: .5rem 0 0; font-size: 1.05rem; }

.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 980px) { .split { grid-template-columns: minmax(0, 1fr); } }

.product {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(14px, 2.4vw, 24px); min-width: 0;
}
.product.wide { margin-bottom: 24px; }
.product > h2:first-child { margin-top: 0; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 260px; max-height: 58vh; overflow-y: auto; padding: 4px 2px 12px; }
.msg { max-width: 88%; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--green); color: var(--green-ink); padding: 9px 14px; border-radius: 16px 16px 4px 16px; }
.msg.bot { align-self: flex-start; background: var(--kraft-soft); padding: 10px 14px; border-radius: 16px 16px 16px 4px; }
.msg.bot.err { background: var(--cherry-soft); color: var(--cherry); }
.receipt { font-family: var(--mono); font-size: .74rem; color: var(--muted); margin-top: 6px; }
.timeline { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.timeline li { font-family: var(--mono); font-size: .76rem; color: var(--muted); display: flex; gap: 8px; }
.timeline li b { color: var(--green); font-weight: 500; }
.timeline li.failed b, .timeline li.cost_limit b, .timeline li.tool_limit b { color: var(--cherry); }
.cursor::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--kraft); }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor::after { animation: none; } .wallet-amount { transition: none; } }

.composer { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.composer.inline { flex-direction: row; border-top: 0; padding-top: 0; flex-wrap: wrap; }
.composer.inline input { flex: 1 1 220px; }
input, select, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
select { width: auto; padding: 6px 8px; }
.composer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.composer-row > :first-child { margin-right: auto; }
.select-label { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.model-price { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.conv-id { font-family: var(--mono); font-size: .74rem; color: var(--muted); overflow-wrap: anywhere; }

.btn {
  background: var(--green); color: var(--green-ink); border: 1px solid var(--green); border-radius: 999px;
  padding: 9px 18px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.ghost { background: transparent; color: var(--green); }
.btn.small { padding: 5px 12px; font-size: .88rem; }
.btn.danger { background: var(--cherry); border-color: var(--cherry); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--cherry); }

.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.suggest button {
  background: transparent; border: 1px dashed var(--line); color: var(--muted); border-radius: 8px;
  padding: 5px 10px; font-size: .86rem; cursor: pointer; text-align: left;
}
.suggest button:hover { border-color: var(--green); color: var(--green); }

.customer-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; color: var(--muted); }
.customer-bar .btn { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--bg); }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--green); color: var(--green-ink); font-weight: 600; }

/* help center */
.docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.docs li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.docs .meta { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.status { font-family: var(--mono); font-size: .74rem; padding: 1px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.status.processing { background: var(--kraft-soft); color: var(--kraft); }
.status.failed { background: var(--cherry-soft); color: var(--cherry); }
.upload { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.file { flex: 1 1 220px; border: 1px dashed var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; color: var(--muted); font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hits { padding-left: 1.2rem; margin: 12px 0 0; display: grid; gap: 10px; }
.hits li { padding-left: 4px; }
.hit-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: .9rem; }
.score { font-family: var(--mono); font-size: .76rem; color: var(--green); }
.score-bar { height: 4px; background: var(--line); border-radius: 3px; margin: 4px 0; overflow: hidden; max-width: 240px; }
.score-bar i { display: block; height: 100%; background: var(--green); }
.hit-text { font-size: .9rem; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.privacy-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 560px) { .versus { grid-template-columns: 1fr; } }
.side { border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; }
.side h3 { margin-bottom: 6px; }
.verdict { font-weight: 600; margin: 0 0 6px; }
.verdict.found { color: var(--kraft); }
.verdict.none { color: var(--ok); }

/* orders */
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.steps li::before {
  content: counter(step); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green-soft); color: var(--green); font-weight: 600; font-size: .85rem;
}
.steps .who { font-size: .82rem; color: var(--muted); }
.steps pre, .json {
  margin: 4px 0 0; font-family: var(--mono); font-size: .76rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.steps .answer { background: var(--kraft-soft); border-radius: 10px; padding: 10px 12px; margin: 4px 0 0; }
.orders-db { margin-top: 14px; }
.orders-db pre { white-space: pre-wrap; font-family: var(--mono); font-size: .76rem; }

/* triage */
.ticket { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ticket-top { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--green-soft); flex-wrap: wrap; }
.ticket-top b { font-size: 1.05rem; }
.pill { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pill.high { background: var(--cherry-soft); color: var(--cherry); border-color: transparent; }
.ticket dl { margin: 0; padding: 12px 14px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.ticket dt { color: var(--muted); font-size: .88rem; }
.ticket dd { margin: 0; overflow-wrap: anywhere; }
.valid { font-size: .85rem; padding: 0 14px 12px; color: var(--ok); }
.valid.bad { color: var(--cherry); }

/* product search */
.products { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.products li { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.products .name { font-weight: 600; }
.products .price { font-family: var(--mono); }
.products .desc { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }
.products .sim { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.products .sim .score-bar { flex: 1; max-width: 260px; margin: 0; }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .8rem; }
td.num, th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
table.health { min-width: 820px; }
table.health td:nth-child(3) { max-width: 420px; overflow-wrap: anywhere; }
table.health .rid { font-family: var(--mono); font-size: .74rem; color: var(--muted); white-space: nowrap; }
.pass { color: var(--ok); font-weight: 600; }
.fail { color: var(--cherry); font-weight: 600; }
tr.empty td { color: var(--muted); }
tr.fresh { animation: fresh 1.2s ease-out; }
@keyframes fresh { from { background: var(--green-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { tr.fresh { animation: none; } }

/* billing */
.figures { display: flex; gap: 28px; flex-wrap: wrap; }
.figure b { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; font-family: var(--font); }
.figure span { color: var(--muted); font-size: .88rem; }
.eus { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.eus li { font-family: var(--mono); font-size: .8rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.erase { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 4px; }
.confirm { background: var(--cherry-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.confirm p { margin: 0 0 4px; width: 100%; }
#erase-result .json { margin-top: 10px; }

/* under the hood */
.hood { min-width: 0; }
.hood details {
  background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); overflow: hidden; border: 1px solid #2b322d;
  font-family: var(--mono); font-size: .8rem;
}
.hood summary {
  cursor: pointer; padding: 12px 16px; font-family: var(--font); font-size: .95rem; font-weight: 600;
  display: flex; justify-content: space-between; gap: 10px; list-style: none; color: #f2f1ea;
}
.hood summary::-webkit-details-marker { display: none; }
.hood summary .sum-meta { font-family: var(--mono); font-weight: 400; font-size: .74rem; color: var(--code-muted); align-self: center; text-align: right; }
.hood summary::after { content: "+"; font-family: var(--mono); color: var(--code-muted); }
.hood details[open] summary::after { content: "−"; }
.hood .empty-hood { padding: 0 16px 16px; color: var(--code-muted); font-family: var(--font); font-size: .9rem; }
.hood .calls { display: flex; gap: 4px; padding: 0 12px; flex-wrap: wrap; }
.hood .calls button {
  background: transparent; border: 1px solid #333b35; color: var(--code-muted); border-radius: 6px;
  font-family: var(--mono); font-size: .72rem; padding: 3px 8px; cursor: pointer;
}
.hood .calls button[aria-pressed="true"] { border-color: var(--code-key); color: var(--code-key); }
.hood .facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; padding: 12px 16px; margin: 0; }
.hood .facts dt { color: var(--code-muted); }
.hood .facts dd { margin: 0; overflow-wrap: anywhere; }
.hood .facts .ok { color: var(--code-key); }
.hood .facts .bad { color: #f09a92; }
.hood .panes { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid #2b322d; }
.hood .panes button {
  background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--code-muted);
  padding: 8px 10px; cursor: pointer; font-family: var(--mono); font-size: .76rem;
}
.hood .panes button[aria-selected="true"] { color: #f2f1ea; border-bottom-color: var(--code-key); }
.hood pre { margin: 0; padding: 14px 16px; overflow: auto; max-height: 460px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.hood .k { color: var(--code-key); }
.hood .s { color: var(--code-str); }
.hood .n { color: #b5c7f0; }

.foot { max-width: 1320px; margin: 0 auto; padding-block: 18px 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
