:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #6d645b;
  --line: #e4d9c8;
  --paper: #f6f1e7;
  --panel: #fffdf8;
  --accent: #8a3412;
  --header-bg: #efe6d8;
  --hover: #faf6ef;
  --input-bg: #ffffff;
  --input-border: #d9d0c3;
  --error-bg: #f8e6e1;
  --error-ink: #8f2d2d;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #f4efe6;
    --muted: #c4b8a8;
    --line: #433d36;
    --paper: #161411;
    --panel: #221f1b;
    --accent: #d86a32;
    --header-bg: #2a2520;
    --hover: #2c2823;
    --input-bg: #1b1815;
    --input-border: #564e45;
    --error-bg: #3d2824;
    --error-ink: #f3b8ae;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.4 "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
header { display: flex; gap: 18px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.brand { font-weight: 700; color: inherit; text-decoration: none; }
nav { display: flex; gap: 8px; }
nav a { color: inherit; text-decoration: none; padding: 6px 10px; border-radius: 999px; }
nav a.active, nav a:hover { background: var(--header-bg); }
#count { margin-left: auto; color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
main { padding: 16px; }
h1 { margin: 0 0 8px; font-size: 28px; }
.lede { margin: 0 0 12px; color: var(--muted); max-width: 80ch; }
.toolbar, .editor, .lookup-box { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
input, textarea, select, button { font: inherit; color: var(--ink); }
input, textarea, select { border: 1px solid var(--input-border); border-radius: 8px; padding: 8px 10px; background: var(--input-bg); }
textarea { width: min(720px, 100%); }
button { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--accent); color: white; cursor: pointer; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.wrap { overflow: auto; max-height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { border-collapse: collapse; font-size: 12px; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--header-bg); }
td { font-family: Consolas, monospace; max-width: 240px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
tr:hover td { background: var(--hover); }
.lead { font-weight: 700; }
.rest { color: var(--muted); }
.error { background: var(--error-bg); color: var(--error-ink); padding: 8px 10px; border-radius: 8px; }
.menu { position: absolute; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.vendors { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.vendor { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.vendor span { color: var(--muted); font-size: 13px; }
.finding { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; background: var(--panel); }
.finding p { margin: 6px 0; }
