/* structure shared by every brand. each brand sets the tokens in its own theme.css */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--mono); font-size: 13px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
canvas.art { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; z-index: 0; pointer-events: none; }

.sheet { position: relative; z-index: 1; max-width: 760px; margin: 48px auto 96px; padding: 28px 32px 40px; background: var(--sheet); border: 1px solid var(--rule); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--rule); }
.brand { font-family: var(--display); font-size: var(--brand-size, 18px); text-decoration: none; letter-spacing: var(--brand-track, 0); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { font-size: 11px; text-decoration: none; padding: 3px 9px; background: var(--chip); color: var(--chip-ink); border: 1px solid var(--chip-rule, transparent); }
.nav a[aria-current] { background: var(--chip-on); color: var(--chip-on-ink); }

h1 { font-family: var(--display); font-weight: var(--display-weight, 400); font-size: 22px; line-height: 1.3; margin-bottom: 14px; }
h2 { font-family: var(--display); font-weight: var(--display-weight, 400); font-size: 16px; margin: 34px 0 10px; }
p { margin: 0 0 12px; }
.small { font-size: 11px; color: var(--muted); }
.accent { color: var(--accent); }

table.kv { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 12px; }
table.kv th { text-align: left; font-weight: 400; color: var(--muted); padding: 5px 8px; border-bottom: 1px solid var(--rule); }
table.kv td { padding: 6px 8px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; word-break: break-all; }
table.kv tr:nth-child(even) td { background: var(--zebra); }
table.kv td:first-child { color: var(--muted); white-space: nowrap; word-break: normal; width: 36%; }
table.kv.rows td:first-child { width: auto; color: var(--ink); }
table.kv.rows td { word-break: normal; }
table.kv td.nw, table.kv th.nw { white-space: nowrap; }

.formula { font-family: var(--mono); background: var(--code-bg); border: 1px solid var(--rule); padding: 12px 14px; margin: 12px 0 16px; overflow-x: auto; white-space: pre; font-size: 12px; }
pre.code { font-family: var(--mono); background: var(--code-bg); border: 1px solid var(--rule); padding: 12px 14px; margin: 12px 0 16px; overflow-x: auto; font-size: 11.5px; line-height: 1.6; }

.bytes { display: grid; grid-template-columns: repeat(var(--per-row), 1fr); gap: 2px; margin: 14px 0 6px; }
.byte { aspect-ratio: 1; background: var(--byte-a); }
.byte.f1 { background: var(--byte-b); }
.byte.start { outline: 1px solid var(--accent); outline-offset: -1px; }
table.legend { margin-top: 10px; }
table.legend td:first-child { width: 12%; }

.gauge { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 16px 0; }
.gauge .col { text-align: center; font-size: 11px; color: var(--muted); }
.gauge .well { position: relative; height: 150px; border: 1px solid var(--ink); margin: 6px auto; width: 64px; }
.gauge .fill { position: absolute; left: 0; right: 0; bottom: 0; background: repeating-linear-gradient(0deg, var(--ink) 0 1px, transparent 1px 4px); }
.gauge .line { position: absolute; left: -10px; right: -10px; border-top: 1px dashed var(--accent); }

.foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.preview-tag { position: fixed; right: 10px; bottom: 8px; z-index: 5; font-size: 10px; color: var(--muted); font-family: var(--mono); }

/* docs page prose */
.doc h1 { font-size: 26px; margin-bottom: 6px; }
.doc .by { font-size: 11px; color: var(--muted); margin-bottom: 26px; }
.doc p { font-size: var(--prose-size, 13.5px); line-height: 1.75; font-family: var(--prose, var(--mono)); }
.doc blockquote { border-left: 2px solid var(--accent); padding: 2px 0 2px 14px; margin: 10px 0 16px; color: var(--muted); }

@media (max-width: 640px) {
  .sheet { margin: 16px; padding: 20px 16px 28px; }
  table.kv td:first-child { width: 44%; }
  .bytes { gap: 1px; }
}
