:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #14181f;
  --muted: #5c6673;
  --line: #e3e7ec;
  --brand: #2f6d4f;
  --brand-ink: #ffffff;
  --accent: #b8460f;
  --warn-bg: #fff7ed;
  --warn-line: #f0b46a;
  --shadow: 0 1px 2px rgba(20,24,31,.06), 0 6px 20px rgba(20,24,31,.06);
  --r: 12px;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #161b22; --ink: #e8ecf1; --muted: #9aa4b2;
    --line: #262d38; --brand: #4f9e75; --accent: #e0752f;
    --warn-bg: #2a1f12; --warn-line: #7a541f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* beats .proposal{display:flex} / .ordered{display:grid} */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 0 clamp(12px, 4vw, 40px) 64px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
h2 { font-size: 15px; letter-spacing: .01em; margin: 0 0 12px; }
.muted { color: var(--muted); font-weight: 400; }

.top { max-width: 1080px; margin: 0 auto; padding: 28px 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 700; }
.brand .logo { font-size: 30px; }
.top .tag { color: var(--muted); max-width: 60ch; margin: 8px 0 0; }
.top .tag strong { color: var(--accent); }
.top .trust { display: inline-flex; gap: 8px; align-items: baseline; margin: 12px 0 0;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 13px; max-width: 62ch; }

/* baton proposal */
.proposal {
  max-width: 1080px; margin: 0 auto 18px; display: flex; align-items: center; gap: 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.proposal.hard { border-width: 2px; }
.proposal .baton-ic { font-size: 26px; }
.proposal-text { margin: 0; flex: 1; font-weight: 600; }
.proposal-actions { display: flex; gap: 8px; }

.layout {
  max-width: 1080px; margin: 0 auto; display: grid; gap: 20px;
  grid-template-columns: 1fr 320px; align-items: start;
}
/* shared card shell */
.surface { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.card .ic { font-size: 30px; }
.card .nm { font-weight: 600; }
.card .ds { color: var(--muted); font-size: 13px; flex: 1; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.pr { font-weight: 600; }

.side { display: flex; flex-direction: column; gap: 20px; }
.panel { padding: 16px; }
.cart { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cart li { display: flex; align-items: center; gap: 8px; }
.cart li span:first-child { flex: 1; }
.cart .empty { color: var(--muted); }
.total-row { display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 12px; font-size: 16px; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.tl { display: flex; gap: 8px; align-items: baseline; }
.tl .tag { font-weight: 600; white-space: nowrap; }
.tl.done .tag { color: var(--brand); }
.tl.rejected .tag { color: var(--accent); }
.tl .at { margin-left: auto; color: var(--muted); }
.timeline .empty { color: var(--muted); }

/* agent console */
.agent { max-width: 1080px; margin: 24px auto 0; padding: 16px; }
.tools { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tools li { display: flex; gap: 8px; font-size: 13px; align-items: baseline; }
.tools code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-weight: 600; white-space: nowrap; }
.tools span { color: var(--muted); }
.console { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.console label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.console .grow { flex: 1; min-width: 200px; }
.console select, .console input {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); min-height: 40px;
}
.console-out { background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin: 12px 0 0; white-space: pre-wrap; font-size: 13px; min-height: 20px; }
.agent details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 12px; }
.agent summary { cursor: pointer; font-weight: 600; }
.agent .small { font-size: 12px; margin: 8px 0; }
.byoa-cfg { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.byoa-cfg label, .console label { display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--muted); }
.byoa-cfg input { font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); min-height: 40px; }

/* buttons */
.btn { font: inherit; font-weight: 600; cursor: pointer; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 14px; min-height: 40px; transition: transform .06s ease, background .15s ease; }
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.06); background: var(--brand); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button.add, button.rm { min-height: 36px; padding: 6px 12px; }
button.rm { min-width: 40px; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }

/* mock order overlay */
.ordered { position: fixed; inset: 0; background: rgba(10,14,20,.5);
  display: grid; place-items: center; padding: 20px; z-index: 10; }
.ordered-card { border-radius: 16px; padding: 28px; text-align: center; max-width: 380px; }
.ordered-card .check { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 30px; display: grid; place-items: center; }
.ordered-card p { color: var(--muted); }

/* responsive */
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .side { flex-direction: column; }
}
