:root {
  color-scheme: dark;
  --bg: #0c0911;
  --surface: #16111e;
  --surface-2: #20182b;
  --panel: #271d33;
  --rule: rgba(255, 255, 255, 0.1);
  --rule-strong: rgba(255, 130, 155, 0.35);
  --text: #faf6fb;
  --muted: #b4a5be;
  --peach: #ff6b8b;
  --peach-2: #ff9c6e;
  --grad: linear-gradient(135deg, #ff5e84 0%, #ff9966 100%);
  --green: #38e296;
  --tg-safe-top: env(safe-area-inset-top, 0px);
  --tg-safe-bottom: env(safe-area-inset-bottom, 0px);
  --sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  font: 15px/1.45 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle 680px at 88% -8%, rgba(255, 94, 132, 0.17), transparent 65%),
    radial-gradient(circle 540px at 10% 10%, rgba(164, 88, 255, 0.13), transparent 65%),
    var(--bg);
  padding-bottom: calc(76px + var(--tg-safe-bottom));
}
button, input, select, textarea, a { font: inherit; }
button, select, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; -webkit-appearance: none; }
button:disabled { cursor: default; opacity: 0.55; }
a { color: inherit; }
:where(button, a, select, input, textarea):focus-visible { outline: 2px solid var(--peach); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }

/* Header */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(12, 9, 17, 0.84);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rule);
  padding: var(--tg-safe-top) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
}
.mast-inner, main { width: min(1240px, 100%); margin: 0 auto; }
.mast-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 62px;
}
.signature {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.42rem;
  letter-spacing: -0.04em;
}
.brand-orb {
  width: 28px;
  height: 28px;
  border-radius: 10px 10px 10px 3px;
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(255, 94, 132, 0.45);
}
.brand-dot { color: var(--peach); }
.desktop-nav { display: flex; align-items: center; gap: 4px; }
.tab {
  min-height: 38px;
  padding: 6px 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tab[aria-pressed=true] { color: #fff; background: rgba(255, 107, 139, 0.2); box-shadow: inset 0 0 0 1px rgba(255, 107, 139, 0.42); }
.tab span {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
}
.mast-actions { display: flex; align-items: center; gap: 8px; }
.wallet-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 156, 110, 0.35);
  background: rgba(255, 107, 139, 0.12);
  font-size: 0.86rem;
  font-weight: 700;
}
.wallet-pill:hover { background: rgba(255, 107, 139, 0.22); }
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(56, 226, 150, 0.22);
  animation: pulse-ring 1.8s infinite;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 3px rgba(56, 226, 150, 0.22); }
  50% { box-shadow: 0 0 0 6px rgba(56, 226, 150, 0.06); }
}
.create-character {
  background: var(--grad);
  color: #170912;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 38px;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(255, 94, 132, 0.32);
}
.create-character:hover { filter: brightness(1.08); }

/* Main area */
main { width: min(1240px, calc(100% - 36px)); }

/* Mobile subtabs for Officiels / Communauté / Mes persos */
.mobile-subtabs { display: none; }

/* Stories strip (Rencontres en ligne) */
.stories-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 2px 6px;
  scrollbar-width: none;
}
.stories-strip::-webkit-scrollbar { display: none; }
.story-item {
  flex: 0 0 auto;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  text-align: center;
}
.story-ring {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 2.5px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(255, 94, 132, 0.3);
  transition: transform 0.16s ease;
}
.story-item:hover .story-ring { transform: scale(1.06); }
.story-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  border: 2px solid var(--bg);
  display: block;
}
.story-ring img.blurred { filter: blur(6px) brightness(0.75); }
.story-ring::after {
  content: '';
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
}
.story-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #e8dce8;
  max-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 0 12px;
}
.eyebrow {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--peach-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.runtime-badge:empty { display: none; }
.runtime-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 226, 150, 0.12);
  border: 1px solid rgba(56, 226, 150, 0.35);
  color: #8bf2c2;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-transform: none;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }

