:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card2: #273449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-h: #818cf8;
  --danger: #ef4444;
  --accent: #10b981;
  --warn: #f59e0b;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container { max-width: 640px; width: 100%; margin: 0 auto; padding: 1rem; flex: 1; }
.topnav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; background: var(--card); position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); display: flex; gap: 0.5rem; align-items: center; }
.navlinks { display: flex; gap: 0.9rem; align-items: center; }
.navlinks a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.navlinks a:hover { color: var(--text); }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1.5rem; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 1rem;
  margin-bottom: 0.75rem; display: block; color: var(--text);
}
a.card:hover { background: var(--card2); }
.empty { text-align: center; padding: 2.5rem 1rem; }

.btn {
  display: inline-block; background: var(--card2); color: var(--text);
  border: none; border-radius: 10px; padding: 0.6rem 1rem; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-h); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.fab-wrap { position: fixed; right: 1.2rem; bottom: 4.5rem; }
.fab {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: 1.6rem; text-decoration: none; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

.tabs { display: flex; gap: 0.5rem; margin: 0.75rem 0; flex-wrap: wrap; }
.tabs a { color: var(--muted); text-decoration: none; padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--card); font-size: 0.9rem; }
.tab-active { background: var(--primary); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.chip {
  background: var(--card2); border-radius: 999px; padding: 0.3rem 0.75rem;
  font-size: 0.85rem; color: var(--text); text-decoration: none;
}
.chip-active { background: var(--primary); }
a.chip:hover { color: #fff; }

.activity-card { text-decoration: none; }
.act-head { display: flex; gap: 0.75rem; align-items: center; }
.act-emoji { font-size: 1.7rem; }
.act-title { font-weight: 600; }
.act-meta { font-size: 0.85rem; margin-top: 0.15rem; }
.act-foot { display: flex; gap: 0.5rem; margin-top: 0.75rem; align-items: center; }
.pill { background: var(--card2); padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.8rem; }
.pill-accent { background: var(--accent); color: #06281e; }
.pill-warn { background: var(--warn); color: #332404; }

.form label { display: block; margin-bottom: 0.9rem; font-size: 0.9rem; }
.form input, .form select, .form textarea {
  display: block; width: 100%; margin-top: 0.3rem;
  background: var(--bg); color: var(--text);
  border: 1px solid #3b4a61; border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 1rem; font-family: inherit;
}
.form fieldset { border: 1px solid #3b4a61; border-radius: 10px; margin: 0 0 1rem; }
.check { display: inline-flex; gap: 0.3rem; align-items: center; cursor: pointer; font-size: 0.85rem; }
.check input { width: auto; display: inline; }
.interest-group { margin-bottom: 0.7rem; }
.err { background: #7f1d1d; border-radius: 10px; padding: 0.6rem 0.9rem; margin-bottom: 0.9rem; }
.flash { background: #064e3b; border-radius: 10px; padding: 0.6rem 0.9rem; margin-bottom: 0.9rem; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; align-items: center; }
.actions form { display: inline; margin: 0; }
.members { list-style: none; padding: 0; margin: 0; }
.members li { display: flex; gap: 0.7rem; align-items: center; padding: 0.45rem 0; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary);
  color: #fff; text-decoration: none; font-weight: 700;
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }
.profile-head { display: flex; gap: 0.9rem; align-items: center; margin-bottom: 0.75rem; }
.report-details summary { cursor: pointer; }

.chat-head { display: flex; justify-content: space-between; align-items: center; }
.chat { height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.msg { max-width: 85%; }
.msg-head { font-size: 0.75rem; color: var(--muted); }
.msg-body { background: var(--card2); border-radius: 12px; padding: 0.5rem 0.8rem; display: inline-block; white-space: pre-wrap; word-break: break-word; }
.msg-me { align-self: flex-end; text-align: right; }
.msg-me .msg-body { background: var(--primary); text-align: left; }
.chat-form { display: flex; gap: 0.5rem; position: sticky; bottom: 0.5rem; }
.chat-form input { flex: 1; background: var(--bg); color: var(--text); border: 1px solid #3b4a61; border-radius: 10px; padding: 0.6rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 0.6rem; }
.stat { text-align: center; }
.stat b { font-size: 1.5rem; display: block; }
.stat span { color: var(--muted); font-size: 0.8rem; }

.hero { text-align: center; padding: 3rem 0.5rem; }
.hero h1 { font-size: 1.7rem; }

.reason { color: #a5b4fc; font-size: 0.8rem; margin-top: 0.15rem; }
.searchrow { display: flex; gap: 0.5rem; margin: 0.5rem 0; }
.searchrow input { flex: 1; background: var(--bg); color: var(--text); border: 1px solid #3b4a61; border-radius: 10px; padding: 0.55rem 0.8rem; }
.quietrow { display: flex; gap: 0.5rem; align-items: center; margin: 0.6rem 0; }
.quietrow select { background: var(--bg); color: var(--text); border: 1px solid #3b4a61; border-radius: 8px; padding: 0.35rem; }
img.avatar { object-fit: cover; }
