:root {
  --brand: #c2410c;
  --brand-dark: #7c2d12;
  --brand-tint: #fdeee3;
  --ink: #1c1917;
  --muted: #6b625c;
  --line: #e7e0da;
  --bg: #faf7f4;
  --card: #ffffff;
  --warn-tint: #fff6e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 33, 31, .06), 0 4px 16px rgba(20, 33, 31, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.big { font-size: 1.25rem; font-weight: 600; word-break: break-all; }

/* header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; gap: 1.25rem; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand img { width: 44px; height: 44px; }
.nav-links { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; padding: .25rem 0; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--brand-dark); }
main.wrap { padding: 2rem 0 3rem; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }

/* cards, grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card.section { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.auth-card { max-width: 440px; margin: 2rem auto; }
.notice { background: var(--warn-tint); border: 1px solid #f2dc9b; border-radius: 10px; padding: .75rem 1rem; }

/* lists */
.links { list-style: none; margin: 0; padding: 0; }
.links li { padding: .3rem 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* traces */
.trace { background: #1c1917; color: #f5f0eb; border-radius: 8px; padding: .75rem 1rem; margin: 0; min-height: 5rem; max-height: 22rem; overflow: auto; font-size: .8rem; line-height: 1.4; white-space: pre-wrap; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #171412; --card: #221e1b; --ink: #f1ebe6; --muted: #a79d95; --line: #3a3430; --brand-dark: #f0a77d; --warn-tint: #3a3017; }
  .site-header, .site-footer { border-color: var(--line); }
  a { color: #f0a77d; }
  .trace { background: #0e0c0b; }
}
