:root {
  --bg: #0E1116; --alt: #12161D; --card: #161B23; --chip: #1D2430; --border: #2A3342; --line: #3A4557;
  --teal: #2EE6C5; --teal-bg: #12302C; --teal-bd: #1F5A50;
  --text: #E8ECF2; --sub: #B4BDCA; --soft: #C5CDD8; --muted: #9AA4B2;
  --amber: #FFB547; --amber-bg: #1A1710; --amber-bd: #5C4A22;
  --purple: #B9A6FF; --purple-bg: #1A1630; --purple-bd: #4B3F86;
  --red: #FF8A8A; --red-bd: #7A3B3B; --red-bg: #241416;
  --head: 'Space Grotesk', Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, sans-serif; }
a { color: var(--teal); }
a:hover { color: #7FF3DE; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--head); font-size: 30px; letter-spacing: -0.5px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--teal); color: var(--bg); padding: 10px 14px; border-radius: 8px; }

/* demo bar */
.demo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 16px; background: var(--amber-bg); border-bottom: 1px solid var(--amber-bd); font-size: 14px; color: #FFD58A; }
.demo strong { color: var(--amber); }
.demo-text { flex: 1 1 260px; }
.demo-switch { display: flex; align-items: center; gap: 8px; }
.demo-switch select { min-height: 36px; padding: 4px 8px; }

/* header and nav */
.top { display: flex; align-items: center; gap: 12px 24px; padding: 10px 24px; border-bottom: 1px solid var(--border); max-width: 1100px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 20px; }
.lobby-pill { font-size: 13px; font-weight: 700; color: var(--bg); background: var(--purple); padding: 3px 10px; border-radius: 999px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.tab { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 44px; border-radius: 10px; color: var(--soft); text-decoration: none; font-size: 15px; }
.tab.on { color: var(--teal); background: var(--teal-bg); font-weight: 600; }
.badge { background: var(--teal); color: var(--bg); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 20px; }

.main { max-width: 1100px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 16px; outline: none; }
.main.narrow { max-width: 640px; }
.main.center { text-align: center; align-items: center; padding-top: 56px; }
.foot { max-width: 1100px; margin: 0 auto; padding: 16px 24px 32px; font-size: 13px; color: var(--muted); }
.lead { color: var(--sub); font-size: 17px; }
.meta { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; }
.hint.pad { padding: 0 16px 14px; }
.error { color: var(--red); font-size: 15px; min-height: 0; }
.error:empty { display: none; }
.hero-logo { margin-bottom: 4px; }
.back { align-self: flex-start; text-decoration: none; padding: 6px 0; }

/* layout bits */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; flex-wrap: wrap; }
.row.head { flex-wrap: wrap; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.card.mini { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; }
.card.empty { align-items: center; text-align: center; padding: 36px 20px; }
.card.pick { flex-direction: row; align-items: center; gap: 14px; text-align: left; font: inherit; cursor: pointer; text-decoration: none; }
.card.pick:hover, .card.mini:hover { border-color: var(--line); }
.card.radio { flex-direction: row; align-items: flex-start; gap: 12px; cursor: pointer; }
.card.radio.on { border: 2px solid var(--teal); }
.card.radio input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--teal); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 10px; font: 600 16px Inter, sans-serif; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn.big { min-height: 56px; padding: 0 26px; font-size: 17px; }
.btn.primary { background: var(--teal); color: var(--bg); }
.btn.primary:hover { background: #5CEDD3; color: var(--bg); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger { color: var(--red); border-color: var(--red-bd); }
.btn.danger-fill { background: var(--red); color: var(--bg); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--teal); font: inherit; cursor: pointer; padding: 8px 4px; min-height: 36px; text-decoration: underline; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 22px; color: var(--text); text-decoration: none; }

.av { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #233040; color: var(--teal); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.av.sm { width: 38px; height: 38px; font-size: 14px; }
.av.lg { width: 72px; height: 72px; font-size: 24px; font-family: var(--head); }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--teal); background: var(--teal-bg); padding: 2px 8px; border-radius: 999px; vertical-align: 1px; }
.tagpill { font-size: 13px; font-weight: 700; color: var(--bg); background: var(--teal); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.tagpill.amber { background: var(--amber); }
.status { font-size: 14px; color: var(--teal); font-weight: 600; }
.status.muted { color: var(--muted); font-weight: 400; }

/* posts */
.post .who { display: flex; align-items: center; gap: 12px; }
.post .name { font-weight: 600; }
.post .title { font-size: 18px; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.tags span { background: var(--chip); padding: 4px 10px; border-radius: 6px; }
.stats { flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; gap: 10px 20px; }
.stats small { color: var(--muted); font-size: 12px; }
.ask { display: flex; flex-direction: column; gap: 8px; background: var(--alt); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }

/* forms */
.form { gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .lbl { font-size: 14px; font-weight: 600; color: var(--soft); }
input[type=text], input:not([type]), select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; font: 16px Inter, sans-serif; min-height: 48px; width: 100%; }
textarea { min-height: 0; resize: vertical; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 600; margin-bottom: 8px; }
.check { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 16px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--teal); }
.check .hint { flex: 1 1 100%; padding-left: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--chip); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; min-height: 44px; font: 15px Inter, sans-serif; cursor: pointer; }
.chip.on { background: var(--teal); color: var(--bg); border-color: var(--teal); font-weight: 600; }
.filters summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.filters[open] { gap: 16px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.steps li { border: 1px solid var(--border); color: var(--muted); padding: 5px 12px; border-radius: 999px; }
.steps li.done { background: var(--teal-bg); color: var(--teal); border-color: var(--teal-bd); font-weight: 600; }
.steps li[aria-current] { background: var(--teal); color: var(--bg); border-color: var(--teal); font-weight: 700; }

/* my posts */
.req { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; background: var(--chip); border-radius: 12px; padding: 12px 14px; }
.quote { color: var(--soft); font-size: 15px; }

/* notes */
.note { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 14px 16px; font-size: 15px; }
.note.teen { background: var(--purple-bg); border: 1px solid var(--purple-bd); color: #D9D2F5; }
.note.teen .ic { color: var(--purple); flex: none; margin-top: 2px; }

/* chat */
.chat { padding: 0; gap: 0; overflow: hidden; }
.chat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.msgs { display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 280px; max-height: 60vh; overflow-y: auto; }
.bubble { max-width: 78%; padding: 9px 14px; border-radius: 14px; overflow-wrap: anywhere; }
.bubble.them { align-self: flex-start; background: var(--chip); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--teal); color: var(--bg); border-bottom-right-radius: 4px; }
.sys { display: flex; gap: 8px; align-items: flex-start; align-self: center; font-size: 13px; color: #C5E9E1; background: var(--teal-bg); border: 1px solid var(--teal-bd); border-radius: 10px; padding: 8px 12px; max-width: 92%; }
.sys .ic { flex: none; margin-top: 2px; color: var(--teal); }
.warn { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: #FFD58A; background: var(--amber-bg); border: 1px solid var(--amber-bd); border-radius: 10px; padding: 9px 12px; }
.warn .ic { flex: none; margin-top: 2px; }
.compose { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--alt); }
.compose input { flex: 1 1 200px; width: auto; }
.closed { padding: 16px; color: var(--muted); border-top: 1px solid var(--border); }
.report { margin: 12px 14px 0; background: var(--alt); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }

/* profile and settings */
.profile h1 { font-size: 28px; }
.stat b { font-family: var(--head); font-size: 28px; }
.stat b.sm { font-size: 17px; font-family: Inter, sans-serif; }
.stat small { color: var(--muted); font-size: 13px; }
.danger-box { background: var(--red-bg); border: 1px solid var(--red-bd); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); font-weight: 600; padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); z-index: 40; box-shadow: 0 6px 24px rgba(0,0,0,.4); }

/* phone */
@media (max-width: 720px) {
  .top { padding: 10px 16px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 0; background: var(--alt); border-top: 1px solid var(--border); padding: 4px 4px calc(8px + env(safe-area-inset-bottom)); }
  .tab { flex: 1 1 0; flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 2px; min-height: 56px; border-radius: 8px; }
  .tab.on { background: transparent; }
  .badge { position: absolute; top: 2px; right: calc(50% - 22px); font-size: 11px; line-height: 17px; padding: 0 5px; }
  .main { padding: 16px 16px 96px; }
  .foot { padding-bottom: 96px; }
  #toast { bottom: 92px; }
  h1 { font-size: 26px; }
  .demo-text { flex-basis: 100%; }
  .msgs { max-height: 52vh; }
  .chat-head .btn.sm { min-height: 40px; padding: 0 10px; font-size: 14px; }
}
