/* wildbore: plain, quiet, readable. One accent colour. */
:root {
  --bg: #f6f5f2; --panel: #fff; --ink: #1d1d1b; --muted: #6b6a66; --line: #e3e1dc;
  --accent: #b86b12; --ok: #1f7a4d; --ok-bg: #e5f3ec; --off-bg: #efeeea; --warn: #8a5a00; --warn-bg: #fdf1dc;
  --err: #a8321f; --err-bg: #fbe8e4; --demo-bg: #e9eefb; --demo: #2a4a9a;
  --radius: 10px; font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .2rem 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--muted); font-weight: 600; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; letter-spacing: .02em; }
nav { display: flex; gap: .2rem; flex-wrap: wrap; align-items: center; }
nav a, nav .link { padding: .35rem .7rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .95rem; }
nav a.active { background: var(--ink); color: #fff; }
nav .link { color: var(--muted); }
main { max-width: 1040px; margin: 0 auto; padding: 1.2rem; outline: none; }
.page > * + * { margin-top: 1rem; }
.lede { color: var(--muted); margin-top: 0; }
.big { font-size: 2rem; font-weight: 700; margin: .2rem 0; }
.big .hint { font-size: 1rem; font-weight: 400; }
.hint { color: var(--muted); font-size: .88rem; margin: .15rem 0 0; }
.empty { color: var(--muted); }
.crumb { color: var(--muted); font-size: .9rem; margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card.narrow { max-width: 380px; margin: 3rem auto; }
details.card > summary, details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: .8rem; }
.list > * + * { margin-top: .75rem; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.title-row h1, .title-row h2 { margin: 0; }

/* badges */
.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--off-bg); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-off { background: var(--off-bg); color: var(--muted); }
.b-sample, .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-demo { background: var(--demo-bg); color: var(--demo); }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 0; }

/* buttons + inputs */
button, .button { font: inherit; font-size: .92rem; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: #c9c6bf; }
button.primary, .button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.link { border: 0; background: none; padding: .2rem .3rem; color: var(--muted); text-decoration: underline; }
input, select, textarea { font: inherit; width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
select { width: auto; max-width: 100%; }
textarea { resize: vertical; }
textarea.mono { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: block; }
.field .hint { display: block; }
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.stack > * + * { margin-top: .9rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
form.inline { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-top: .6rem; }
form.inline .field { flex: 1 1 140px; }

/* switch */
.switch { position: relative; width: 44px; height: 26px; padding: 0; border-radius: 999px; background: #cfccc5; border: 0; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .92rem; }

/* shops */
.shop-row { display: flex; justify-content: space-between; gap: 1rem; }
.shop-row h2 a { color: var(--ink); text-decoration: none; }
.shop-side { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; text-align: right; }
.feature { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.feature-controls { display: flex; align-items: center; gap: .7rem; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: .3rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.log li:first-child { border-top: 0; }
.when { color: var(--muted); font-size: .85rem; }

/* agent */
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.side > * + * { margin-top: 1rem; }
.preview { background: var(--panel); border: 2px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.1rem; }
.diff-field { margin-bottom: .9rem; }
.diff-field h4 { margin: 0 0 .3rem; font-size: .9rem; }
.diff-lines { margin: 0; padding: .5rem; background: #faf9f7; border: 1px solid var(--line); border-radius: 6px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.dl-add { background: #dff3e6; color: #135c36; display: block; }
.dl-del { background: #fbe3de; color: #8a2615; display: block; text-decoration: line-through; text-decoration-color: rgba(138,38,21,.35); }
p .dl-add, p .dl-del { display: inline; padding: 0 .3rem; border-radius: 4px; }
.dl-ctx { color: var(--muted); display: block; }
.dl-skip { color: #a09e98; display: block; font-style: italic; }
.errors, .warnings { margin: 0 0 .8rem; padding: .6rem .6rem .6rem 1.6rem; border-radius: 8px; }
.errors { background: var(--err-bg); color: var(--err); }
.warnings { background: var(--warn-bg); color: var(--warn); }
.versions { list-style: none; padding: 0; margin: 0; }
.version { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.version:first-child { border-top: 0; }

/* spending + billing */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: .82rem; }
tfoot th { color: var(--ink); border-bottom: 0; }
.num { text-align: right; }
.entries { list-style: none; padding: 0; margin: 0; }
.entry { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.entry-side { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.note { background: var(--warn-bg); color: var(--warn); padding: .6rem .8rem; border-radius: 8px; font-size: .92rem; }
.note.demo { background: var(--demo-bg); color: var(--demo); }
.error { background: var(--err-bg); color: var(--err); padding: .6rem .8rem; border-radius: 8px; }

/* leads (same fields as the shop's own leads page) */
.lead { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.lead-meta { display: block; color: var(--muted); font-size: .85rem; }
.lead dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: .6rem 0 0; }
.lead dt { color: var(--muted); }
.lead dd { margin: 0; white-space: pre-wrap; }
.rec audio { max-width: 100%; vertical-align: middle; }

.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%); background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; transition: transform .2s; z-index: 10; max-width: 90vw; }
.toast.show { transform: translate(-50%, 0); }
.toast.t-error { background: var(--err); }

@media (max-width: 760px) {
  main { padding: .9rem; }
  .two-col { grid-template-columns: 1fr; }
  .shop-row { flex-direction: column; }
  .shop-side { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
  .feature { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .feature-controls { width: 100%; justify-content: space-between; }
  .big { font-size: 1.6rem; }
}
.card > h2 + .hint { margin-bottom: .6rem; }
