:root {
  --bg: #121018;
  --bg2: #1a1622;
  --bg3: #221c2c;
  --card: #1e1828;
  --ink: #f4eef8;
  --muted: #9b90a8;
  --line: rgba(255,255,255,0.08);
  --pink: #e84a8a;
  --pink2: #ff6aa8;
  --purple: #6b4eff;
  --energy: #ffd166;
  --radius: 18px;
  --nav-h: 64px;
  --font: Inter, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, a, .card, .chat-row, .tab, .tab-h, .chip, .seg-btn, .mode, .ctab, .nav-btn {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
button, .icon, .nav-btn, .chip, .seg-btn, .tab-h, .btn, .fab, .plus, .composer-ico, .send {
  cursor: pointer;
  position: relative;
  z-index: 2;
}
#app { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); position: relative; }
.view { min-height: 100dvh; position: relative; z-index: 1; }
.hidden { display: none !important; pointer-events: none !important; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 0.78rem; }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.7rem 0.9rem; position: sticky; top: 0; z-index: 10;
  background: rgba(18,16,24,0.9); backdrop-filter: blur(12px);
}
.bar-title { margin: 0; font-size: 1.1rem; font-weight: 700; }
.seg { display: flex; gap: 0.15rem; background: var(--bg3); border-radius: 999px; padding: 0.2rem; }
.seg-btn {
  border: 0; background: transparent; color: var(--muted);
  padding: 0.45rem 0.75rem; border-radius: 999px; font-weight: 600; font-size: 0.82rem; cursor: pointer;
}
.seg-btn.active { background: #2d2538; color: var(--ink); }
.wallet { display: flex; gap: 0.4rem; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: #2a2234; border: 1px solid var(--line);
  border-radius: 999px; padding: 0.28rem 0.5rem; font-size: 0.78rem;
}
.pill.sm { padding: 0.2rem 0.4rem; font-size: 0.72rem; }
.pill.energy { color: var(--energy); }
.pill.coins { color: #ffd89a; }
.plus {
  border: 0; width: 18px; height: 18px; border-radius: 50%;
  background: var(--pink); color: white; font-weight: 700; line-height: 1; cursor: pointer; margin-left: 0.15rem;
}
.toolbar { display: flex; justify-content: flex-start; align-items: center; padding: 0.2rem 0.9rem 0.5rem; }
.filters { display: flex; gap: 0.35rem; background: var(--bg3); padding: 0.2rem; border-radius: 999px; }
.chip {
  border: 0; background: transparent; color: var(--muted);
  padding: 0.4rem 0.75rem; border-radius: 999px; font-weight: 600; font-size: 0.8rem; cursor: pointer;
}
.chip.active { background: #332a42; color: var(--ink); }
.tools { display: flex; gap: 0.35rem; }
.icon {
  width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg3); color: var(--ink); cursor: pointer; font-size: 1rem;
}
.bell { position: relative; }
.bell::after {
  content: ""; position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; background: var(--pink); border-radius: 50%;
}
.intro { padding: 0.4rem 1rem 0.9rem; }
.intro h2 { margin: 0 0 0.35rem; font-size: 1.15rem; font-weight: 700; }
.intro p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.4; }

.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem;
  padding: 0 0.85rem 5.5rem;
}
.card {
  position: relative; aspect-ratio: 3/4.2; border-radius: 16px; overflow: hidden;
  background: var(--card); cursor: pointer; border: 1px solid var(--line);
  animation: up .35s ease both;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem 0.65rem 0.65rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex; justify-content: space-between; align-items: flex-end; gap: 0.3rem;
}
.card .meta .nm { font-weight: 700; font-size: 0.92rem; }
.card .likes { font-size: 0.72rem; color: #f0d7e6; display: flex; align-items: center; gap: 0.2rem; }

.fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  z-index: 25; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--pink), #ff4f9a);
  color: white; font-weight: 700; font-size: 0.95rem;
  padding: 0.95rem 1.5rem; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(232,74,138,0.35);
  min-height: 48px;
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 0.45rem 1.5rem env(safe-area-inset-bottom);
  display: flex; justify-content: space-around; align-items: flex-start;
  background: rgba(16,14,22,0.94); border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}
