:root {
  --bg: #000;
  --bar: #000;
  --line: #262626;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --card: #121212;
  --ring: conic-gradient(from 180deg, #f9ce34, #ee2a7b, #6228d7, #f9ce34);
  --ok: #22c55e;
  --max: 470px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #0b0b0b; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

#app { min-height: 100vh; }
.shell {
  width: min(var(--max), 100%);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 76px;
  position: relative;
}

.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 14px;
  background: rgba(0,0,0,.92);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 22px; letter-spacing: -0.04em; }
.brand b { font-weight: 700; }
.top-right { display: flex; align-items: center; gap: 10px; }
.icon-btn, .ghost, .btn {
  border: 0; cursor: pointer; background: none;
}
.icon-btn { width: 36px; height: 36px; color: var(--text); }
.pill {
  font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px;
}

.stories {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.story { flex: 0 0 74px; text-align: center; color: var(--text); }
.story .ring {
  width: 66px; height: 66px; margin: 0 auto 6px; padding: 2px;
  border-radius: 50%; background: var(--ring);
}
.story.off .ring { background: #333; }
.story img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 2px solid #000; }
.story span { display: block; font-size: 11px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.explore {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line);
}
.tile { position: relative; aspect-ratio: 1; background: #111; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .cap {
  position: absolute; left: 6px; bottom: 6px; font-size: 11px;
  text-shadow: 0 1px 4px #000;
}

.tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(var(--max), 100%);
  height: 58px; display: grid; grid-template-columns: repeat(5, 1fr);
  background: #000; border-top: 1px solid var(--line); z-index: 40;
}
.tabs a {
  display: flex; align-items: center; justify-content: center; color: #f5f5f5;
}
.tabs a.active { opacity: 1; }
.tabs a:not(.active) { opacity: .55; }
.tabs svg { width: 24px; height: 24px; }

.searchbar {
  display: flex; gap: 8px; padding: 10px 14px; align-items: center;
}
.searchbar input, .searchbar select, .composer input {
  flex: 1; background: #1a1a1a; border: 0; border-radius: 10px; padding: 10px 12px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 10px; scrollbar-width: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: transparent;
  color: var(--text); border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.chip.on { background: #f5f5f5; color: #000; }

.profile { padding: 16px 16px 24px; }
.who { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center; }
.who img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; }
.who h1 { margin: 0; font-size: 20px; }
.who p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.bio { margin: 14px 0; font-size: 14px; line-height: 1.55; color: #ddd; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  background: #0095f6; color: #fff; border-radius: 8px; padding: 10px 12px; font-weight: 650;
}
.btn.gray { background: #363636; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.inbox { display: flex; flex-direction: column; min-height: calc(100vh - 134px); }
.thread { display: flex; gap: 12px; padding: 12px 14px; align-items: center; border-bottom: 1px solid var(--line); }
.thread img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.thread.on { background: #111; }
.chat { display: flex; flex-direction: column; flex: 1; }
.msgs { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 18px; background: #262626; }
.bubble.me { margin-left: auto; background: #3797f0; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }

.plans { display: flex; flex-direction: column; gap: 10px; padding: 8px 14px 24px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.plan.featured { border-color: #f5f5f5; }
.price { font-size: 22px; margin: 6px 0 10px; }
.price small { font-size: 13px; color: var(--muted); }
.kicker { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.page { padding: 16px 14px 8px; }
.page h1 { margin: 0 0 8px; font-size: 22px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none;
  align-items: flex-end; justify-content: center; z-index: 80;
}
.modal.show { display: flex; }
.dialog {
  width: min(var(--max), 100%); background: #1a1a1a; border-radius: 16px 16px 0 0;
  padding: 18px 16px 28px;
}
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }

.gate {
  position: fixed; inset: 0; background: #000; z-index: 100;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  background: #1a1a1a; border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px;
  display: none; z-index: 90; font-size: 13px;
}
.ghost { color: var(--muted); padding: 8px; }
footer.tiny { display: none; }

.lab { padding: 16px 14px 32px; }
.lab h1 { margin: 6px 0 8px; font-size: 22px; }
.lab .card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; margin: 12px 0;
}
.lab input, .dialog input {
  width: 100%; background: #111; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 8px 0;
}
.lab pre, #labLog {
  background: #111; border-radius: 8px; padding: 10px;
  overflow: auto; font-size: 12px; color: #86efac; white-space: pre-wrap;
}

@media (min-width: 900px) {
  body { background: #000; }
  .shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
