/* smallgroup.us — deliberately small. Phones first. */
:root {
  --bg: #fbfaf7;
  --fg: #1f2328;
  --muted: #667085;
  --accent: #2f6f5e;
  --accent-fg: #ffffff;
  --border: #e3e0d8;
  --card: #ffffff;
  --error: #b42318;
  --notice: #fff6e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e6e6e6;
    --muted: #9aa3ae;
    --accent: #6cc3a8;
    --accent-fg: #0d1f1a;
    --border: #2c3036;
    --card: #1d2024;
    --error: #ff8a80;
    --notice: #3a3220;
  }
}

* { box-sizing: border-box; }
body { margin: 0; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }

.container { max-width: 40rem; margin: 0 auto; padding: 1rem; }
section { margin-top: 2rem; }

a { color: var(--accent); }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; }
.error { color: var(--error); font-weight: 600; }
.notice { background: var(--notice); padding: 0.75rem 1rem; border-radius: 0.5rem; }

form.stack { display: flex; flex-direction: column; gap: 0.5rem; max-width: 26rem; }
form.inline { display: inline; margin: 0; }
label { font-weight: 600; }
input, textarea {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--fg);
}
textarea { min-height: 5rem; }

button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
form.stack button { align-self: flex-start; margin-top: 0.5rem; }

ul.cards { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
ul.cards li { background: var(--card); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem 1rem; }
ul.cards li form { margin-top: 0.5rem; }

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  border-radius: 1rem;
  background: var(--accent);
  color: var(--accent-fg);
}
.badge.pending { background: var(--notice); color: var(--fg); }

.invite-link { word-break: break-all; background: var(--card); border: 1px solid var(--border); padding: 0.25rem 0.5rem; border-radius: 0.25rem; }

/* Group chat */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.group-header h1 { margin-bottom: 0; }
.group-header p { margin-top: 0.25rem; }

.chat { margin-top: 1rem; }
.messages { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.message { background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.5rem 0.75rem; }
.message .meta { font-size: 0.85rem; }
.message .when { color: var(--muted); margin-left: 0.25rem; }
.message .text { margin: 0.25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.composer {
  position: sticky; bottom: 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end;
  padding: 0.75rem 0; background: var(--bg);
  border-top: 1px solid var(--border);
}
.composer textarea { flex: 1; min-height: 2.75rem; resize: vertical; }
.composer .error { flex-basis: 100%; margin: 0; }

.group-info { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.group-info summary { cursor: pointer; font-weight: 600; }
.group-info form.leave { margin-top: 1.5rem; }

/* Meetings */
.next-meeting { margin-top: 1rem; }
.next-meeting > p { margin: 0.5rem 0 0; }
.meeting { background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
.meeting p { margin: 0.25rem 0; }
.meeting.cancelled .meeting-when strong { text-decoration: line-through; color: var(--muted); }
.meeting-when a { color: var(--fg); text-decoration: none; }
.headcount { font-size: 0.9rem; }
form.rsvp { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
form.rsvp button { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; }
dl.details dt { font-weight: 600; }
dl.details dd { margin: 0; }
.address { white-space: pre-wrap; }
.leader-tools { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.75rem; }
details.tool { border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.75rem 1rem; background: var(--card); }
details.tool summary { cursor: pointer; font-weight: 600; }
details.tool form { margin-top: 0.75rem; }
select { font: inherit; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--card); color: var(--fg); }
