:root {
  --bg: #0e0d13;
  --bg-2: #17151f;
  --card: #1d1a27;
  --line: #2c2839;
  --text: #f2eff8;
  --muted: #9b95ad;
  --accent: #c6ff3d;
  --accent-ink: #14170a;
  --violet: #9b7bff;
  --danger: #ff5d73;
  --ok: #52e3a4;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.wide { max-width: 1040px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 13, 19, .85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.03em; }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 15px;
  position: relative;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--bg-2); }
.nav a.on { color: var(--text); background: var(--card); }
.badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: 12px; line-height: 18px; text-align: center; font-weight: 800;
}

@media (max-width: 640px) {
  /* backdrop-filter would make the header the containing block of the fixed
     bottom bar, pinning it to the top. */
  .top { backdrop-filter: none; background: var(--bg); }
  #nav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; justify-content: space-around;
    background: rgba(14, 13, 19, .95); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  #nav a { font-size: 13px; padding: 8px 10px; }
  body.in { padding-bottom: 70px; }
}

main { padding: 28px 0 64px; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  font: inherit; font-weight: 700; background: var(--card); color: var(--text);
  border: 1px solid var(--line); transition: transform .08s, background .15s;
}
.btn:hover { background: var(--line); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #d6ff6b; }
.btn.danger { color: var(--danger); }
.btn.big { padding: 16px 30px; font-size: 18px; }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 18px; }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violet); border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-bottom: 10px; }
.check input { margin-top: 5px; accent-color: var(--accent); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label {
  margin: 0; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  cursor: pointer; font-weight: 600; background: var(--bg-2);
}
.seg input { display: none; }
.seg input:checked + span { color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent); }

.error {
  background: rgba(255, 93, 115, .12); border: 1px solid rgba(255, 93, 115, .35);
  color: #ffc2cb; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px;
}
.notice {
  background: rgba(155, 123, 255, .12); border: 1px solid rgba(155, 123, 255, .35);
  padding: 14px 16px; border-radius: 14px; margin-bottom: 18px;
}
.muted { color: var(--muted); }
.center { text-align: center; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 16px;
}
.panel { max-width: 460px; margin: 0 auto; }

.avatar {
  width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-size: 28px; flex: none;
}
.avatar.lg { width: 96px; height: 96px; font-size: 50px; }
.avatar.sm { width: 40px; height: 40px; font-size: 20px; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; }
.avatars label { margin: 0; cursor: pointer; }
.avatars input { display: none; }
.avatars .avatar { outline: 3px solid transparent; outline-offset: 2px; transition: outline-color .1s; }
.avatars input:checked + .avatar { outline-color: var(--accent); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.chip.shared { border-color: var(--accent); color: var(--accent); }

/* profile card in the feed */
.person .head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.person .name { font-size: 24px; font-weight: 800; }
.person .meta { color: var(--muted); }
.qa { margin-top: 14px; }
.qa .q { color: var(--muted); font-size: 14px; margin-bottom: 2px; }
.qa .a { margin-bottom: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.about { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.actions .btn { flex: 1; max-width: 200px; }

/* niches */
.niches { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.niche {
  display: block; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s;
}
.niche:hover { text-decoration: none; border-color: var(--violet); transform: translateY(-2px); }
.niche .icon { font-size: 34px; }
.niche h3 { margin: 8px 0 4px; }
.niche p { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.status { font-size: 13px; font-weight: 700; }
.status.open { color: var(--ok); }
.status.gathering { color: var(--violet); }
.status.moderation { color: var(--muted); }
.progress { height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--violet); border-radius: 999px; }

/* lists */
.list .item {
  display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px;
  color: var(--text); border: 1px solid transparent;
}
.list .item:hover { background: var(--card); border-color: var(--line); text-decoration: none; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item .sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 60px - 56px); }
@media (max-width: 640px) { .chat { height: calc(100vh - 60px - 56px - 70px); } }
.chat .with { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chat .with .grow { flex: 1; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.msg {
  max-width: 78%; padding: 10px 14px; border-radius: 18px; background: var(--card);
  white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; border-bottom-left-radius: 6px;
}
.msg.mine { align-self: flex-end; background: var(--violet); color: #0e0b1a; border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.msg.reveal { border: 1px dashed var(--accent); background: transparent; color: var(--text); }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 2px; }
.composer { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.composer textarea { min-height: 48px; height: 48px; resize: none; overflow-y: auto; scrollbar-width: none; }
body.in footer { display: none; }

/* landing */
.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(42px, 9vw, 84px); font-weight: 800; letter-spacing: -.045em; margin-bottom: 12px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: clamp(18px, 3vw, 22px); color: var(--muted); max-width: 560px; margin: 0 auto 30px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; counter-reset: s; }
.steps .card { counter-increment: s; margin: 0; }
.steps .card::before { content: counter(s); display: block; font-size: 30px; font-weight: 800; color: var(--accent); }
section { margin: 56px 0; }
section h2 { font-size: 30px; }

footer { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 14px; }
footer .row a { color: var(--muted); }

/* admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: var(--bg-2); color: var(--muted); font-weight: 700; }
.tabs a.on { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.tabs a:hover { text-decoration: none; color: var(--text); }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
code { background: var(--bg-2); padding: 2px 6px; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-weight: 700; box-shadow: var(--shadow); z-index: 50;
}
.spinner { text-align: center; color: var(--muted); padding: 40px 0; }
