:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #66645e;
  --line: #dedbd2;
  --accent: #1f5f4a;
  --accent-text: #ffffff;
  --danger: #a3302a;
  --warn-bg: #fff4d6;
  --error-bg: #fbe4e2;
  --code-bg: #efede6;
  --on: #1f6f3a;
  --off: #8a8780;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --surface: #201f1c;
    --text: #ecebe6;
    --muted: #a3a097;
    --line: #36342f;
    --accent: #5fb492;
    --accent-text: #0f1a15;
    --danger: #e3776f;
    --warn-bg: #3a3218;
    --error-bg: #3d1f1c;
    --code-bg: #2a2925;
    --on: #6cc58b;
    --off: #8a8780;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: var(--accent); }
code, .mono, pre { font-family: var(--mono); }
code { background: var(--code-bg); padding: 0 .3em; border-radius: 4px; }
pre { background: var(--code-bg); padding: .6rem; border-radius: 6px; overflow-x: auto; margin: 0; }
.small { font-size: .82em; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .85rem; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: .01em; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.nav a { text-decoration: none; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 1rem; font-size: .9rem; }

main { padding: 1.25rem 1rem 3rem; margin: 0 auto; }
main.narrow { max-width: 30rem; }
main.wide { max-width: 72rem; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: .25rem 0 .75rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 .6rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.wide-card { max-width: 40rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem 1rem 1rem; margin: 1rem 0; }
.panel h2 { margin-top: .8rem; }

form.stack, .stack { display: flex; flex-direction: column; gap: .75rem; }
.form { max-width: 40rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row > label { flex: 1 1 12rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .9rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
legend { padding: 0 .3rem; font-weight: 500; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .65rem; min-width: 0; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.code { font-family: var(--mono); font-size: 1.6rem; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
input.short { width: 6rem; }
details summary { cursor: pointer; color: var(--accent); }
details[open] { display: flex; flex-direction: column; gap: .5rem; }

button, .button { font: inherit; display: inline-block; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: .55rem 1rem; background: var(--surface); color: var(--text); text-decoration: none; text-align: center; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.small { padding: .2rem .55rem; font-size: .85rem; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
button.copy { padding: .2rem .6rem; font-size: .85rem; }
button.copied { border-color: var(--on); color: var(--on); }
form.inline { display: inline; }

.error { background: var(--error-bg); border-radius: 8px; padding: .6rem .8rem; }
.warn { background: var(--warn-bg); border-radius: 8px; padding: .6rem .8rem; }
.bigcode { font-family: var(--mono); font-size: 2.2rem; letter-spacing: .12em; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.bigcode button { letter-spacing: normal; font-family: var(--font); }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.tag { font-size: .8rem; border-radius: 99px; padding: .05rem .5rem; border: 1px solid currentColor; }
.tag.on { color: var(--on); }
.tag.off { color: var(--off); }
.list { padding-left: 1.2rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.stat b { font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .9rem; }
.filters { margin-bottom: 1rem; }
.qr { background: #ffffff; padding: 12px; border-radius: 8px; width: fit-content; }
.qr svg { display: block; width: min(280px, 70vw); height: auto; }

@media (max-width: 40rem) {
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: .4rem; }
  .bigcode { font-size: 1.7rem; }
}
