/* One small, mobile-first stylesheet. No fonts or frameworks from anywhere
   else: nothing loads from a third party, for privacy and speed. */
:root { --fg: #1d1f21; --muted: #666; --line: #ddd; --accent: #1d5fa8; --bg: #fff; --err: #a8261d; }
@media (prefers-color-scheme: dark) {
  :root { --fg: #e6e6e6; --muted: #9a9a9a; --line: #333; --accent: #6fa8e8; --bg: #141516; --err: #f07a70; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--fg); background: var(--bg); }
a { color: var(--accent); }
main { max-width: 42rem; margin: 0 auto; padding: 1rem; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 1rem; align-items: center; }
.brand { font-weight: 600; text-decoration: none; color: var(--fg); }
.me { color: var(--muted); }
h1 { font-size: 1.6rem; line-height: 1.25; }
.lead { font-size: 1.1rem; }
.muted { color: var(--muted); }
.error { color: var(--err); font-weight: 500; }
.tag { font-size: .8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 1rem; padding: 0 .5rem; }
.cards { list-style: none; padding: 0; }
.cards li { border: 1px solid var(--line); border-radius: .5rem; padding: .8rem 1rem; margin: .6rem 0; }
.cards p { margin: .3rem 0 0; }
.stack { display: flex; flex-direction: column; gap: .8rem; margin: 1rem 0 2rem; }
.stack label { display: flex; flex-direction: column; gap: .25rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; }
input, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .35rem;
  background: var(--bg); color: var(--fg); }
button, .button { font: inherit; padding: .5rem 1rem; border: 0; border-radius: .35rem; background: var(--accent);
  color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button.link { background: none; color: var(--accent); padding: 0; text-decoration: underline; }
form.inline { display: inline; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
code { font-size: .85rem; word-break: break-all; }

/* Groups and posts */
.group-head h1 { margin-bottom: .2rem; }
.tabs { display: flex; gap: 1rem; border-bottom: 1px solid var(--line); margin: 1rem 0; }
.tabs a { padding: .4rem 0; text-decoration: none; color: var(--muted); }
.tabs a.on { color: var(--fg); border-bottom: 2px solid var(--accent); }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { border-bottom: 1px solid var(--line); }
.card { display: flex; gap: .8rem; padding: .8rem 0; text-decoration: none; color: var(--fg); }
.card .thumb { width: 88px; height: 88px; object-fit: cover; border-radius: .35rem; flex: none; }
.card-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.excerpt { color: var(--muted); font-size: .95rem; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .85rem; margin: .2rem 0; }
.post .body, .comment .body { overflow-wrap: anywhere; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .4rem; margin: .8rem 0; }
.photos img { width: 100%; height: 140px; object-fit: cover; border-radius: .35rem; }
.inline-photo { max-width: 240px; border-radius: .35rem; margin-top: .3rem; }
.actions { display: flex; gap: 1rem; font-size: .9rem; margin: .3rem 0; }
.comments { margin-top: 2rem; }
.thread { border-top: 1px solid var(--line); padding: .6rem 0; }
.replies { margin-left: 1.2rem; padding-left: .8rem; border-left: 2px solid var(--line); }
.comment.gone { color: var(--muted); font-style: italic; }
.reply summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.notice { background: color-mix(in srgb, var(--accent) 10%, transparent); padding: .4rem .6rem; border-radius: .35rem; font-size: .9rem; }
button.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); }
button:disabled { opacity: .6; }

/* Search, quick answers, and notes. System-written text (fact cards,
   notes) is set apart from members' words: a tinted card with no author
   or avatar, so it never reads like a member talking. */
.searchbox { display: flex; gap: .4rem; margin: .8rem 0; }
.searchbox input { flex: 1; min-width: 0; }
.top-search { max-width: 42rem; margin: .6rem auto 0; padding: 0 1rem; }
.results { list-style: none; padding: 0; }
.results li { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.about { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.factcards { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.factcards li, .note { background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: .35rem;
  padding: .6rem .8rem; margin: .5rem 0; }
.factcards p, .note p { margin: .2rem 0; }
.factcards .more { font-size: .9rem; }
.soft { color: var(--muted); font-size: .95rem; }
.feedback { font-size: .85rem; margin-bottom: 1rem; }
.note-head { font-size: .95rem; }
.more-notes summary, .tools summary { cursor: pointer; color: var(--accent); font-size: .9rem; margin: .6rem 0; }
.similar { border: 1px solid var(--line); border-radius: .35rem; padding: .4rem .8rem; }
.similar legend { font-size: .9rem; color: var(--muted); }
.similar-item { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.similar-item:last-child { border-bottom: 0; }
label.check { flex-direction: row; align-items: center; gap: .4rem; font-size: .95rem; }
.update { border-top: 2px solid var(--line); margin-top: 1.5rem; padding-top: .5rem; }
.update h2 { font-size: 1.3rem; }
select { font: inherit; padding: .4rem; border: 1px solid var(--line); border-radius: .35rem; background: var(--bg); color: var(--fg); }
footer { max-width: 42rem; margin: 2rem auto; padding: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.prose h2 { font-size: 1.2rem; margin-top: 1.5rem; }
a.button.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); }
/* M5: moderation */
button.danger { background: var(--err); }
.inline-tools { display: inline-block; }
.inline-tools summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.notice.status p { margin: .2rem 0; }
.votes { align-items: center; margin: .4rem 0; }
.votes button { padding: .2rem .7rem; }
details.flagged summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.queue-item { border: 1px solid var(--line); border-radius: .5rem; padding: .6rem .9rem; margin: .6rem 0; }
/* M6: engagement */
.windows { display: flex; gap: .8rem; font-size: .9rem; margin: -.4rem 0 .8rem; }
.windows a { color: var(--muted); text-decoration: none; }
.windows a.on { color: var(--fg); font-weight: 600; }
button.helpful.on { background: var(--accent); color: var(--bg); }
button.helpful { background: none; color: var(--accent); border: 1px solid var(--line); padding: .1rem .6rem; font-size: .85rem; }
.bell-list li { border-bottom: 1px solid var(--line); padding: .5rem 0; list-style: none; }
.bell-list li.unread { font-weight: 600; }
.bell-list { padding: 0; }
/* M7: profiles */
.profile-card { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.profile-card h1 { margin: 0; }
img.avatar { border-radius: 50%; object-fit: cover; width: 96px; height: 96px; }
/* M8: mobile polish. Most visits are phones in a campground, so these
   make the small screen the easy case rather than an afterthought. */
img { max-width: 100%; height: auto; }
.scroll-x { overflow-x: auto; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
@media (max-width: 600px) {
  /* The header wraps rather than pushing the page sideways. */
  .top { flex-wrap: wrap; gap: .4rem .8rem; padding: .5rem .8rem; }
  .top nav { flex-wrap: wrap; gap: .3rem .9rem; font-size: .95rem; }
  main { padding: .8rem; }
  h1 { font-size: 1.35rem; }
  /* Wide tables (admin, members) scroll inside themselves. */
  table { display: block; overflow-x: auto; }
  /* Deep reply chains keep some width to read in. */
  .replies { margin-left: .4rem; padding-left: .5rem; }
  .card .thumb { width: 72px; height: 72px; }
  .photos { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .photos img { height: 110px; }
  .tabs { overflow-x: auto; white-space: nowrap; }
}
@media (pointer: coarse) {
  /* Fingers, not mouse pointers: 44px is the smallest target people hit
     reliably. Text links inside sentences are left alone. */
  button, .button, select { min-height: 44px; }
  button.link { min-height: 0; padding: .4rem 0; }
  .actions a, .actions button, .tabs a, .top nav a { padding: .45rem 0; display: inline-block; }
  label.check input { width: 1.3rem; height: 1.3rem; }
}
