:root {
  --ink: #111c2b;
  --ink-soft: #46546a;
  --line: #d9e0e8;
  --paper: #f6f7f9;
  --card: #ffffff;
  --accent: #1d5c8c;
  --accent-soft: #e7f0f7;
  --warn: #7a4b00;
  --warn-bg: #fff7e6;
  --warn-line: #f0d7a3;
  --ok: #1f6b3a;
  --err: #a12a2a;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--accent); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
pre { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; overflow-x: auto; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header and footer */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1rem 0 2rem; font-size: 0.9rem; background: var(--card); }
.footer p { margin: 0.25rem 0; }

/* index: title, summary, limitations */
h1 { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); line-height: 1.25; letter-spacing: -0.01em; margin: 1rem 0 0.35rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.summary { margin: 0 0 0.75rem; color: var(--ink-soft); }
.summary span { white-space: nowrap; }
.limits {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 0.6rem 1rem 0.5rem;
  font-size: 0.9rem;
}
.limits h2 { margin: 0 0 0.25rem; font-size: 0.95rem; color: var(--warn); }
.limits ul { margin: 0; padding-left: 1.1rem; }
.limits li { margin: 0.1rem 0; }
.limits details { margin-top: 0.35rem; }
.limits summary { cursor: pointer; color: var(--accent); }
.details-body p { margin: 0.4rem 0; }

/* filters and table */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; margin: 1rem 0 0.5rem; }
.filters label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--ink-soft); gap: 0.15rem; }
select, input, textarea, button { font: inherit; }
select, input, textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  background: var(--card);
  color: var(--ink);
  min-width: 0;
}
.filters select { min-width: 10rem; max-width: 100%; }
.table-note { margin: 0.25rem 0; font-size: 0.85rem; color: var(--ink-soft); min-height: 1.2em; }
.table-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 0.45rem 0.6rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #eef2f6; position: sticky; top: 0; }
th button { background: none; border: 0; padding: 0; font-weight: 600; color: var(--ink); cursor: pointer; }
th button[aria-sort]::after { content: " ↕"; color: var(--ink-soft); }
th button[aria-sort="ascending"]::after { content: " ↑"; }
th button[aria-sort="descending"]::after { content: " ↓"; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.selected { background: var(--accent-soft); }
tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
td.insufficient { color: var(--ink-soft); font-style: italic; }
.rules th, .rules td { white-space: normal; }
.downloads { font-size: 0.85rem; color: var(--ink-soft); }

.row-details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; margin-top: 0.75rem; }
.row-details h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.row-details ol { padding-left: 1.25rem; margin: 0.5rem 0; }
.row-details li { margin: 0.15rem 0; }
.row-details .close { float: right; }

/* demo video */
.demo { margin-top: 2rem; }
.demo-video { display: block; width: 100%; max-width: 960px; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink); }

/* access form */
.access { margin-top: 2rem; }
.access-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  max-width: 760px;
}
.access-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; }
.access-form .wide { grid-column: 1 / -1; }
.access-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
button[type="submit"], .button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}
button[type="submit"][disabled] { opacity: 0.6; cursor: wait; }
.form-status { margin: 0; }
.form-status.ok { color: var(--ok); }
.form-status.error { color: var(--err); }

/* text pages */
.prose { max-width: 780px; }
.prose .lead { font-size: 1.05rem; color: var(--ink-soft); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1.25rem; }
.card h2 { margin-top: 0.75rem; }
address { font-style: normal; }
dl.defs dt { font-weight: 600; margin-top: 0.6rem; }
dl.defs dd { margin: 0.1rem 0 0 0; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters select { min-width: 0; width: 100%; }
  .access-form { grid-template-columns: 1fr; }
  .limits { font-size: 0.85rem; }
}
