:root {
  --bg: #fafaf9;
  --fg: #1c1917;
  --muted: #78716c;
  --card: #ffffff;
  --border: #e7e5e4;
  --accent: #4f46e5;
  --accent-fg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --fg: #f5f5f4;
    --muted: #a8a29e;
    --card: #1c1917;
    --border: #292524;
    --accent: #818cf8;
    --accent-fg: #0c0a09;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
.site-header, main, .site-footer { max-width: 44rem; margin: 0 auto; padding: 0 16px; }
.site-header { padding-top: 24px; padding-bottom: 8px; }
.brand { color: var(--fg); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.site-footer { padding-top: 32px; padding-bottom: 32px; color: var(--muted); }

.ask { margin: 24px 0 40px; }
.ask-label { display: block; font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.ask-text {
  width: 100%; min-height: 8rem; padding: 16px; font: inherit; font-size: 1.25rem;
  color: var(--fg); background: var(--card); border: 2px solid var(--border);
  border-radius: 12px; resize: vertical;
}
.ask-text:focus { outline: none; border-color: var(--accent); }
.ask-submit, .vote, .sort-btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--fg);
}
.ask-submit { margin-top: 12px; padding: 10px 20px; background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.ask-submit:disabled { opacity: .6; cursor: progress; }
.ask-count { margin: 6px 0 0; font-size: .85rem; color: var(--muted); text-align: right; }
.ask-count.near { color: #b45309; }
.ask-count.full { color: #dc2626; font-weight: 600; }
.ask-status { min-height: 1.5em; color: var(--muted); }
.ask-status.error { color: #dc2626; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.turnstile { margin-top: 12px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 { font-size: 1.25rem; margin: 0; }
.sort { display: flex; gap: 4px; }
.sort-btn { padding: 4px 12px; font-size: .9rem; }
.sort-btn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

.q-list { list-style: none; padding: 0; margin: 16px 0 32px; display: grid; gap: 12px; }
.q { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.q-text { font-weight: 600; color: var(--fg); text-decoration: none; }
a.q-text:hover { text-decoration: underline; }
.q.open .q-text { font-weight: 400; }
.q-excerpt { margin: 6px 0; color: var(--muted); }
.q-meta, .hint, .empty { color: var(--muted); font-size: .9rem; }
.q.open { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compact .q { padding: 10px 14px; }
.vote { padding: 6px 12px; white-space: nowrap; }
.vote[disabled] { opacity: .6; cursor: default; }

.answer-page .question { font-size: 1.9rem; line-height: 1.25; margin-top: 32px; }
.answer { font-size: 1.1rem; }

/* Answer page: vote button next to the date and views, and a compact ask form under the answer. */
.answer-actions { display: flex; align-items: center; gap: 16px; margin: 20px 0 8px; }
.answer-actions .q-meta { margin: 0; }
.ask-compact { margin: 40px 0 24px; padding-top: 28px; border-top: 1px solid var(--border); }
.ask-compact .ask-label { font-size: 1.25rem; }
.ask-compact .ask-text { min-height: 6rem; font-size: 1.1rem; }
/* No room is reserved for the lazy captcha: it appears under the field the visitor is typing in. */
.ask-compact .turnstile:empty { margin-top: 0; }

