/* BearTender design system — warm ops-console. No build step, no CDN. */
:root {
  --bg: #f4f1ea; --panel: #ffffff; --panel-2: #fbf9f4;
  --ink: #2b2620; --muted: #8a8172; --faint: #b8b0a0;
  --accent: #a05e2c; --accent-2: #c98a4b; --accent-soft: #f4e5d4;
  --line: #e6e0d3; --ok: #2e7d32; --ok-soft: #e5f1e5;
  --bad: #b3261e; --bad-soft: #fbebea; --warn: #9a6b00; --warn-soft: #f8efd8;
  --info: #2d5f8a; --info-soft: #e7eff6;
  --radius: 12px; --shadow: 0 1px 2px rgba(43,38,32,.06), 0 4px 16px rgba(43,38,32,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.55 -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--ink); }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }

/* ---- shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 218px; flex-shrink: 0; background: #241f19; color: #e9e2d4;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .55rem; padding: 1.1rem 1rem .9rem;
  text-decoration: none; color: #fff; font-weight: 700; font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { font-size: 1.5rem; }
.sidebar nav { display: flex; flex-direction: column; padding: .8rem .6rem; gap: 2px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem;
  color: #cfc6b4; text-decoration: none; border-radius: 8px; font-size: .95rem; }
.sidebar nav a span { width: 1.3rem; text-align: center; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.nav-sep { margin: .8rem .7rem .2rem; font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(233,226,212,.4); }
.sidebar-foot { padding: .9rem 1rem; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: #cfc6b4; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; max-width: 1240px; width: 100%; margin: 0 auto; padding: 1.6rem 1.8rem; }
footer { max-width: 1240px; width: 100%; margin: 0 auto; padding: 0 1.8rem 1.4rem;
  color: var(--faint); font-size: .78rem; }

/* ---- typography ---- */
h1 { font-size: 1.45rem; margin: 0 0 1rem; display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
h1 small { color: var(--muted); font-size: .95rem; font-weight: 400; }
h2 { font-size: 1.02rem; margin: 0 0 .7rem; }
h3 { font-size: .9rem; margin: 1rem 0 .4rem; color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; }

/* ---- cards & grids ---- */
.cards { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.2rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card.grow { flex: 1; min-width: 320px; }
.card.narrow { max-width: 400px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.3rem; }
.card.stat { display: flex; flex-direction: column; gap: .1rem; text-decoration: none; color: var(--ink); }
.card.stat b { font-size: 1.7rem; font-weight: 650; }
.card.stat span { color: var(--muted); font-size: .85rem; }
.bear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem; margin-bottom: 1.3rem; }
.bear-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: .45rem; transition: transform .08s ease; }
.bear-card:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.bear-head { display: flex; align-items: center; gap: .6rem; }
.bear-avatar { font-size: 1.6rem; background: var(--accent-soft); border-radius: 10px;
  width: 2.4rem; height: 2.4rem; display: flex; align-items: center; justify-content: center; }
.bear-name { font-weight: 650; }
.bear-meta { display: flex; flex-wrap: wrap; gap: .35rem; }
.bear-stats { display: flex; gap: 1.1rem; margin-top: .2rem; font-size: .82rem; color: var(--muted); }
.bear-stats b { display: block; color: var(--ink); font-size: .95rem; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); font-size: .9rem; }
.card table, .card .table-wrap table { box-shadow: none; border: none; }
th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; letter-spacing: .05em;
  text-transform: uppercase; background: var(--panel-2); }
tbody tr:hover { background: var(--panel-2); }
tr.hl { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---- pills & badges ---- */
.pill, .badge, .tier { display: inline-block; border-radius: 999px; padding: .08rem .6rem;
  font-size: .76rem; font-weight: 550; }
.badge { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.pill-model { background: var(--info-soft); color: var(--info); }
.pill-channel { background: var(--ok-soft); color: var(--ok); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.tier { color: #fff; background: var(--muted); }
.tier-read { background: #7d8a6a; } .tier-write { background: var(--info); }
.tier-publish { background: var(--warn); } .tier-spend { background: var(--bad); }

/* ---- buttons & forms ---- */
.btn, button { background: var(--accent); border: none; color: #fff; padding: .45rem .95rem;
  border-radius: 8px; cursor: pointer; text-decoration: none; font-size: .88rem;
  font-weight: 550; display: inline-block; }
.btn:hover, button:hover { background: #8d4f22; }
.btn.secondary, button.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
button.linklike { background: none; color: inherit; padding: 0; text-decoration: underline; font-weight: 400; }
form.inline { display: inline; }
textarea, input, select { width: 100%; max-width: 760px; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent-2); border-color: transparent; }
form p { margin: .6rem 0; }
form label { font-weight: 600; font-size: .86rem; display: block; margin-bottom: .15rem; }
.helptext { color: var(--muted); font-size: .78rem; display: block; margin-top: .15rem; }
form .row { display: flex; gap: .6rem; align-items: center; margin-top: .8rem; }
.errorlist { color: var(--bad); margin: .2rem 0; padding-left: 1.1rem; font-size: .85rem; }

/* ---- messages ---- */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .55rem .9rem; border-radius: 8px; margin-bottom: .5rem;
  background: var(--ok-soft); border: 1px solid #cfe3cf; font-size: .9rem; }
.messages li.error { background: var(--bad-soft); border-color: #efc7c4; }
.messages li.info { background: var(--info-soft); border-color: #c8d9e8; }

/* ---- misc ---- */
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
pre.doctrine, pre.code { background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: .9rem; white-space: pre-wrap; max-height: 480px;
  overflow: auto; font-size: .84rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
dt { color: var(--muted); font-size: .86rem; }
dd { margin: 0; font-size: .92rem; }
.copybox { display: flex; gap: .5rem; align-items: stretch; margin: .5rem 0; }
.copybox code { flex: 1; background: #241f19; color: #e9e2d4; padding: .7rem .9rem;
  border-radius: 8px; overflow-x: auto; white-space: nowrap; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; margin: .4rem 0; }
.bars .bar { flex: 1; background: var(--accent-2); border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .bar:hover { background: var(--accent); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.6rem; display: block; margin-bottom: .5rem; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; margin: .9rem 0; padding-left: 2.4rem; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0;
  width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: .85rem; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  main { padding: 1rem; }
}