.nav-btn {
  width: 48px; height: 40px; border: 0; border-radius: 14px;
  background: transparent; color: var(--muted); font-size: 1.25rem; cursor: pointer;
}
.nav-btn.active { color: var(--ink); background: rgba(232,74,138,0.15); outline: 1px solid rgba(232,74,138,0.35); }

/* profile */
.hero { position: relative; height: 52vh; min-height: 280px; background: #000; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.close-x {
  position: absolute; top: 0.7rem; right: 0.7rem;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,0.45); color: white; cursor: pointer;
}
.hook-pill {
  position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.9rem;
  background: rgba(40,20,40,0.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12); color: #f7d6e8;
  border-radius: 999px; padding: 0.55rem 0.85rem; font-size: 0.78rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prof-body { padding: 1rem 1rem 5rem; background: var(--bg); border-radius: 20px 20px 0 0; margin-top: -16px; position: relative; z-index: 4; }
.prof-body h1 { margin: 0; font-size: 1.55rem; }
.prof-body .sub { margin: 0.2rem 0 0.9rem; color: var(--muted); }
.row-btns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0.55rem; margin-bottom: 0.9rem; position: relative; z-index: 5; }
.btn {
  border: 0; border-radius: 14px; padding: 0.95rem 0.9rem;
  font-weight: 700; font-size: 0.9rem; cursor: pointer; font-family: inherit;
  min-height: 48px;
}
.btn.pink { background: linear-gradient(135deg, var(--pink), #ff5a9c); color: white; }
.btn.dark { background: #2a2434; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.wide { width: 100%; margin-top: 0.55rem; }
.bio { color: #d9d0e4; font-size: 0.9rem; line-height: 1.45; margin: 0; }
.bio.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link { border: 0; background: none; color: var(--pink2); font-weight: 600; padding: 0.35rem 0; cursor: pointer; }
.tabs-h {
  display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.8rem 0 0.5rem;
  scrollbar-width: none;
}
.tabs-h::-webkit-scrollbar { display: none; }
.tab-h {
  flex: 0 0 auto; border: 0; border-radius: 999px; padding: 0.55rem 0.9rem;
  background: transparent; color: var(--muted); font-weight: 600; cursor: pointer;
}
.tab-h.active { background: #2c2538; color: var(--ink); }
.prof-panel { padding-top: 0.4rem; }
.gal {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem;
}
.gal img, .gal .ph {
  aspect-ratio: 3/4; width: 100%; object-fit: cover; border-radius: 12px; background: var(--bg3);
  cursor: zoom-in; pointer-events: auto;
}
.gal img:active { opacity: 0.85; }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.lightbox img {
  max-width: 100%; max-height: 88dvh; object-fit: contain;
  border-radius: 12px; user-select: none;
}
.lightbox-close, .lightbox-nav {
  position: absolute; border: 0; background: rgba(255,255,255,0.12);
  color: white; width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.4rem; cursor: pointer; z-index: 101;
}
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-nav.prev { left: 0.6rem; }
.lightbox-nav.next { right: 0.6rem; }
.mem-item, .sc-item {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.8rem 0.9rem; margin-bottom: 0.5rem; font-size: 0.9rem;
}
.sc-item h4 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.sc-item p { margin: 0; color: var(--muted); font-size: 0.84rem; }

/* chats list */
.mode-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
  margin: 0.2rem 0.9rem 0.6rem; background: var(--bg3); padding: 0.25rem; border-radius: 14px;
}
.mode {
  border: 0; border-radius: 12px; padding: 0.7rem; background: transparent;
  color: var(--muted); font-weight: 700; cursor: pointer;
}
.mode.active { background: #322842; color: var(--ink); }
.chat-tabs { display: flex; gap: 1rem; padding: 0 1rem 0.4rem; border-bottom: 1px solid var(--line); }
.ctab { border: 0; background: none; color: var(--muted); font-weight: 700; padding: 0.55rem 0; cursor: pointer; }
.ctab.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--pink); }
.chat-list { padding: 0.4rem 0 5rem; }
.chat-row {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.75rem 1rem; cursor: pointer;
}
.chat-row:active { background: rgba(255,255,255,0.03); }
.chat-row img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.chat-row .t { font-weight: 700; display: flex; align-items: center; gap: 0.35rem; }
.chat-row .preview { color: var(--muted); font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58vw; }
.chat-row .time { color: var(--muted); font-size: 0.72rem; margin-left: auto; align-self: flex-start; }

/* chat room */
.chat-view {
  display: flex; flex-direction: column;
  height: 100dvh; max-height: 100dvh;
  padding-bottom: 0; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--line);
  background: rgba(18,16,24,0.98); flex: 0 0 auto; z-index: 5;
}
.chat-persona {
  display: flex; align-items: center; gap: 0.5rem;
  flex: 1 1 auto; min-width: 0;
  border: 0; background: transparent; color: inherit;
  padding: 0.15rem 0.25rem; margin: 0; text-align: left;
  border-radius: 12px; cursor: pointer;
}
.chat-persona:active { background: rgba(255,255,255,0.06); }
.chat-head .av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.chat-head .name { font-weight: 700; font-size: 0.95rem; }
.chat-head .chat-reset {
  font-size: 1.05rem;
  opacity: 0.85;
  flex: 0 0 auto;
}
.chat-head .chat-reset.armed {
  color: #ff8fab;
  opacity: 1;
}
.chat-head .pill { flex: 0 0 auto; }
.messages {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 0.9rem 0.85rem 0.75rem;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.msg-row {
  display: flex; flex-direction: column; gap: 0.35rem;
  max-width: min(88%, 34rem);
  width: fit-content;
}
.msg-row.anim {
  animation: up .18s ease both;
}
.msg-row.assistant { align-self: flex-start; align-items: stretch; }
.msg-row.user { align-self: flex-end; align-items: stretch; }
.bubble {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.bubble.assistant {
  background: #262033;
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border-radius: 4px 16px 16px 16px;
}
.bubble.assistant .mini {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; object-position: top;
  flex: 0 0 28px; margin-top: 0.1rem;
}
.bubble-body {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.bubble.user {
  background: #3a2a55;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink);
  border-radius: 16px 4px 16px 16px;
}
.bubble img:not(.mini), .bubble video {
  max-width: 100%; width: 100%;
  border-radius: 12px; margin-top: 0.45rem; display: block;
}
.media-miss {
  margin-top: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: #c9c2d8;
  font-size: 0.85rem;
}

.msg-actions {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  padding: 0 0.15rem 0.1rem 2.5rem;
  position: relative;
  align-self: flex-start;
}
.msg-act {
  border: 1px solid var(--line);
  background: #1c1724;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.msg-act.armed, .composer-ico.armed, .btn.armed {
  color: var(--ink);
  border-color: rgba(232,74,138,0.55);
  background: rgba(232,74,138,0.18);
}
.arm-hint {
  position: absolute;
  left: 2.2rem;
  top: calc(100% + 2px);
  font-size: 0.72rem;
  color: var(--pink2);
  white-space: nowrap;
  z-index: 3;
}

.composer-wrap {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: #16131d;
  padding: 0.55rem 0.65rem calc(0.65rem + env(safe-area-inset-bottom));
}
.composer {
  display: flex; align-items: center; gap: 0.45rem;
  background: #241e30; border: 1px solid var(--line);
  border-radius: 22px; padding: 0.25rem 0.3rem 0.25rem 0.85rem;
}
.composer input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  padding: 0.7rem 0.2rem; font: inherit; outline: none;
}
.composer-tools {
  display: flex; align-items: center; gap: 0.05rem; flex: 0 0 auto;
  position: relative;
}
.composer-ico, .send {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer;
  display: grid; place-items: center; flex: 0 0 auto;
}
.composer-tools .arm-hint {
  left: 0; right: 0; top: auto; bottom: calc(100% + 6px);
  text-align: center; background: #2c2238; border: 1px solid var(--line);
  border-radius: 10px; padding: 0.25rem 0.5rem; white-space: nowrap;
}
.send { background: var(--pink); color: white; margin-left: 0.1rem; }

.gate-wrap { padding: 4rem 1.4rem 2rem; }
.logo { color: var(--pink2); font-weight: 800; letter-spacing: 0.04em; margin-bottom: 0.6rem; }
.account-card {
  margin: 1rem; padding: 1rem; border-radius: 16px; background: var(--bg3); border: 1px solid var(--line); line-height: 1.5;
}
.toast {
  position: fixed; left: 50%; bottom: 5.8rem; transform: translateX(-50%);
  background: #2c2238; color: var(--ink); padding: 0.65rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); z-index: 50; max-width: 90vw; font-size: 0.85rem;
}
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

.create-form {
  padding: 0.8rem 1rem 5rem; display: flex; flex-direction: column; gap: 0.85rem;
}
.create-form label {
  display: flex; flex-direction: column; gap: 0.35rem;
  font-size: 0.85rem; color: var(--muted); font-weight: 600;
}
.create-form input, .create-form textarea {
  border: 1px solid var(--line); background: #221c2c; color: var(--ink);
  border-radius: 14px; padding: 0.8rem 0.9rem; font: inherit; outline: none;
}
.create-form .hint { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.style-pick p { margin: 0 0 0.4rem; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.card .badge-mine {
  position: absolute; top: 0.55rem; left: 0.55rem;
  background: rgba(232,74,138,0.9); color: white; font-size: 0.65rem;
  font-weight: 700; padding: 0.2rem 0.45rem; border-radius: 999px;
}
.card .badge-style {
  position: absolute; top: 0.55rem; right: 0.55rem;
  background: rgba(0,0,0,0.55); color: #f0d7e6; font-size: 0.65rem;
  font-weight: 700; padding: 0.2rem 0.45rem; border-radius: 999px;
}
.card .badge-pub {
  position: absolute; top: 0.55rem; left: 0.55rem;
  background: rgba(107,78,255,0.9); color: white; font-size: 0.65rem;
  font-weight: 700; padding: 0.2rem 0.45rem; border-radius: 999px;
}
.check-row {
  display: flex !important; flex-direction: row !important; align-items: center; gap: 0.55rem;
  color: var(--ink) !important; font-weight: 500 !important;
}
.check-row input { width: 18px; height: 18px; }
.gal-vid {
  position: relative; border-radius: 12px; overflow: hidden; background: #000; cursor: pointer;
}
.gal-vid video { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 120px; }
.gal-tag {
  position: absolute; left: 0.4rem; bottom: 0.4rem;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 0.65rem;
  padding: 0.15rem 0.4rem; border-radius: 999px; font-weight: 700;
}
.mem-block { margin-bottom: 0.85rem; }
.mem-h { font-size: 0.78rem; color: var(--pink2); font-weight: 700; margin-bottom: 0.35rem; }
.mod-box {
  margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line);
}
.mod-box h3 { margin: 0 0 0.6rem; font-size: 0.95rem; }
.mod-row {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--line);
}
.mod-row img {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover; object-position: top;
}
.mod-row .btn { padding: 0.45rem 0.65rem; font-size: 0.8rem; min-height: 36px; }
.prof-story {
  background: #1c1726; border: 1px solid var(--line);
  border-radius: 16px; padding: 0.85rem; margin-bottom: 0.65rem;
}
.prof-story-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
}
.prof-story-top h4 { margin: 0; font-size: 0.98rem; }
.prof-story p { margin: 0.35rem 0 0.45rem; color: var(--muted); font-size: 0.84rem; line-height: 1.35; }

@keyframes up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .msg-row.anim, .card, .idea-card { animation: none !important; }
}

body.chat-open #bottomNav,
body.chat-open .fab,
body.profile-open #bottomNav,
body.profile-open .fab {
  display: none !important;
  pointer-events: none !important;
}
body.chat-open #app { padding-bottom: 0; }

/* stories */
.story-list {
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 0 0.85rem 5.5rem;
}
.story-card {
  display: grid; grid-template-columns: 88px 1fr; gap: 0.75rem;
  padding: 0.75rem; border-radius: 16px; border: 1px solid var(--line);
  background: var(--bg3); cursor: pointer; animation: up .35s ease both;
  overflow: hidden; position: relative;
}
.story-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0.18; pointer-events: none;
  background: linear-gradient(135deg, #e84a8a 0%, transparent 55%);
}
.story-card.mood-cream::before { background: linear-gradient(135deg, #c4a574 0%, transparent 55%); }
.story-card.mood-steel::before { background: linear-gradient(135deg, #6a7b8f 0%, transparent 55%); }
.story-card.mood-ember::before { background: linear-gradient(135deg, #e84a8a 0%, #ff8a4a 40%, transparent 60%); }
.story-card-av {
  position: relative; z-index: 1; width: 88px; height: 112px;
  border-radius: 12px; overflow: hidden; background: #000;
}
.story-card-av img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.story-card-body { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.story-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.story-card-top h3 { margin: 0; font-size: 0.98rem; line-height: 1.25; }
.story-sub { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.story-meta {
  display: flex; flex-wrap: wrap; gap: 0.45rem 0.7rem;
  color: #d8cce4; font-size: 0.72rem; font-weight: 600;
}
.story-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.stag {
  font-size: 0.68rem; color: #f0d7e6; background: rgba(255,255,255,0.06);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.45rem;
}
.story-badge {
  flex: 0 0 auto; font-size: 0.65rem; font-weight: 700;
  border-radius: 999px; padding: 0.2rem 0.5rem; white-space: nowrap;
}
.story-badge.new { background: rgba(232,74,138,0.2); color: #ff9ec4; }
.story-badge.cont { background: rgba(255,209,102,0.18); color: #ffd166; }
.story-badge.done { background: rgba(120,200,140,0.18); color: #9be3ad; }

.story-view {
  display: flex; flex-direction: column; height: 100dvh; max-height: 100dvh; overflow: hidden;
}
.story-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 1rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 1rem;
}
.story-text {
  background: var(--bg3); border: 1px solid var(--line);
  border-radius: 16px; padding: 1rem 1.05rem;
  line-height: 1.55; font-size: 0.95rem; white-space: normal;
  animation: up .3s ease both;
}
.story-choices { display: flex; flex-direction: column; gap: 0.55rem; }
.story-choice {
  width: 100%; text-align: left; border: 1px solid rgba(232,74,138,0.35);
  background: #241e30; color: var(--ink); border-radius: 14px;
  padding: 0.9rem 1rem; font: inherit; font-weight: 600; font-size: 0.9rem;
  line-height: 1.35; cursor: pointer;
}
.story-choice:active { background: #2e253a; }
.story-end { display: flex; flex-direction: column; gap: 0.55rem; }
.story-end .btn.wide { width: 100%; }
.story-done-label {
  margin: 0.2rem 0 0.1rem; text-align: center;
  color: var(--pink2); font-weight: 700; font-size: 0.9rem;
}
.story-ending {
  margin: 0; padding: 0.85rem 1rem; border-radius: 14px;
  background: rgba(232,74,138,0.12); border: 1px solid rgba(232,74,138,0.28);
  line-height: 1.45; font-size: 0.9rem;
}
.btn.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
}

.prof-body { position: relative; z-index: 4; }
.tabs-h, .prof-panel { position: relative; z-index: 4; }
.close-x { z-index: 6; }
.icon { min-width: 44px; min-height: 44px; }

/* ===== create wizard ===== */
.wiz { padding: 0 0 5rem; }
.wiz-panel { padding: 0.6rem 0.9rem 1rem; }
.wiz-hero {
  background: #1c1726;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.1rem 1rem 1rem;
  margin-bottom: 0.85rem;
}
.wiz-hero h2 { margin: 0 0 0.45rem; font-size: 1.2rem; line-height: 1.25; }
.wiz-hero p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.wiz-hero .btn { margin-right: 0.55rem; }
.wiz-free { color: var(--muted); font-size: 0.78rem; }
.style-tiles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem;
  margin-bottom: 1.1rem;
}
.style-tile, .look-tile, .face-tile {
  position: relative; border: 2px solid transparent; border-radius: 16px;
  overflow: hidden; padding: 0; background: #16121e; cursor: pointer;
  text-align: left; color: var(--ink);
}
.style-tile img, .look-tile img, .face-tile img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top; display: block;
}
.style-tile.active, .look-tile.active, .face-tile.active {
  border-color: var(--pink);
}
.st-check {
  position: absolute; left: 0.45rem; bottom: 0.45rem;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--pink); color: #fff; font-size: 0.75rem; font-weight: 800;
  display: none; place-items: center;
}
.style-tile.active .st-check,
.look-tile.active .st-check,
.face-tile.active .st-check { display: grid; }
.st-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.4rem 0.55rem 0.55rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.82));
}
.st-meta b { display: block; font-size: 0.9rem; }
.st-meta small { color: #d8cce4; font-size: 0.72rem; }
.ideas-block h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.idea-row {
  display: flex; gap: 0.65rem; overflow-x: auto; padding: 0.55rem 0 0.2rem;
  -webkit-overflow-scrolling: touch;
}
.idea-card {
  flex: 0 0 120px; border: 0; padding: 0; background: transparent;
  color: var(--ink); cursor: pointer; text-align: left;
}
.idea-card img {
  width: 120px; height: 150px; object-fit: cover; object-position: top;
  border-radius: 14px; display: block; border: 1px solid var(--line);
}
.idea-card span {
  display: block; margin-top: 0.35rem; font-size: 0.78rem; font-weight: 600;
}
.wiz-card {
  background: #1c1726; border: 1px solid var(--line);
  border-radius: 20px; padding: 1rem;
}
.wiz-step { color: #c9b4ff; font-size: 0.78rem; font-weight: 700; margin-bottom: 0.2rem; }
.wiz-card h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.wiz-card label {
  display: flex; flex-direction: column; gap: 0.3rem;
  margin-top: 0.75rem; font-size: 0.82rem; color: var(--muted); font-weight: 600;
}
.wiz-card input, .wiz-card textarea {
  border: 1px solid var(--line); background: #221c2c; color: var(--ink);
  border-radius: 14px; padding: 0.75rem 0.85rem; font: inherit; outline: none;
}
.tile-grid, .face-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem;
  margin: 0.75rem 0 0.2rem;
}
.look-lab {
  position: absolute; left: 0.45rem; right: 0.45rem; bottom: 0.4rem;
  font-size: 0.75rem; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.look-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.5rem 0.55rem 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.88));
}
.look-meta b { display: block; font-size: 0.82rem; line-height: 1.2; }
.look-meta small { display: block; margin-top: 0.15rem; color: #d5cce2; font-size: 0.7rem; }
.appear-hint {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
}
.wiz-card .opt { font-weight: 500; opacity: 0.75; }
.tag-block { margin-top: 0.85rem; }
.tag-h { font-size: 0.78rem; color: var(--muted); font-weight: 700; margin-bottom: 0.4rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  border: 1px solid var(--line); background: #241e30; color: var(--muted);
  border-radius: 999px; padding: 0.45rem 0.75rem; font: inherit;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.tag.active {
  color: var(--ink); border-color: rgba(232,74,138,0.7);
  background: rgba(232,74,138,0.18);
}
.wiz-nav {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; align-items: center;
}
.wiz-nav .btn.wide { flex: 1 1 100%; }
.final-av-wrap {
  position: relative; border-radius: 16px; overflow: hidden;
  margin: 0.75rem 0; border: 1px solid var(--line);
}
.final-av-wrap img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top; display: block;
}
.final-greet {
  position: absolute; left: 0.7rem; right: 0.7rem; bottom: 0.7rem;
  background: rgba(20,16,28,0.78); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; padding: 0.55rem 0.8rem; font-size: 0.82rem;
  line-height: 1.3;
}