.search-tools { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.search {
  min-width: 0;
  width: min(240px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.search:focus-within { border-color: var(--peach); }
.search-icon {
  width: 12px;
  height: 12px;
  position: relative;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  flex-shrink: 0;
}
.search-icon::after { content: ''; position: absolute; right: -4px; bottom: -2px; width: 5px; height: 1.5px; background: var(--muted); transform: rotate(45deg); }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 0.84rem; }
.search input::placeholder { color: var(--muted); }
.sort-select, .filter-toggle, .surprise-btn, .mature-toggle {
  min-height: 38px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.surprise-btn:hover, .mature-toggle:hover, .filter-toggle:hover { border-color: var(--peach); }
.surprise-btn { background: rgba(255, 156, 110, 0.14); border-color: rgba(255, 156, 110, 0.35); color: #ffd9c2; }
.mature-toggle[aria-pressed=true] { background: rgba(255, 70, 120, 0.22); border-color: var(--peach); color: #ffd4df; }
.filter-toggle { display: inline-flex; align-items: center; gap: 6px; }
.filter-toggle[aria-expanded=true] { border-color: var(--peach); background: rgba(255, 107, 139, 0.14); }
#filter-count:empty { display: none; }
#filter-count { color: var(--peach); font-weight: 800; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 6px; }
.universes { padding: 0; border: 0; margin: 0; min-width: 0; max-width: 100%; }
.universes legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#universe-choices { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
#universe-choices::-webkit-scrollbar { display: none; }
#universe-choices label { position: relative; flex: 0 0 auto; }
#universe-choices span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--rule);
  transition: all 0.15s;
}
#universe-choices input:checked + span {
  background: var(--grad);
  border-color: transparent;
  color: #170912;
  font-weight: 800;
}
#universe-choices input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.advanced-filters { order: 2; width: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.filter select {
  min-height: 36px;
  padding: 6px 26px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
}
.reset-filters {
  border: 0;
  background: none;
  color: var(--peach-2);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  padding: 4px 8px;
}

.catalog-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.catalog-meta::after { content: ''; height: 1px; background: var(--rule); flex: 1; }

/* Full-bleed Immersive Character Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 14px;
}
.card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 3 / 4.35;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    border-color: var(--rule-strong);
    box-shadow: 0 16px 38px rgba(255, 94, 132, 0.2);
  }
  .card:hover img { transform: scale(1.03); }
}
.card-open {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: #fff;
  padding: 14px;
}
.card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  transition: transform 0.35s ease, filter 0.25s ease;
  z-index: 0;
}
.card img.blurred { filter: blur(18px) brightness(0.75); transform: scale(1.08); }
.card-open::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 7, 16, 0.25) 0%, rgba(10, 7, 16, 0.05) 38%, rgba(10, 7, 16, 0.72) 70%, rgba(10, 7, 16, 0.96) 100%);
  z-index: 1;
}
.card-top-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 52px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.card-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
  background: rgba(12, 9, 17, 0.68);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
}
.card-pill.live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.card-pill.mature { background: rgba(255, 70, 120, 0.82); border-color: transparent; }
.card-pill.active-rel { background: rgba(255, 156, 110, 0.88); color: #190812; border-color: transparent; }

.card-body { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 5px; }
.card-identity { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.card-title { font-size: 1.22rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.card-age { font-size: 0.76rem; font-weight: 600; color: rgba(255, 255, 255, 0.78); white-space: nowrap; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.card-tags span {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(6px);
  color: #fce7f3;
}
.card-hook {
  font-size: 0.8rem;
  line-height: 1.3;
  color: rgba(255, 244, 248, 0.88);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.card-stats { font-size: 0.72rem; font-weight: 600; color: rgba(255, 255, 255, 0.76); }
.card-chat-cta {
  padding: 5px 11px;
  border-radius: 999px;
  border: 0;
  background: var(--grad);
  color: #170912;
  font-size: 0.74rem;
  font-weight: 800;
}

.fav, .close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(12, 9, 17, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
}
.fav[aria-pressed=true] { background: var(--peach); color: #170912; border-color: transparent; }
.close { left: 12px; right: auto; font-size: 1.4rem; }

/* Chats List & Shop Views */
.chats-wrap { display: grid; gap: 12px; max-width: 780px; }
.chats-search {
  width: 100%;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
}
.chats-search:focus { border-color: var(--peach); outline: none; }
.chats-list { display: grid; gap: 10px; }
.chat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.chat-row:hover { border-color: var(--rule-strong); background: var(--surface-2); transform: translateY(-1px); }
.chat-row img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; object-position: center 15%; flex-shrink: 0; border: 2px solid var(--peach); }
.chat-row-body { flex: 1; min-width: 0; }
.chat-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-row-top strong { font-size: 1rem; font-weight: 700; }
.chat-row-time { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.chat-row-msg { margin: 3px 0 6px; font-size: 0.84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-foot { display: flex; align-items: center; gap: 10px; font-size: 0.73rem; color: var(--peach-2); font-weight: 600; }
.chat-row-bar { flex: 1; max-width: 120px; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.chat-row-bar-fill { height: 100%; background: var(--grad); border-radius: 999px; }

.shop-view { display: grid; gap: 22px; }
.shop-status-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.stat-tile {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
}
.stat-tile span { display: block; font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.stat-tile strong { display: block; font-size: 1.25rem; font-weight: 800; margin-top: 3px; }
.checkin-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 94, 132, 0.18), rgba(255, 156, 110, 0.1));
  border: 1px solid rgba(255, 107, 139, 0.35);
}
.checkin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.checkin-card h2 { margin: 0 0 3px; font-size: 1.15rem; }
.checkin-card p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.checkin-btn { width: auto; }
.streak-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.streak-day {
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(12, 9, 17, 0.45);
  border: 1px solid var(--rule);
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}
.streak-day strong { display: block; font-size: 0.82rem; color: #fff; }
.streak-day.done { background: rgba(56, 226, 150, 0.18); border-color: rgba(56, 226, 150, 0.45); color: #8bf2c2; }
.streak-day.today { border-color: var(--peach); box-shadow: 0 0 12px rgba(255, 94, 132, 0.25); }

.shop-heading { margin: 0; font-size: 1.25rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tier-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
}
.tier-card.featured { border-color: var(--peach); background: linear-gradient(180deg, rgba(255, 94, 132, 0.12), var(--surface)); box-shadow: 0 10px 30px rgba(255, 94, 132, 0.14); }
.tier-badge { align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; background: var(--grad); color: #170912; }
.tier-card h3 { margin: 0; font-size: 1.35rem; }
.tier-price { font-size: 1.5rem; font-weight: 800; }
.tier-stars { font-size: 0.82rem; color: var(--muted); }
.tier-perks { margin: 4px 0 12px; padding-left: 18px; color: #e8dce8; font-size: 0.86rem; display: grid; gap: 6px; flex: 1; }
.packs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.pack-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  text-align: center;
}
.pack-card.popular { border-color: var(--peach-2); }
.pack-amount { font-size: 1.25rem; font-weight: 800; }
.pack-bonus { font-size: 0.72rem; font-weight: 700; color: var(--green); min-height: 16px; }
.pack-price { font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
.pack-buy { margin-top: auto; }

/* States, Buttons & Footer */
.state { padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--rule); border-radius: 18px; background: rgba(255, 255, 255, 0.02); }
.state p { margin: 0; }
.small-btn {
  min-height: 40px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 8px 18px;
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.85rem;
}
.small-btn:hover { border-color: var(--peach); }
.more { display: block; margin: 22px auto 0; }
footer {
  margin-top: 34px;
  padding: 18px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--rule);
}
footer span:first-child { font-weight: 800; font-size: 1.15rem; color: var(--text); }

/* Detail Dialog */
dialog {
  background: var(--surface);
  color: var(--text);
  width: min(460px, calc(100% - 24px));
  max-height: min(92dvh, 860px);
  border: 1px solid var(--rule-strong);
  border-radius: 22px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(6, 4, 10, 0.78); backdrop-filter: blur(6px); }
body:has(dialog[open]), body.chat-open { overflow: hidden; }
#detail-scroll { overflow: auto; overscroll-behavior: contain; }
.cover { height: clamp(260px, 50dvh, 460px); position: relative; overflow: hidden; background: var(--bg); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.portrait-gate { height: 100%; background: radial-gradient(circle, #351f37, var(--bg)); }
.portrait-gate summary {
  position: absolute; z-index: 2; bottom: 50%; left: 50%; transform: translate(-50%, 50%);
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--peach);
  background: rgba(12, 9, 17, 0.88); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.portrait-gate summary::-webkit-details-marker { display: none; }
.portrait-gate[open] summary { bottom: 12px; transform: translateX(-50%); }
.portrait-gate:not([open]) .when-open, .portrait-gate[open] .when-closed { display: none; }
.detail-content { padding: 18px 22px 16px; }
.detail-content h2 { margin: 4px 0 8px; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.detail-content h3 { margin: 16px 0 4px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--peach-2); }
.detail-content p { margin: 0; font-size: 0.92rem; line-height: 1.5; color: #e2d6ea; }
.detail-content .detail-hook { margin: 0 0 12px; font-size: 1rem; font-weight: 600; color: #ffd4df; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags span { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--rule); color: #f1dff2; }
#detail-actions { display: grid; gap: 8px; padding: 14px 20px max(16px, var(--tg-safe-bottom)); border-top: 1px solid var(--rule); flex: 0 0 auto; }
.detail-action-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.share-btn {
  min-width: 44px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface-2);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
.share-btn:hover { border-color: var(--peach); }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 0;
  background: var(--grad);
  color: #170912;
  font-weight: 800;
  font-size: 0.94rem;
  text-decoration: none;
}
.primary:hover { filter: brightness(1.06); }
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}
.secondary-link:hover { color: #fff; border-color: var(--peach); }
.permalink, .catalog-link { display: inline-flex; align-items: center; margin-top: 12px; color: var(--muted); font-size: 0.8rem; }
.creation-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 0.84rem; }
.creation-status button { border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 6px 12px; font-weight: 600; }

/* Bottom Nav (mobile) */
.bottom-nav { display: none; }
#notice {
  position: fixed;
  bottom: calc(84px + var(--tg-safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff1f5;
  color: #1c0b16;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
#notice:empty { display: none; }

/* SSR fallback profile page */
.server-profile { width: min(460px, calc(100% - 32px)); margin: 22px auto; }
.server-cover { border-radius: 18px; }
body:has(#server-profile) > main, body:has(#server-profile) .desktop-nav { display: none; }

@media (max-width: 780px) {
  .desktop-nav { display: none; }
  main { width: calc(100% - 22px); }
  .mobile-subtabs {
    display: flex;
    gap: 6px;
    padding: 12px 0 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-subtabs::-webkit-scrollbar { display: none; }
  .subtab {
    flex: 0 0 auto;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
  }
  .subtab[aria-pressed=true] {
    background: rgba(255, 107, 139, 0.22);
    border-color: var(--peach);
    color: #fff;
  }
  .section-head { padding: 10px 0 8px; }
  .search-tools { width: 100%; }
  .search { flex: 1 1 160px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { border-radius: 15px; }
  .card-open { padding: 10px; }
  .card-title { font-size: 1.02rem; }
  .card-hook { font-size: 0.74rem; }
  .card-chat-cta { padding: 4px 9px; font-size: 0.7rem; }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(15, 11, 21, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--rule);
    padding: 6px 4px max(8px, var(--tg-safe-bottom));
  }
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 2px;
  }
  .bottom-nav button[aria-pressed=true] { color: var(--peach); }
  .bottom-nav .bnav-ico { position: relative; font-size: 1.15rem; line-height: 1.1; }
  .bnav-badge {
    position: absolute;
    top: -5px;
    right: -12px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--peach);
    color: #170912;
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 800;
    display: grid;
    place-items: center;
  }
  .bnav-dot {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
  }
  .bottom-nav .bnav-create .bnav-ico {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #170912;
    font-weight: 900;
  }
}
@media (max-width: 440px) {
  dialog { width: 100%; max-height: 94dvh; margin: auto auto 0; border-radius: 22px 22px 0 0; }
}
