/* VIR Community — minimal stylesheet. No framework. Same restraint as VIR. */
:root {
  --bg: #0e1116;
  --panel: #161b22;
  --fg: #e6edf3;
  --muted: #8b949e;
  --link: #58a6ff;
  --border: #30363d;
  --accent: #2ea043;
  --warn: #d29922;
  --err: #f85149;
  --silver: #c0c0c0;
  --gold: #d4a017;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
header.topbar { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--panel); }
header.topbar .brand { font-weight: 600; font-size: 1.1rem; color: var(--fg); }
header.topbar nav { display: flex; gap: 1rem; align-items: center; }
footer { max-width: 900px; margin: 4rem auto 2rem; padding: 0 1rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 1rem; }
button { background: var(--link); color: white; border: 0; padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; font-size: 1rem; }
button.link { background: none; color: var(--link); padding: 0; cursor: pointer; text-decoration: underline; }
button:hover { filter: brightness(1.1); }
input[type=email], input[type=text] { background: var(--bg); color: var(--fg); border: 1px solid var(--border); padding: 0.5rem; border-radius: 4px; width: 100%; max-width: 400px; font-size: 1rem; }
label { display: block; margin: 0.75rem 0; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.error { color: var(--err); }
.flash { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.flash-info { background: rgba(88, 166, 255, 0.1); border: 1px solid var(--link); }
.flash-error { background: rgba(248, 81, 73, 0.1); border: 1px solid var(--err); }
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.categories { list-style: none; padding: 0; }
.categories li { padding: 0.75rem; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 0.5rem; background: var(--panel); }
.tier { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.8rem; background: var(--border); }
.tier-trusted { background: #1f6feb; color: white; }
.tier-veteran { background: #6e40c9; color: white; }
.tier-authority { background: var(--accent); color: white; }
.rep { color: var(--muted); margin-left: 0.5rem; font-size: 0.9rem; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.8rem; margin-left: 0.25rem; }
.badge-silver { background: var(--silver); color: #111; }
.badge-gold { background: var(--gold); color: #111; font-weight: 600; }
.rep-events { list-style: none; padding: 0; }
.rep-events li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.rep-events .delta { display: inline-block; min-width: 3rem; font-weight: 600; }
.rep-events .delta.pos { color: var(--accent); }
.rep-events .delta.neg { color: var(--err); }
.auth-form { max-width: 400px; }
.profile .handle { color: var(--muted); margin-top: -0.5rem; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.crumbs a { color: var(--muted); }
.topics { list-style: none; padding: 0; }
.topics li { padding: 0.6rem; border-bottom: 1px solid var(--border); }
.locked { background: var(--err); color: white; padding: 0.05rem 0.4rem; border-radius: 3px; font-size: 0.75rem; }
.post { border: 1px solid var(--border); border-radius: 4px; margin: 1rem 0; background: var(--panel); padding: 1rem; }
.post header { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.post-body { margin: 0.5rem 0; }
.post-body pre { background: var(--bg); padding: 0.5rem; border-radius: 4px; overflow-x: auto; }
.post-body code { font-family: ui-monospace, "SF Mono", monospace; }
.post-body blockquote { border-left: 3px solid var(--link); margin: 0.5rem 0; padding-left: 0.75rem; color: var(--muted); }
.post-body a.cve-link { color: var(--warn); font-weight: 600; }
.post footer { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
button.rxn { background: var(--bg); border: 1px solid var(--border); color: var(--fg); padding: 0.25rem 0.6rem; font-size: 0.85rem; margin-right: 0.25rem; }
button.rxn:hover { border-color: var(--link); }
.button-link { display: inline-block; background: var(--link); color: white; padding: 0.5rem 1rem; border-radius: 4px; text-decoration: none; }
.status { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; }
.status-pending { background: var(--warn); color: #111; }
.status-verified { background: var(--accent); color: white; }
.status-revoked { background: var(--err); color: white; }
.domains { list-style: none; padding: 0; }
.domains li { padding: 0.6rem; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 0.5rem; background: var(--panel); }
.domains pre { background: var(--bg); padding: 0.5rem; border-radius: 4px; overflow-x: auto; }
table.members { width: 100%; border-collapse: collapse; }
table.members th, table.members td { padding: 0.4rem; border-bottom: 1px solid var(--border); text-align: left; }

/* a11y: skip link, focus indicators, reduced motion */
.skip-link { position: absolute; left: -9999px; top: 0; padding: 0.5rem 1rem; background: var(--link); color: white; z-index: 100; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; outline: 2px solid var(--fg); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
button, a, input, select, textarea { min-height: 44px; } /* WCAG touch target */
button.link, button.rxn { min-height: auto; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (prefers-color-scheme: light) {
  /* let users with light-mode systems override; honoured if no JS theme applied */
  :root.allow-system-light { --bg: #fff; --panel: #f6f8fa; --fg: #1f2328; --muted: #57606a; --border: #d0d7de; }
}

/* mobile (< 720px): single-column, tighter padding, stacked nav */
@media (max-width: 720px) {
  main { margin: 1rem auto; padding: 0 0.75rem; }
  header.topbar { padding: 0.5rem 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
  header.topbar nav { width: 100%; justify-content: flex-end; }
  .features { grid-template-columns: 1fr !important; }
  input[type=email], input[type=text], textarea, select { max-width: 100%; }
  table.members { display: block; overflow-x: auto; white-space: nowrap; }
  .post { padding: 0.75rem; }
  .post-body pre { font-size: 0.85rem; }
  .topics li { padding: 0.5rem; }
  .admin-nav { font-size: 0.85rem; line-height: 1.8; }
  button { padding: 0.6rem 1rem; }
  .hero h1 { font-size: 1.6rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
}
@media (max-width: 480px) {
  header.topbar .brand { font-size: 1rem; }
  .crumbs { font-size: 0.8rem; }
  button.rxn { padding: 0.4rem 0.5rem; }
}
.propose-form textarea { width: 100%; max-width: 800px; background: var(--bg); color: var(--fg); border: 1px solid var(--border); padding: 0.5rem; font-family: ui-monospace, "SF Mono", monospace; }
.propose-form fieldset { border: 1px solid var(--border); padding: 0.5rem 1rem; margin: 1rem 0; }
.propose-form .actions { margin-top: 1rem; }
.propose-form .actions button { margin-right: 0.5rem; }
aside.cve-card { background: var(--panel); border: 1px solid var(--warn); padding: 0.75rem; border-radius: 4px; margin: 1rem 0; }
.status-draft { background: var(--muted); color: white; }
.status-ai_review, .status-human_review { background: var(--warn); color: #111; }
.status-approved, .status-published { background: var(--accent); color: white; }
.status-rejected, .status-retracted { background: var(--err); color: white; }
.admin-nav { background: var(--panel); padding: 0.5rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.admin-nav a.active { color: var(--fg); font-weight: 600; }
