:root {
  --bg: #0b0f14;
  --surface: #121821;
  --raised: #1a2130;
  --hover: #222b3b;
  --line: #263042;
  --line-soft: #1c2433;
  --text: #eef3f8;
  --muted: #93a1b5;
  --faint: #66748a;
  --accent: #2dd4bf;
  --accent-2: #818cf8;
  --grad: linear-gradient(135deg, #2dd4bf 0%, #38bdf8 45%, #818cf8 100%);
  --danger: #ff5d6c;
  --ok: #3ccf8e;
  --unread: #5b8cff;
  --radius: 14px;
  --nav-w: 244px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 18px; height: 18px; }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px; border: 0;
  font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--raised); color: var(--text); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: rgba(255, 93, 108, .12); color: var(--danger); }
.btn-danger:hover { background: rgba(255, 93, 108, .2); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--text); flex: none;
}
.icon-btn:hover { background: var(--raised); }
.icon-btn.glass { background: rgba(14,12,18,.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.link { color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.field small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 6px; }
.input, .textarea, .select {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input { height: 48px; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.select { height: 48px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239a92a8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input:focus, .textarea:focus, .select:focus { border-color: #4b5d78; box-shadow: 0 0 0 3px rgba(129,140,248, .16); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.counter { float: right; font-weight: 500; color: var(--faint); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.badge18 { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: rgba(255, 93, 108, .16); color: #ff8b95; font-size: 11px; font-weight: 800; letter-spacing: .02em; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.switch b { display: block; font-size: 14.5px; }
.switch small { color: var(--faint); font-size: 12.5px; }
.toggle { position: relative; width: 46px; height: 28px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.toggle i::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + i { background: var(--accent-2); }
.toggle input:checked + i::after { transform: translateX(18px); }

/* ---------- avatars ---------- */
.av {
  --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: calc(var(--s) * .42);
  background: var(--c, #8b5cf6); position: relative; user-select: none;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px transparent; }
.av-fallback { background: linear-gradient(145deg, color-mix(in srgb, var(--c) 100%, #fff 18%), color-mix(in srgb, var(--c) 70%, #000 30%)); }

/* ---------- auth ---------- */
.auth { position: relative; min-height: 100dvh; overflow: hidden; isolation: isolate; }
.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -10vw; top: -14vw; background: #2dd4bf; opacity: .24; }
.aurora i:nth-child(2) { width: 40vw; height: 40vw; right: -8vw; bottom: -14vw; background: #818cf8; opacity: .38; animation-duration: 26s; animation-delay: -6s; }
.aurora i:nth-child(3) { width: 26vw; height: 26vw; left: 38vw; top: 30vh; background: #38bdf8; opacity: .22; animation-duration: 30s; animation-delay: -12s; }
.aurora b { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(70% 60% at 50% 40%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 20%, transparent 75%); }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(4vw, 3vh) scale(1.08); } 100% { transform: translate(-3vw, -2vh) scale(.95); } }

.auth-grid {
  max-width: 1280px; margin: 0 auto; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(380px, .88fr); align-items: center;
  gap: clamp(40px, 6vw, 110px); padding: clamp(24px, 4vh, 40px) clamp(24px, 5vw, 72px);
}
.hero { display: flex; flex-direction: column; gap: clamp(18px, 3.2vh, 34px); min-width: 0; }
.hero .logo { font-size: 24px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); color: #e6dcf2; font-size: 13.5px; font-weight: 600; margin-bottom: clamp(12px, 2.2vh, 22px); }
.eyebrow svg { color: #5eead4; }
.hero h1 { font-size: clamp(38px, min(4.2vw, 6.6vh), 66px); line-height: 1.02; letter-spacing: -.04em; margin: 0 0 clamp(12px, 2vh, 20px); font-weight: 800; }
.grad-text { background: linear-gradient(100deg, #5eead4 0%, #38bdf8 40%, #818cf8 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: clamp(16px, 1.2vw, 18.5px); max-width: 44ch; margin: 0; line-height: 1.55; }

.demo-wrap { position: relative; width: min(460px, 100%); margin-top: 8px; }
.demo {
  position: relative; border-radius: 24px; overflow: hidden;
  background: rgba(24, 20, 31, .62); border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.06);
  animation: bob 7s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px); } }
.demo-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.demo-head div { min-width: 0; }
.demo-head b { display: block; font-size: 14.5px; }
.demo-head small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-body { height: clamp(150px, 22vh, 240px); padding: 14px 14px 6px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; transition: opacity .5s; }
.demo-body.fade { opacity: 0; }
.d-row { display: flex; align-items: flex-end; gap: 8px; animation: rise .35s cubic-bezier(.2,.8,.2,1); }
.d-row.u { justify-content: flex-end; }
.d-b { max-width: 78%; padding: 9px 13px; border-radius: 18px; font-size: 13.5px; line-height: 1.4; }
.d-row.c .d-b { background: rgba(255,255,255,.07); border-bottom-left-radius: 6px; }
.d-row.u .d-b { background: linear-gradient(135deg, #22c3b0, #818cf8); color: #fff; border-bottom-right-radius: 6px; }
.d-b em { color: #c2b8d0; }
.d-row.u .d-b em { color: rgba(255,255,255,.85); }
.d-b .typing { padding: 4px 2px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.demo-input { margin: 8px 12px 12px; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.09); display: flex; align-items: center; justify-content: space-between; padding: 0 5px 0 16px; color: var(--faint); font-size: 13.5px; }
.demo-input i { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #fff; }
.float-chip {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: rgba(30, 25, 38, .78); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px -10px rgba(0,0,0,.6); white-space: nowrap; animation: bob 6s ease-in-out infinite;
}
.float-chip b { display: block; font-size: 12.5px; }
.float-chip small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; }
.float-chip .live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(60,207,142,.2); }
.fc1 { top: -22px; right: -46px; animation-delay: -2s; }
.fc2 { bottom: -20px; right: 28px; animation-delay: -4s; }

.auth-panel { display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: 0; }
.auth-card {
  width: 100%; max-width: 440px; padding: 40px 38px; border-radius: 28px;
  background: rgba(20, 17, 26, .72); border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05);
}
.auth-card.swap > *:not(.m-logo) { animation: rise .3s ease-out; }
.auth-card h2 { font-size: 30px; letter-spacing: -.03em; margin: 0 0 6px; font-weight: 800; }
.auth-card .sub { color: var(--muted); margin: 0 0 28px; }
.auth-card .input, .auth-card .gender-grid span, .auth-card .otp input { background: rgba(10, 8, 14, .55); }
.auth-foot { text-align: center; color: var(--muted); margin-top: 22px; font-size: 14.5px; }
.auth-copy { color: var(--faint); font-size: 12.5px; }
.m-logo { display: none !important; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.logo img { width: 30px; height: 30px; }
.steps { display: flex; gap: 6px; margin-bottom: 24px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: rgba(255,255,255,.1); }
.steps i.on { background: var(--grad); }
@media (max-width: 1100px) and (min-width: 821px) {
  .fc1 { right: -10px; }
  .auth-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .aurora i, .demo, .float-chip { animation: none; } }
@media (max-height: 700px) and (min-width: 821px) { .demo-wrap { display: none; } }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 4px; top: 4px; color: var(--muted); }
.gender-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gender-grid label { position: relative; }
.gender-grid input { position: absolute; opacity: 0; }
.gender-grid span { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; text-align: center; padding: 0 8px; }
.gender-grid input:checked + span { border-color: var(--accent-2); color: var(--text); background: rgba(129,140,248, .1); }
.gender-grid input:focus-visible + span { box-shadow: 0 0 0 3px rgba(129,140,248, .3); }
.gender-grid label:last-child:nth-child(odd) { grid-column: span 2; }
.otp { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 20px; }
.otp input {
  width: 100%; max-width: 56px; height: 62px; text-align: center; font-size: 26px; font-weight: 800;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; outline: none;
}
.otp input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(129,140,248, .2); }
.devnote { background: rgba(255, 196, 87, .1); border: 1px dashed rgba(255, 196, 87, .4); color: #ffd58a; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 18px; }
.err { background: rgba(255, 93, 108, .1); color: #ff9aa3; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }

/* ---------- shell ---------- */
.shell { display: flex; height: 100dvh; background: radial-gradient(60vw 40vw at 100% -10%, rgba(129,140,248,.07), transparent 60%), radial-gradient(50vw 40vw at -10% 110%, rgba(45,212,191,.05), transparent 60%), var(--bg); }
.nav {
  width: var(--nav-w); flex: none; border-right: 1px solid var(--line-soft); padding: 22px 12px;
  display: flex; flex-direction: column; gap: 4px; background: rgba(14,12,18,.6);
}
.nav .logo { padding: 6px 12px 26px; }
.nav a, .nav button.nav-item {
  display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 12px; border-radius: 12px;
  font-weight: 600; font-size: 15.5px; color: var(--text); background: none; border: 0; width: 100%; text-align: left; position: relative;
}
.nav a:hover { background: var(--surface); }
.nav a.on { font-weight: 800; background: var(--surface); }
.nav a.on::before { content: ''; position: absolute; left: -12px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav a.on svg.i { stroke-width: 2.5; }
.nav .create-btn { margin-top: 10px; }
.nav .create-btn .btn { width: 100%; justify-content: center; background: var(--grad); color: #fff; height: 46px; }
.nav .create-btn .btn:hover { filter: brightness(1.08); background: var(--grad); }
.nav .spacer { flex: 1; }
.nav .me { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.nav .me:hover { background: var(--surface); }
.nav .me div { min-width: 0; }
.nav .me b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .me small { color: var(--muted); font-size: 12.5px; }
.dot { position: absolute; left: 28px; top: 11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }

.main { flex: 1; min-width: 0; overflow-y: auto; position: relative; }
.page { max-width: 1200px; margin: 0 auto; padding: 32px 32px 64px; }
.page-narrow { max-width: 720px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; letter-spacing: -.02em; margin: 0; }
.mobile-top { display: none; }

.tabbar { display: none; }

/* ---------- explore ---------- */
.search { position: relative; margin-bottom: 16px; }
.search svg { position: absolute; left: 14px; top: 13px; color: var(--faint); }
.search .input { padding-left: 44px; border-radius: 999px; background: var(--surface); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 24px; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cover { position: relative; overflow: hidden; background-size: cover; background-position: center; background-color: var(--raised); }
.cover-soft i, .art-soft i { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.3) brightness(.7); }
.cover-blank { background: linear-gradient(160deg, color-mix(in srgb, var(--c) 55%, #000), color-mix(in srgb, var(--c) 20%, #0b0f14)); }

/* tall character cards */
.grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card {
  position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; min-width: 0;
  background: var(--surface); border: 1px solid var(--line-soft); isolation: isolate;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: #334055; box-shadow: 0 22px 44px -18px rgba(0,0,0,.8); }
.card-art { position: absolute; inset: 0; z-index: -2; transition: transform .5s ease; }
.card:hover .card-art { transform: scale(1.04); }
.card-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,8,14,0) 30%, rgba(10,8,14,.55) 58%, rgba(10,8,14,.96) 100%); }
.card-saved { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(14,12,18,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #99f6e4; }
.card-saved svg.i { fill: currentColor; width: 15px; height: 15px; }
.card-18 { position: absolute; top: 12px; left: 12px; }
.card-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; }
.card-who { display: flex; align-items: center; gap: 9px; min-width: 0; margin-bottom: 8px; }
.card-who div { min-width: 0; }
.card-av { box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.card h3 { margin: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .by { color: rgba(255,255,255,.55); font-size: 12px; }
.card p { margin: 0 0 10px; color: #d9d1e4; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.6); font-size: 12px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg.i { width: 14px; height: 14px; }
.card-meta .priv { margin-left: auto; }

.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty .em-ico { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.empty .em-ico svg.i { width: 32px; height: 32px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 19px; }
.empty p { margin: 0 auto 20px; max-width: 34ch; }

/* ---------- character profile ---------- */
.cp { position: relative; }
.cp-banner { position: absolute; top: 0; left: 0; right: 0; height: 300px; overflow: hidden; }
.cp-banner .cover { position: absolute; inset: 0; }
.cp-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,12,18,.15) 0%, rgba(14,12,18,.55) 55%, var(--bg) 100%); }
.cp-inner { position: relative; padding-top: 170px; }
.cp-av { box-shadow: 0 0 0 5px var(--bg), 0 20px 50px -10px rgba(0,0,0,.6); }
.cprofile { text-align: center; }
.cprofile .av { margin: 0 auto 16px; }
.cprofile h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.cprofile .handle { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.cprofile .tagline { font-size: 16px; max-width: 46ch; margin: 0 auto 16px; }
.cprofile .stats { display: flex; justify-content: center; gap: 28px; margin: 18px 0 22px; color: var(--muted); font-size: 14px; }
.cprofile .stats b { color: var(--text); display: block; font-size: 17px; }
.cprofile .actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 28px; }
.cprofile .actions .btn { min-width: 140px; }
.section { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px 20px; text-align: left; margin-bottom: 14px; }
.section h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.section p { margin: 0; white-space: pre-wrap; color: #d6deea; }

/* ---------- creator ---------- */
.page-sub { margin: 6px 0 0; color: var(--muted); }
.opt { font-weight: 500; color: var(--faint); font-style: normal; }
.creator { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.creator-preview { position: sticky; top: 32px; }
.creator-preview h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 10px; }
.phone {
  border: 1px solid var(--line); border-radius: 30px; background: var(--bg) center / cover no-repeat; overflow: hidden; height: 560px;
  display: flex; flex-direction: column; position: relative; box-shadow: 0 30px 70px -30px rgba(0,0,0,.8);
}
.phone .thread-head { position: relative; z-index: 1; }
.phone .msgs { padding: 16px 12px; position: relative; z-index: 1; }

.studio-cover {
  position: relative; height: 190px; border-radius: 20px; overflow: hidden; cursor: pointer;
  border: 1.5px dashed #334055; background: radial-gradient(120% 120% at 0% 0%, rgba(45,212,191,.08), transparent 60%), radial-gradient(120% 120% at 100% 100%, rgba(129,140,248,.1), transparent 60%), var(--surface);
  display: grid; place-items: center; transition: border-color .15s, background-color .15s; outline: none;
}
.studio-cover:hover, .studio-cover:focus-visible { border-color: #4b5d78; }
.studio-cover.has { border-style: solid; border-color: var(--line); }
.studio-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio-cover.has::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 40%, rgba(0,0,0,.35)); pointer-events: none; }
.slot-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); text-align: center; padding: 0 16px; }
.slot-empty svg.i { width: 28px; height: 28px; margin-bottom: 4px; color: #cbbfe0; }
.slot-empty b { color: var(--text); font-size: 14.5px; }
.slot-empty small { font-size: 12.5px; color: var(--faint); }
.slot-actions { position: absolute; top: 12px; right: 12px; z-index: 1; display: flex; gap: 8px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(14,12,18,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-weight: 700; font-size: 13px; }
.chip-btn:hover { background: rgba(14,12,18,.8); }
.slot-busy { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(14,12,18,.55); }
.studio-row { display: flex; align-items: flex-end; gap: 18px; padding: 0 22px; margin-top: -52px; position: relative; z-index: 1; pointer-events: none; }
.studio-av {
  pointer-events: auto; position: relative; width: 112px; height: 112px; border-radius: 50%; flex: none; cursor: pointer; outline: none;
  background: var(--raised); box-shadow: 0 0 0 5px var(--bg); display: grid; place-items: center;
  background-image: linear-gradient(var(--raised), var(--raised)), var(--grad); background-origin: border-box; background-clip: padding-box, border-box; border: 2px dashed transparent;
  transition: transform .15s;
}
.studio-av:hover { transform: scale(1.03); }
.studio-av:focus-visible { box-shadow: 0 0 0 5px var(--bg), 0 0 0 8px rgba(129,140,248,.5); }
.studio-av.has { border: 0; }
.studio-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.studio-av .slot-empty svg.i { width: 30px; height: 30px; margin: 0; }
.studio-av .slot-busy { border-radius: 50%; }
.av-edit { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }
.studio-av.need { animation: shake .4s; box-shadow: 0 0 0 5px var(--bg), 0 0 0 8px rgba(255,93,108,.6); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.studio-labels { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; font-size: 13.5px; }
.studio-labels b { margin-right: 8px; }
.studio-labels .req { color: #5eead4; font-weight: 700; font-size: 12px; }
.studio-labels .opt { font-size: 12.5px; }

.vis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vis { position: relative; display: block; }
.vis input { position: absolute; opacity: 0; pointer-events: none; }
.vis-box {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 18px; cursor: pointer; height: 100%;
  background: var(--surface); border: 1.5px solid var(--line); transition: border-color .15s, background .15s, transform .1s;
}
.vis-box:hover { border-color: #3f4c62; }
.vis-box:active { transform: scale(.99); }
.vis-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--raised); display: grid; place-items: center; margin-bottom: 8px; color: var(--muted); }
.vis-box b { font-size: 15.5px; }
.vis-box small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.vis-check { position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; transition: all .15s; }
.vis-check svg.i { width: 15px; height: 15px; stroke-width: 3; }
.vis input:checked + .vis-box { border-color: #818cf8; background: linear-gradient(160deg, rgba(45,212,191,.07), rgba(129,140,248,.09)), var(--surface); }
.vis input:checked + .vis-box .vis-check { background: var(--grad); border-color: transparent; color: #fff; }
.vis input:checked + .vis-box .vis-ico { background: rgba(129,140,248,.16); color: #c7d2fe; }
.vis input:focus-visible + .vis-box { box-shadow: 0 0 0 3px rgba(129,140,248,.3); }

.avatar-pick { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.avatar-pick .av { cursor: pointer; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 48px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tag-input:focus-within { border-color: #4b5d78; box-shadow: 0 0 0 3px rgba(129,140,248, .16); }
.tag-input input { flex: 1; min-width: 100px; border: 0; background: none; outline: none; height: 30px; }
.tag-input .tag { padding-right: 4px; gap: 2px; }
.tag-input .tag button { border: 0; background: none; color: var(--faint); width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; padding: 0; }
details.adv { margin-bottom: 16px; }
details.adv summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; padding: 6px 0 14px; list-style: none; display: flex; align-items: center; gap: 6px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv[open] summary svg { transform: rotate(90deg); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* chat backgrounds */
.thread.with-bg, .phone.with-bg { background-size: cover; background-position: center; position: relative; }
.thread.with-bg::before, .phone.with-bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,12,18,.78), rgba(14,12,18,.86)); pointer-events: none; }
.thread.with-bg > * { position: relative; }
.thread.with-bg .thread-head, .phone.with-bg .thread-head { background: rgba(14,12,18,.55); }
.thread.with-bg .composer form { background: rgba(14,12,18,.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.thread.with-bg .msg.character .bubble, .phone.with-bg .msg.character .bubble { background: rgba(38,33,47,.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* ---------- chats (DMs) ---------- */
.dms { display: flex; height: 100dvh; }
.inbox { width: 380px; flex: none; border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; }
.inbox-head { padding: 26px 20px 12px; }
.inbox-head h1 { margin: 0 0 16px; font-size: 22px; letter-spacing: -.02em; display: flex; align-items: center; justify-content: space-between; }
.inbox-head .search { margin: 0; }
.inbox-head .search .input { height: 42px; border-radius: 12px; background: var(--raised); border-color: transparent; }
.inbox-head .search svg { top: 11px; }
.inbox-label { padding: 12px 20px 6px; font-weight: 700; font-size: 15px; }
.inbox-list { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.dm-row { display: flex; align-items: center; gap: 13px; padding: 10px 20px; position: relative; }
.dm-row:hover { background: var(--surface); }
.dm-row.on { background: var(--raised); }
.dm-row .av { --s: 56px; }
.dm-body { flex: 1; min-width: 0; }
.dm-name { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.dm-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-prev { color: var(--muted); font-size: 14px; display: flex; gap: 4px; min-width: 0; }
.dm-prev span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-prev span:last-child { flex: none; }
.dm-row.unread .dm-name { font-weight: 800; }
.dm-row.unread .dm-prev { color: var(--text); font-weight: 600; }
.udot { width: 9px; height: 9px; border-radius: 50%; background: var(--unread); flex: none; }
.pin-ico { color: var(--faint); }

.thread { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: transparent; }
.thread-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 12, 18, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); min-height: 70px;
}
.thread-head .who { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.thread-head .who div { min-width: 0; }
.thread-head b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 20px 20px 8px; display: flex; flex-direction: column; overscroll-behavior: contain; }
.thread-intro { text-align: center; padding: 22px 0 28px; }
.thread-intro .av { margin: 0 auto 12px; }
.thread-intro b { display: block; font-size: 19px; }
.thread-intro small { color: var(--muted); display: block; margin: 2px 0 12px; }
.ai-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #ffd58a; background: rgba(255, 196, 87, .08); border-radius: 999px; padding: 5px 11px; margin-top: 10px; }
.ts { text-align: center; color: var(--faint); font-size: 12px; font-weight: 600; margin: 16px 0 10px; }
.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; max-width: 100%; }
.msg .av { --s: 28px; visibility: hidden; }
.msg.tail .av { visibility: visible; }
.msg.user { justify-content: flex-end; }
.msg.gap { margin-top: 12px; }
.bubble {
  max-width: min(72%, 560px); padding: 9px 14px; border-radius: 22px; font-size: 15px; line-height: 1.42;
  white-space: pre-wrap; overflow-wrap: anywhere; position: relative;
}
.msg.character .bubble { background: var(--raised); border-radius: 22px 22px 22px 22px; }
.msg.character:not(.first) .bubble { border-top-left-radius: 6px; }
.msg.character:not(.tail) .bubble { border-bottom-left-radius: 6px; }
.msg.user .bubble { background: linear-gradient(135deg, #22c3b0, #818cf8); background-attachment: fixed; color: #fff; }
.msg.user:not(.first) .bubble { border-top-right-radius: 6px; }
.msg.user:not(.tail) .bubble { border-bottom-right-radius: 6px; }
.bubble em { color: #aab6c8; font-style: italic; }
.msg.user .bubble em { color: rgba(255, 255, 255, .82); }
.msg-tools { opacity: 0; transition: opacity .15s; display: flex; align-self: center; }
.msg:hover .msg-tools { opacity: 1; }
.msg-tools button { width: 30px; height: 30px; }
.msg-tools svg.i { width: 16px; height: 16px; color: var(--faint); }
.msg-tools button:hover svg.i { color: var(--text, #fff); }
.msg.character .msg-tools { order: 3; }
.msg.editing .msg-tools { display: none; }
.msg.editing .bubble { white-space: normal; width: min(72%, 560px); }
.edit-box { display: block; width: 100%; min-height: 44px; border: 0; outline: none; resize: none; background: rgba(0,0,0,.22); color: inherit; border-radius: 12px; padding: 8px 10px; font: inherit; line-height: 1.42; }
.edit-acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.edit-acts .btn-ghost { background: rgba(0,0,0,.2); color: #fff; }
.go-on { width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.06); color: var(--muted); transition: background .15s, color .15s, transform .1s; }
.go-on:hover { background: rgba(129,140,248,.18); color: #fff; }
.go-on:active { transform: scale(.94); }
.go-on:disabled { opacity: .35; pointer-events: none; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.composer { padding: 10px 16px calc(14px + var(--safe-b)); }
.composer form {
  display: flex; align-items: flex-end; gap: 6px; border: 1px solid var(--line); border-radius: 26px;
  padding: 5px 5px 5px 18px; background: var(--bg);
}
.composer form:focus-within { border-color: #3f4c62; }
.composer textarea { flex: 1; border: 0; background: none; outline: none; resize: none; padding: 9px 0; max-height: 160px; line-height: 1.4; min-height: 40px; }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; transition: opacity .15s, transform .1s; }
.send:disabled { opacity: .3; }
.send:active { transform: scale(.94); }
.thread-empty { flex: 1; display: grid; place-items: center; }

/* ---------- menus, modals, toasts ---------- */
.menu {
  position: fixed; z-index: 50; min-width: 220px; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5); animation: pop .12s ease-out;
}
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 12px; border: 0; background: none; border-radius: 9px; font-weight: 600; font-size: 14.5px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.scrim { position: fixed; inset: 0; z-index: 40; }
.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(5, 4, 8, .7); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; animation: pop .15s ease-out; max-height: 90dvh; overflow-y: auto; }
.modal h3 { margin: 0 0 8px; font-size: 19px; }
.modal p { margin: 0 0 20px; color: var(--muted); }
.modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
#toasts { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .15s ease-out; max-width: 90vw; }
.toast.bad { background: var(--danger); color: #fff; }

/* ---------- profile ---------- */
.me-head { display: flex; align-items: center; gap: 28px; margin-bottom: 28px; }
.me-head .av { --s: 112px; }
.me-head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.me-head .handle { color: var(--muted); margin-bottom: 10px; }
.me-head p { margin: 0 0 14px; white-space: pre-wrap; }
.me-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; border-bottom: 1px solid var(--line-soft); margin-bottom: 22px; }
.tabs button { flex: 1; max-width: 200px; height: 48px; border: 0; background: none; font-weight: 700; color: var(--faint); border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tabs button.on { color: var(--text); border-color: var(--text); }
.settings-list { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; }
.settings-list > * { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; font-weight: 600; }
.settings-list > *:last-child { border-bottom: 0; }
.settings-list span { color: var(--muted); font-weight: 500; }
.settings-list button:hover { background: var(--raised); }

.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- medium desktop: icon-only nav ---------- */
@media (max-width: 1240px) and (min-width: 821px) {
  :root { --nav-w: 76px; }
  .nav { align-items: center; padding: 22px 10px; }
  .nav .logo span, .nav a span, .nav .me div, .nav .create-btn span { display: none; }
  .nav .logo { padding: 6px 0 26px; }
  .nav a { width: 52px; justify-content: center; padding: 0; }
  .nav .create-btn .btn { width: 52px; padding: 0; }
  .nav .me { padding: 8px; }
  .inbox { width: 340px; }
  .creator { grid-template-columns: 1fr; }
  .creator-preview { display: none; }
}

/* ---------- phone ---------- */
@media (max-width: 820px) {
  body { font-size: 15.5px; }
  .auth-grid { grid-template-columns: 1fr; padding: calc(20px + var(--safe-t)) 16px 28px; align-items: start; gap: 0; }
  .hero { display: none; }
  .auth-panel { padding-top: 8px; }
  .auth-card { padding: 28px 22px; border-radius: 24px; max-width: none; }
  .m-logo { display: inline-flex !important; margin-bottom: 26px; }
  .aurora i:nth-child(1) { width: 90vw; height: 90vw; }
  .aurora i:nth-child(2) { width: 90vw; height: 90vw; }

  .shell { flex-direction: column; }
  .nav { display: none; }
  .main { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(14, 12, 18, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line-soft);
  }
  .tabbar a { flex: 1; display: grid; place-items: center; position: relative; color: var(--muted); }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on svg.i { stroke-width: 2.5; }
  .tabbar svg.i { width: 26px; height: 26px; }
  .tabbar .plus { width: 44px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; }
  .tabbar .plus svg.i { width: 22px; height: 22px; stroke-width: 2.4; }
  .tabbar .av { --s: 28px; font-size: 12px; }
  .tabbar a.on .av { box-shadow: 0 0 0 2px var(--text); }
  .tabbar .dot { left: auto; right: calc(50% - 22px); top: 9px; }
  .shell.in-thread .tabbar { display: none; }
  .shell.in-thread .main { padding-bottom: 0; }

  .mobile-top {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    position: sticky; top: 0; z-index: 20; padding: calc(10px + var(--safe-t)) 16px 10px; min-height: 58px;
    background: rgba(14, 12, 18, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .mobile-top h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 800; }
  .mobile-top .logo { font-size: 24px; }
  .page { padding: 8px 16px 32px; }
  .page-head { display: none; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mobile-top.overlay { position: absolute; left: 0; right: 0; top: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 5; }
  .cp-banner { height: 230px; }
  .cp-inner { padding-top: 130px; }
  .cp-av { --s: 112px !important; }
  .studio-cover { height: 150px; border-radius: 18px; }
  .studio-row { padding: 0 14px; margin-top: -44px; gap: 14px; }
  .studio-av { width: 96px; height: 96px; }
  .studio-labels { font-size: 13px; }
  .studio-labels .opt { display: block; }
  .vis-box { padding: 14px; }
  .vis-ico { width: 36px; height: 36px; }
  .card p { font-size: 13.5px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .creator { grid-template-columns: 1fr; }
  .creator-preview { display: none; }
  .form-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 18px); padding: 22px 0 12px; margin: 0 -2px; z-index: 3; }
  .form-actions .btn { flex: 1; }

  .dms { height: calc(100dvh - var(--tab-h) - var(--safe-b)); }
  .shell.in-thread .dms { height: 100dvh; }
  .inbox { width: 100%; border-right: 0; }
  .inbox-head { padding: calc(14px + var(--safe-t)) 16px 8px; }
  .inbox-label { padding: 12px 16px 6px; }
  .dm-row { padding: 9px 16px; }
  .dms.has-thread .inbox { display: none; }
  .dms:not(.has-thread) .thread { display: none; }
  .thread-head { padding: calc(8px + var(--safe-t)) 8px 8px; min-height: 60px; position: sticky; top: 0; }
  .thread-head .back { display: inline-grid; }
  .thread-head .av { --s: 36px !important; }
  .msgs { padding: 12px 12px 6px; }
  .bubble { max-width: 78%; }
  .msg-tools { display: none; }
  .msg.tools-on .msg-tools { display: flex; opacity: 1; }
  .msg.editing .bubble { width: 86%; max-width: 86%; }
  .msg { flex-wrap: wrap; }
  .msg.tools-on .msg-tools { order: 5; width: 100%; justify-content: flex-end; margin-top: 2px; }
  .msg.character.tools-on .msg-tools { justify-content: flex-start; padding-left: 36px; }
  .composer { padding: 8px 10px calc(10px + var(--safe-b)); }
  .composer textarea { font-size: 16px; } /* stops iOS zoom on focus */
  .input, .textarea, .select { font-size: 16px; }

  .me-head { gap: 18px; align-items: flex-start; }
  .me-head .av { --s: 84px; }
  .tabs button { max-width: none; }
  .cprofile .actions .btn { flex: 1; min-width: 0; }
  .menu { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(8px + var(--safe-b)); min-width: 0; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; padding-bottom: calc(24px + var(--safe-b)); max-width: none; }
  #toasts { bottom: calc(var(--tab-h) + var(--safe-b) + 14px); }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
}


/* ---------- character page: content + tall background panel ---------- */
.btn-light { background: #eef3f8; color: #121821; }
.btn-light:hover { background: #fff; }
.collect-pill.on, .collect-btn.on { background: rgba(45,212,191,.14); color: #99f6e4; box-shadow: inset 0 0 0 1px rgba(45,212,191,.35); }
.collect-pill.on svg.i, .collect-btn.on svg.i { fill: currentColor; }
.cpage { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 28vw, 440px); min-height: 100dvh; position: relative; z-index: 1; }
.cpage-main { width: 100%; max-width: 760px; margin: 0 auto; padding: 56px 32px 64px; min-width: 0; }
.cprofile { text-align: center; }
.cprofile .av { margin: 0 auto 16px; }
.cp-av { box-shadow: 0 0 0 4px var(--bg), 0 18px 40px -10px rgba(0,0,0,.6); }
.cprofile h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.cprofile .handle { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.cprofile .actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.cprofile .actions .btn { min-width: 128px; border-radius: 999px; }
.cp-tags { justify-content: center; margin-bottom: 26px; }
.intro-card, .greet-card { background: rgba(22,19,28,.78); border: 1px solid var(--line-soft); border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; position: relative; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.intro-card p { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; padding-right: 30px; white-space: pre-wrap; }
.intro-card p b { color: var(--text); }
.intro-card.open p { -webkit-line-clamp: unset; display: block; }
.intro-card [data-more-intro] { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; }
.intro-card.open [data-more-intro] svg { transform: rotate(180deg); }
.greet-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.greet-head b { font-size: 14px; }
.greet-head small { color: var(--faint); font-size: 12px; margin-left: auto; }
.greet-card p { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.greet-card p em { color: #aab6c8; }

.art-panel { position: sticky; top: 0; height: 100dvh; overflow: hidden; background: var(--surface); border-left: 1px solid var(--line-soft); isolation: isolate; }
.art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.art-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,8,14,0) 45%, rgba(10,8,14,.6) 70%, rgba(10,8,14,.95) 100%); }
.art-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px; }
.art-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.collect-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: rgba(14,12,18,.6); color: #fff; font-weight: 700; font-size: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.collect-btn:hover { background: rgba(14,12,18,.8); }
.art-name { display: inline-flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 10px; }
a.art-name:hover { text-decoration: underline; }
.art-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.art-tags span { height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); display: inline-flex; align-items: center; font-size: 12px; color: #dde6f1; text-transform: capitalize; }
.art-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.art-stats div { color: rgba(255,255,255,.55); font-size: 12px; }
.art-stats div + div { border-left: 1px solid rgba(255,255,255,.1); }
.art-stats b { display: block; color: #fff; font-size: 16px; }
.phone-bg { display: none; }
.mobile-top.clear { display: none; }

/* chat side panel */
.chat-panel { position: relative; top: auto; height: auto; width: clamp(300px, 24vw, 380px); flex: none; display: none; }
.dms.panel-open .chat-panel:not([hidden]) { display: block; }
.panel-toggle.on { background: var(--raised); }
@media (min-width: 1181px) {
  .dms.panel-open .thread.with-bg { background-image: none !important; }
  .dms.panel-open .thread.with-bg::before { display: none; }
}
@media (max-width: 1180px) {
  .chat-panel, .dms.panel-open .chat-panel:not([hidden]) { display: none; }
  .panel-toggle { display: none; }
}

/* collections row in the inbox */
.col-strip { padding: 4px 0 6px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.col-label { padding: 8px 20px 10px; font-weight: 700; font-size: 15px; }
.col-row { display: flex; gap: 14px; overflow-x: auto; padding: 0 20px 10px; scrollbar-width: none; }
.col-row::-webkit-scrollbar { display: none; }
.col-item { flex: none; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; }
.col-item .av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #38bdf8; }
.col-item:hover .av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #818cf8; }
.col-item span { font-size: 12px; color: var(--muted); max-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* creator: tall background slot beside the picture */
.studio { display: flex; gap: 22px; align-items: stretch; margin-bottom: 28px; }
.studio-bg {
  position: relative; width: 168px; aspect-ratio: 3 / 4; flex: none; border-radius: 18px; overflow: hidden; cursor: pointer; outline: none;
  border: 1.5px dashed #334055; display: grid; place-items: center;
  background: radial-gradient(120% 80% at 0% 0%, rgba(45,212,191,.08), transparent 60%), radial-gradient(120% 80% at 100% 100%, rgba(129,140,248,.1), transparent 60%), var(--surface);
}
.studio-bg:hover, .studio-bg:focus-visible { border-color: #4b5d78; }
.studio-bg.has { border-style: solid; border-color: var(--line); }
.studio-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio-bg .slot-actions { top: auto; bottom: 8px; left: 8px; right: 8px; justify-content: center; gap: 6px; }
.studio-bg .chip-btn { height: 30px; padding: 0 10px; font-size: 12px; }
.studio-side { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.studio-side .studio-av { pointer-events: auto; box-shadow: none; }
.studio-labels small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 2px; line-height: 1.4; max-width: 46ch; }
.studio-labels > div + div { margin-top: 10px; }

@media (max-width: 1100px) and (min-width: 821px) {
  .cpage { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 820px) {
  .cpage { grid-template-columns: 1fr; min-height: 0; }
  .cpage-main { padding: 0 16px 32px; }
  .art-panel:not(.chat-panel) { display: none; }
  .mobile-top.clear { display: flex; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .phone-bg { display: block; position: fixed; inset: 0; z-index: 0; background-size: cover; background-position: center; opacity: .3; pointer-events: none; }
  .phone-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,12,18,.2), rgba(14,12,18,.75) 60%, var(--bg)); }
  .mobile-top.clear, .cpage { position: relative; z-index: 1; }
  .cprofile .actions .btn { flex: 1; min-width: 0; }
  .grid { grid-template-columns: 1fr 1fr; }
  .card { aspect-ratio: 3 / 4.3; border-radius: 16px; }
  .card-info { padding: 11px; }
  .card p { font-size: 12.5px; }
  .studio { gap: 14px; }
  .studio-bg { width: 120px; border-radius: 16px; }
  .studio-bg .slot-empty small { display: none; }
  .studio-side .studio-av { width: 84px; height: 84px; }
  .studio-side { gap: 10px; }
  .studio-labels small { font-size: 12px; }
  .col-label { padding: 8px 16px 10px; }
  .col-row { padding: 0 16px 10px; }
  .thread.with-bg::before { background: linear-gradient(180deg, rgba(14,12,18,.6), rgba(14,12,18,.78)); }
}

/* =====================================================================
   v4: setup window, gender, explore filters, chat tools, Talewisp+, personas
   ===================================================================== */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.star-mark { display: inline-block; flex: none; filter: drop-shadow(0 0 6px rgba(56,189,248,.45)); }
sup { font-size: .6em; vertical-align: super; line-height: 0; }
.fade-in { animation: fadeUp .35s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.main > * { animation: fadeUp .28s ease-out both; }

/* a bit of flash on primary buttons */
.btn-primary { position: relative; box-shadow: 0 8px 24px -10px rgba(56,189,248,.7); overflow: hidden; }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%); transform: translateX(-120%); transition: transform .6s ease; }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:hover { box-shadow: 0 10px 30px -8px rgba(129,140,248,.75); }

/* nav additions */
.nav a.plus-link span { background: linear-gradient(100deg, #5eead4, #38bdf8 45%, #818cf8); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.nav a.plus-link .star-mark { width: 22px; height: 22px; }
.nav a.sub-link { height: 40px; font-size: 14px; color: var(--muted); margin-top: 2px; }
.nav a.sub-link:hover, .nav a.sub-link.on { color: var(--text); }
.nav a.sub-link svg.i { width: 19px; height: 19px; }
.stars-pill { display: flex !important; align-items: center; gap: 8px; height: 42px !important; padding: 0 14px !important; margin-bottom: 6px; border-radius: 999px !important; background: linear-gradient(135deg, rgba(45,212,191,.1), rgba(129,140,248,.12)) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); font-size: 14px !important; }
.stars-pill b { font-weight: 800; }
.stars-pill span { color: var(--muted); font-weight: 500; }
.stars-pill.sm { height: 34px !important; padding: 0 12px !important; margin: 0; gap: 6px; }
.plan-tag { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: var(--grad); color: #fff; margin-left: 4px; vertical-align: 1px; }
.plan-badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; vertical-align: middle; background: rgba(129,140,248,.14); color: #c7d2fe; box-shadow: inset 0 0 0 1px rgba(129,140,248,.35); }
.plan-badge.pro { background: linear-gradient(135deg, rgba(45,212,191,.18), rgba(129,140,248,.2)); color: #ccfbf1; }
@media (max-width: 1240px) and (min-width: 821px) {
  .nav .stars-pill span, .nav .stars-pill b { display: none; }
  .nav .stars-pill { width: 52px; justify-content: center; padding: 0 !important; }
}

/* gender boxes */
.g-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g-opt { position: relative; display: block; }
.g-opt input { position: absolute; opacity: 0; pointer-events: none; }
.g-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 14px; cursor: pointer; background: var(--surface); border: 1.5px solid var(--line); transition: border-color .15s, background .15s, transform .1s; text-align: center; }
.g-box:hover { border-color: #3f4c62; }
.g-box:active { transform: scale(.98); }
.g-box b { font-size: 13px; }
.g-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.g-ico svg.i { width: 20px; height: 20px; }
.g-check { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; transition: all .15s; }
.g-check svg.i { width: 11px; height: 11px; stroke-width: 3.2; }
.g-opt input:checked + .g-box { border-color: #818cf8; background: linear-gradient(160deg, rgba(45,212,191,.07), rgba(129,140,248,.1)), var(--surface); }
.g-opt input:checked + .g-box .g-check { background: var(--grad); border-color: transparent; color: #fff; }
.g-opt input:checked + .g-box .g-female { color: #7dd3fc; background: rgba(255,143,177,.14); }
.g-opt input:checked + .g-box .g-male { color: #7fb2ff; background: rgba(127,178,255,.14); }
.g-opt input:checked + .g-box .g-nonbinary { color: #f2d14b; background: rgba(242,209,75,.14); }
.g-opt input:checked + .g-box .g-none { color: #c9c1d6; background: rgba(201,193,214,.12); }
.g-opt input:focus-visible + .g-box { box-shadow: 0 0 0 3px rgba(129,140,248,.3); }
.g-hint { display: block; color: var(--faint); font-size: 12.5px; margin-top: 7px; }
.g-hint b { color: var(--muted); }

/* creator layout tweaks */
.studio { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.studio .studio-av { width: 104px; height: 104px; }
.studio-labels { display: flex; flex-direction: column; gap: 10px; font-size: 14px; flex: 1; min-width: 0; }
.bg-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px 10px 10px; border-radius: 16px; border: 1.5px dashed #334055; background: var(--surface); text-align: left; transition: border-color .15s, background .15s; }
.bg-btn:hover { border-color: #4b5d78; background: var(--raised); }
.bg-btn.has { border-style: solid; border-color: var(--line); }
.bg-thumb { position: relative; width: 42px; height: 56px; border-radius: 9px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.bg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bg-text { flex: 1; min-width: 0; }
.bg-text b { display: block; font-size: 14px; }
.bg-text small { color: var(--faint); font-size: 12.5px; }
.bg-x, .bg-plus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--muted); }
.bg-x:hover { background: rgba(255,93,108,.15); color: var(--danger); }
.bg-plus { background: var(--grad); color: #fff; }
.bg-btn.desk { margin-top: 14px; }
.bg-btn.mob { display: none; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding: 16px 18px; border-radius: 16px; border: 1px solid rgba(255,93,108,.25); background: rgba(255,93,108,.05); }
.danger-zone b { display: block; font-size: 14.5px; }
.danger-zone small { color: var(--muted); font-size: 12.5px; }
.behind-setup { filter: blur(3px); opacity: .5; pointer-events: none; }

/* wider modals */
.modal:has(.setup), .modal:has(.models-modal), .modal:has(.chat-settings), .modal:has(.tag-sheet) { max-width: 560px; }
.modal.modal-setup { max-width: 580px; padding: 28px; }
.setup-step { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #5eead4; margin-bottom: 8px; }
.setup-head h3 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 6px; }
.setup-head p { margin-bottom: 20px; }
.setup-images { display: flex; gap: 20px; align-items: center; }
.setup-images .studio-bg { width: 150px; }
.setup-av { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.setup-av .studio-av { width: 112px; height: 112px; margin-bottom: 6px; }
.setup-lbl { font-size: 14px; }
.setup-lbl b { margin-right: 8px; }
.setup-lbl .req { color: #5eead4; font-weight: 700; font-size: 12px; }
.setup-lbl .opt { font-size: 12.5px; }
.modal .acts .btn-primary svg.i { margin-left: 2px; }

/* ---------- explore ---------- */
.explore { padding-top: 24px; }
.hero-x { position: relative; overflow: hidden; border-radius: 28px; padding: 40px 40px 30px; margin-bottom: 18px; border: 1px solid rgba(255,255,255,.07);
  background: radial-gradient(90% 120% at 0% 0%, rgba(45,212,191,.16), transparent 55%), radial-gradient(80% 120% at 100% 100%, rgba(129,140,248,.2), transparent 60%), #10161f; isolation: isolate; }
.hero-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-glow i { position: absolute; width: 280px; height: 280px; border-radius: 50%; filter: blur(70px); opacity: .45; animation: drift 18s ease-in-out infinite alternate; }
.hero-glow i:first-child { background: #2dd4bf; left: -60px; top: -120px; opacity: .25; }
.hero-glow i:last-child { background: #818cf8; right: -40px; bottom: -140px; animation-delay: -7s; }
.hero-x::after { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255,255,255,.5) 1px, transparent 1.2px); background-size: 46px 46px; opacity: .08; mask-image: linear-gradient(90deg, transparent, #000 40%, #000 60%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%, #000 60%, transparent); }
.hero-x h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 10px; font-weight: 800; }
.hero-x p { color: var(--muted); margin: 0 0 22px; font-size: 15.5px; }
.hero-x .eyebrow { margin-bottom: 14px; }
.hero-search { margin: 0; max-width: 620px; }
.hero-search .input { height: 52px; background: rgba(10,8,14,.55); border-color: rgba(255,255,255,.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero-search svg { top: 17px; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; transition: border-color .15s, background .15s; }
.filter-btn:hover { border-color: #3f4c62; }
.filter-btn.on { border-color: #818cf8; background: rgba(129,140,248,.1); }
.f-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--grad); color: #fff; font-size: 11.5px; display: grid; place-items: center; }
.g-slider { position: relative; display: grid; grid-template-columns: repeat(var(--n), 46px); height: 42px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.g-slider button { position: relative; z-index: 1; border: 0; background: none; border-radius: 999px; color: var(--muted); display: grid; place-items: center; transition: color .2s; }
.g-slider button:hover { color: var(--text); }
.g-slider button.on { color: #fff; }
.g-slider .all { font-size: 12.5px; font-weight: 800; }
.g-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 46px; border-radius: 999px; background: var(--grad); box-shadow: 0 6px 18px -6px rgba(56,189,248,.8); transform: translateX(calc(var(--i) * 46px)); transition: transform .3s cubic-bezier(.3,1.3,.5,1); }
.sort-seg { display: inline-flex; height: 42px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-left: auto; }
.sort-seg button { border: 0; background: none; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.sort-seg button.on { background: var(--text); color: var(--bg); }
.active-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; min-height: 4px; }
.active-tags .chip { height: 32px; font-size: 13px; }
.active-tags .chip svg.i { width: 14px; height: 14px; }
.tag-sheet h3 { display: flex; align-items: center; gap: 8px; }
.tag-list { max-height: 46vh; overflow-y: auto; padding: 2px; margin-bottom: 6px; }
.tag-list .chip small { color: inherit; opacity: .55; font-size: 11.5px; margin-left: 2px; }

.explore-empty { position: relative; min-height: 420px; display: grid; place-items: center; }
.ghost-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; mask-image: linear-gradient(180deg, #000 10%, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 85%); opacity: .55; }
.ghost-card { aspect-ratio: 3/4; border-radius: 20px; background: linear-gradient(160deg, #1d1826, #15111b); border: 1px solid var(--line-soft); padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; position: relative; overflow: hidden; }
.ghost-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.05) 50%, transparent 70%); animation: shimmer 2.4s infinite; animation-delay: var(--d); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ghost-card i { width: 34px; height: 34px; border-radius: 50%; background: #232d3d; }
.ghost-card b { height: 11px; width: 60%; border-radius: 6px; background: #232d3d; }
.ghost-card span { height: 8px; border-radius: 6px; background: #221d2a; }
.ghost-card span:last-child { width: 70%; }
.empty-cta { position: relative; text-align: center; max-width: 440px; padding: 34px 28px; border-radius: 26px; background: rgba(20,17,26,.82); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.empty-cta h3 { margin: 14px 0 8px; font-size: 21px; letter-spacing: -.02em; }
.empty-cta p { color: var(--muted); margin: 0 0 20px; }
.cta-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta-orb { width: 68px; height: 68px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, rgba(45,212,191,.35), rgba(129,140,248,.3)); box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 12px 40px -8px rgba(56,189,248,.6); animation: bob 5s ease-in-out infinite; }
.cta-orb.sm { width: 52px; height: 52px; border-radius: 16px; margin: 0; flex: none; }
.center-modal { text-align: center; }
.center-modal .cta-orb { margin: 0 auto 14px; }
.center-modal .acts { justify-content: center; }

/* ---------- chat tools ---------- */
.chat-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.tool-btn { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 14px 0 11px; border-radius: 14px; border: 1px solid var(--line); background: rgba(22,19,28,.85); color: var(--text); text-align: left; transition: border-color .15s, background .15s, transform .1s; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 0; }
.tool-btn:hover { border-color: #3f4c62; background: var(--raised); }
.tool-btn:active { transform: scale(.98); }
.tool-btn span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.tool-btn b { font-size: 13px; }
.tool-btn small { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.tool-model { background: linear-gradient(135deg, rgba(45,212,191,.1), rgba(129,140,248,.12)), rgba(22,19,28,.85); border-color: rgba(129,140,248,.3); }
.star-btn { display: none; width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none; place-items: center; background: linear-gradient(135deg, rgba(45,212,191,.18), rgba(129,140,248,.22)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); margin-left: -13px; }
.star-btn:active { transform: scale(.94); }

.mm-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.mm-head p { margin: 2px 0 0; }
.mm-balance { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); padding: 10px 14px; border-radius: 12px; background: var(--raised); margin-bottom: 14px; }
.mm-balance b { color: var(--text); }
.mm-balance .link { margin-left: auto; font-size: 13.5px; }
.mm-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mm-opt { position: relative; display: block; }
.mm-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mm-box { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 40px 14px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.mm-box:hover { border-color: #3f4c62; }
.mm-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); flex: none; }
.mm-lumen-plus { background: linear-gradient(135deg, rgba(91,140,255,.25), rgba(129,140,248,.25)); }
.mm-lumen-max { background: linear-gradient(135deg, rgba(45,212,191,.3), rgba(56,189,248,.3)); }
.mm-text { flex: 1; min-width: 0; }
.mm-text b { display: block; font-size: 14.5px; }
.mm-text small { color: var(--muted); font-size: 12.5px; }
.mm-cost { flex: none; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: rgba(255,196,87,.12); color: #ffd58a; white-space: nowrap; }
.mm-cost.free { background: rgba(60,207,142,.12); color: #7be2b3; }
.mm-box .g-check { top: 50%; right: 12px; transform: translateY(-50%); width: 20px; height: 20px; }
.mm-opt input:checked + .mm-box { border-color: #818cf8; background: linear-gradient(160deg, rgba(45,212,191,.06), rgba(129,140,248,.1)), var(--surface); }
.mm-opt input:checked + .mm-box .g-check { background: var(--grad); border-color: transparent; color: #fff; }

.chat-settings h3 { display: flex; align-items: center; gap: 8px; }
.cs-sec { margin-bottom: 20px; }
.cs-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.cs-title .link { font-size: 13px; }
.p-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 6px; }
.p-opt { position: relative; display: block; }
.p-opt input { position: absolute; opacity: 0; pointer-events: none; }
.p-opt > span { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 30px 10px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.p-opt .av { grid-row: span 2; }
.p-opt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-opt small { font-size: 11.5px; color: var(--faint); }
.p-opt .g-check { top: 50%; transform: translateY(-50%); right: 9px; }
.p-opt input:checked + span { border-color: #818cf8; background: rgba(129,140,248,.08); }
.p-opt input:checked + span .g-check { background: var(--grad); border-color: transparent; color: #fff; }
.bg-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bgm { position: relative; display: block; }
.bgm input { position: absolute; opacity: 0; pointer-events: none; }
.bgm > span { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.bgm b { font-size: 13px; }
.bgm-prev { width: 100%; aspect-ratio: 3/4; max-height: 110px; border-radius: 10px; background: var(--raised) center/cover; display: grid; place-items: center; color: var(--faint); }
.bgm input:checked + span { border-color: #818cf8; background: rgba(129,140,248,.08); }

/* ---------- Talewisp+ ---------- */
.plus { padding-top: 24px; max-width: 1100px; }
.plus-hero { position: relative; overflow: hidden; text-align: center; border-radius: 30px; padding: 44px 24px 30px; margin-bottom: 22px; border: 1px solid rgba(255,255,255,.07); background: radial-gradient(70% 100% at 50% 0%, rgba(56,189,248,.22), transparent 60%), radial-gradient(60% 90% at 100% 100%, rgba(129,140,248,.18), transparent 60%), #10161f; isolation: isolate; }
.plus-orb { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 30px; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, rgba(45,212,191,.35), rgba(129,140,248,.35)); box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 20px 60px -10px rgba(56,189,248,.7); animation: bob 5s ease-in-out infinite; }
.plus-orb .star-mark { animation: spin 18s linear infinite; }
.plus-hero h1 { font-size: 46px; letter-spacing: -.04em; margin: 0; font-weight: 800; }
.plus-hero p { color: var(--muted); margin: 6px 0 22px; }
.balance-card { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 26px; border-radius: 20px; background: rgba(10,8,14,.5); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.balance-card > div { display: flex; align-items: center; gap: 9px; }
.balance-card b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.balance-card span { color: var(--muted); }
.balance-card small { color: var(--faint); font-size: 12.5px; }
.interval-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.interval { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); width: 320px; }
.interval button { position: relative; z-index: 1; height: 40px; border: 0; background: none; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--muted); transition: color .2s; }
.interval button.on { color: #fff; }
.interval button i { font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: rgba(60,207,142,.18); color: #7be2b3; margin-left: 4px; }
.iv-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--grad); transform: translateX(calc(var(--i) * 100%)); transition: transform .3s cubic-bezier(.3,1.3,.5,1); }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-soft); }
.plan-card.basic { border-color: rgba(91,140,255,.3); }
.plan-card.pro { border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: 0 24px 60px -24px rgba(56,189,248,.6); }
.plan-card.current { box-shadow: 0 0 0 2px rgba(60,207,142,.45); }
.plan-flag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); height: 24px; padding: 0 12px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; white-space: nowrap; }
.plan-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.plan-top h3 { margin: 0; font-size: 17px; }
.plan-top small { color: var(--muted); font-size: 12.5px; }
.plan-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.plan-card.basic .plan-ico { background: rgba(91,140,255,.15); color: #9ab9ff; }
.plan-card.pro .plan-ico { background: linear-gradient(135deg, rgba(45,212,191,.25), rgba(129,140,248,.25)); color: #bae6fd; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-price b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.plan-price span { color: var(--muted); }
.plan-sub { color: var(--faint); font-size: 12.5px; margin: 2px 0 18px; min-height: 18px; }
.plan-card ul { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan-card li { display: flex; gap: 9px; font-size: 14px; color: #d6deea; }
.plan-card li svg.i { width: 17px; height: 17px; color: #7be2b3; margin-top: 1px; stroke-width: 2.6; }
.sec-title { display: flex; align-items: center; gap: 9px; font-size: 20px; letter-spacing: -.02em; margin: 0 0 6px; }
.sec-sub { color: var(--muted); margin: 0 0 16px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 40px; }
.pack { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); transition: transform .15s, border-color .15s, box-shadow .15s; }
.pack:hover { transform: translateY(-2px); border-color: #3f4c62; box-shadow: 0 14px 34px -18px rgba(129,140,248,.6); }
.pack.hot { border-color: rgba(45,212,191,.4); }
.pack-flag { position: absolute; top: -10px; left: 16px; height: 22px; padding: 0 10px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 800; display: flex; align-items: center; }
.pack-stars { display: flex; align-items: center; gap: 8px; }
.pack-stars b { font-size: 22px; font-weight: 800; }
.pack-price { font-weight: 800; padding: 8px 14px; border-radius: 12px; background: var(--raised); }
.model-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 40px; }
.ms-item { padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ms-item b { font-size: 15px; }
.ms-item small { color: var(--muted); font-size: 13px; flex: 1; }
.ledger span.plus-d { color: #7be2b3; font-weight: 800; }
.ledger span.minus-d { color: #ff9aa3; font-weight: 800; }

/* ---------- personas ---------- */
.persona-explainer { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; margin-bottom: 20px; background: linear-gradient(135deg, rgba(91,140,255,.08), rgba(129,140,248,.08)); border: 1px solid rgba(91,140,255,.2); }
.persona-explainer > svg.i { width: 28px; height: 28px; color: #9ab9ff; }
.persona-explainer div { flex: 1; }
.persona-explainer b { display: block; }
.persona-explainer small { color: var(--muted); font-size: 13px; }
.p-count { font-weight: 800; color: var(--muted); font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--raised); }
.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.persona-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-soft); transition: border-color .15s, transform .15s; }
.persona-card:hover { border-color: #334055; transform: translateY(-2px); }
.persona-card > svg.i { color: var(--faint); }
.pc-body { flex: 1; min-width: 0; }
.pc-body b { display: flex; align-items: center; gap: 8px; font-size: 15.5px; }
.pc-g { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.pc-g svg.i { width: 14px; height: 14px; }
.pc-body p { margin: 4px 0 0; color: var(--faint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.def-tag { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: rgba(60,207,142,.15); color: #7be2b3; }

/* ---------- profile settings ---------- */
.settings-list > a { color: var(--text); }
.settings-list > a:hover { background: var(--raised); }
.settings-list > a span, .settings-list > div span { display: inline-flex; align-items: center; gap: 5px; }
.pure-row { align-items: flex-start !important; }
.pure-copy b { display: flex; align-items: center; gap: 7px; }
.pure-copy b svg.i { color: #7be2b3; }
.pure-copy small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; margin-top: 4px; max-width: 54ch; }
.toggle input:disabled + i { opacity: .55; }
.stars-btn b { font-weight: 800; }

/* ---------- responsive ---------- */
@media (min-width: 821px) {
  .star-btn { display: none !important; }
}
@media (max-width: 1100px) and (min-width: 821px) {
  .plan-grid, .pack-grid, .model-strip { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
  .tool-btn small { display: none; }
}
@media (max-width: 820px) {
  .chat-tools { display: none; }
  .star-btn { display: grid; }
  .composer form { padding-left: 18px; }
  .bg-btn.mob { display: flex; }
  .bg-btn.desk { display: none; }
  .studio { align-items: flex-start; }
  .studio .studio-av { width: 92px; height: 92px; }
  .g-grid { gap: 6px; }
  .g-box { padding: 10px 4px 8px; }
  .g-box b { font-size: 12px; }
  .g-ico { width: 30px; height: 30px; }
  .explore { padding-top: 4px; }
  .hero-x { padding: 24px 18px 18px; border-radius: 22px; }
  .hero-x h1 { font-size: 28px; }
  .hero-x p { font-size: 14px; margin-bottom: 16px; }
  .filter-bar { gap: 8px; }
  .g-slider { grid-template-columns: repeat(var(--n), 40px); }
  .g-thumb { width: 40px; transform: translateX(calc(var(--i) * 40px)); }
  .sort-seg { margin-left: 0; }
  .filter-btn { padding: 0 14px; }
  .ghost-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ghost-card:nth-child(n+5) { display: none; }
  .explore-empty { min-height: 480px; }
  .empty-cta { margin: 0 6px; padding: 26px 18px; }
  .setup-images { gap: 14px; }
  .setup-images .studio-bg { width: 116px; }
  .setup-av .studio-av { width: 88px; height: 88px; }
  .modal.modal-setup { padding: 22px 18px calc(22px + var(--safe-b)); }
  .plus { padding-top: 4px; }
  .plus-hero { padding: 28px 16px 22px; border-radius: 22px; }
  .plus-hero h1 { font-size: 36px; }
  .interval { width: 100%; max-width: 340px; }
  .plan-grid, .pack-grid, .model-strip { grid-template-columns: 1fr; }
  .plan-card { padding: 20px; }
  .p-pick { grid-template-columns: 1fr 1fr; }
  .persona-explainer { flex-wrap: wrap; }
  .danger-zone { flex-direction: column; align-items: stretch; text-align: left; }
  .stars-pill.sm { display: inline-flex !important; }
  .main > * { animation: none; }
}
.search svg { z-index: 1; pointer-events: none; }
.mm-text b { white-space: nowrap; }
@media (max-width: 820px) {
  .mm-box { flex-wrap: wrap; row-gap: 8px; }
  .mm-text { flex-basis: calc(100% - 52px); }
  .mm-cost { margin-left: 52px; }
}

/* ---------- v5 ---------- */
/* live character counters (bottom-right of each field) */
.cwrap { position: relative; display: block; }
.cwrap.is-area .textarea { padding-bottom: 30px; }
.cwrap.is-input .input { padding-right: 76px; }
.ccount { position: absolute; right: 12px; bottom: 9px; font-size: 11.5px; font-weight: 600; color: var(--faint); pointer-events: none; font-variant-numeric: tabular-nums; background: var(--surface); padding: 1px 4px; border-radius: 5px; }
.cwrap.is-area .ccount { right: 18px; }
.cwrap.is-input .ccount { bottom: auto; top: 50%; transform: translateY(-50%); }
.ccount.near { color: #99f6e4; }
.auth-card .ccount { background: transparent; }
.composer form { position: relative; }
.composer-count { position: absolute; right: 56px; bottom: -18px; font-size: 11px; color: var(--faint); }

/* clearer "Talewisp +" */
.plus-sign { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 2px; border-radius: 6px; background: var(--grad); color: #fff !important; -webkit-text-fill-color: #fff; font-size: 15px; font-weight: 900; line-height: 1; vertical-align: 1px; }

/* chat tools inside the side panel on PC */
.panel-tools { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.pt-label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 9px; }
.chat-tools.in-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.chat-tools.in-panel .tool-btn { flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: auto; padding: 12px 6px; text-align: center; background: rgba(14,12,18,.55); border-color: rgba(255,255,255,.12); }
.chat-tools.in-panel .tool-btn span { align-items: center; }
.chat-tools.in-panel .tool-btn small { max-width: 100%; }
.chat-tools.in-panel .tool-model { background: linear-gradient(135deg, rgba(45,212,191,.18), rgba(129,140,248,.2)), rgba(14,12,18,.55); }
@media (min-width: 1181px) {
  .dms.panel-open .chat-tools.in-composer { display: none; }
}
.hero-x h1 { margin-bottom: 6px; }

.mini-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; font-style: normal; }
.link-plain { color: inherit; font-weight: 600; }
.link-plain:hover { text-decoration: underline; }
.btn.icon-only { min-width: 0 !important; width: 44px; padding: 0; }
.nav-foot { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 0 12px 12px; }
.nav-foot a { height: auto !important; padding: 0 !important; font-size: 12px !important; font-weight: 500 !important; color: var(--faint) !important; background: none !important; width: auto !important; }
.nav-foot a:hover { color: var(--muted) !important; }
@media (max-width: 1240px) and (min-width: 821px) { .nav-foot { display: none; } }
.mobile-only { display: none; }

/* signup agree */
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: 13.5px; color: var(--muted); line-height: 1.45; cursor: pointer; }
.agree input { width: 18px; height: 18px; margin-top: 1px; accent-color: #818cf8; flex: none; }
.auth-legal { text-align: center; font-size: 12.5px; color: var(--faint); margin-top: 14px; }
.auth-legal a:hover { color: var(--muted); }

/* character page extras */
.req-line { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; margin: -6px 0 20px; }
.req-line svg.i { color: #5eead4; }

/* chat safety */
.ai-disclose { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); margin-top: 8px; }
.crisis { display: flex; gap: 14px; align-items: flex-start; margin: 14px auto 8px; max-width: 620px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, rgba(91,140,255,.12), rgba(60,207,142,.1)); border: 1px solid rgba(91,140,255,.3); position: relative; }
.crisis-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(91,140,255,.2); color: #b9cdff; flex: none; }
.crisis b { display: block; margin-bottom: 4px; }
.crisis p { margin: 0; color: #d0d9e5; font-size: 14px; line-height: 1.5; }
.crisis [data-crisis-x] { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; }

/* requests / reports modals */
.modal:has(.req-modal), .modal:has(.report-modal) { max-width: 540px; }
.reason-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reason { position: relative; display: block; }
.reason input { position: absolute; opacity: 0; }
.reason span { display: flex; align-items: center; min-height: 42px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.reason input:checked + span { border-color: var(--danger); background: rgba(255,93,108,.08); }
.reason input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255,93,108,.3); }

.req-toggle { display: inline-flex; align-items: center; gap: 12px; height: 46px; padding: 0 8px 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; flex: none; }
.req-toggle span:first-child { display: flex; flex-direction: column; line-height: 1.15; }
.req-toggle b { font-size: 13.5px; }
.req-toggle small { font-size: 11.5px; color: var(--danger); font-weight: 700; }
.req-toggle.on { border-color: rgba(60,207,142,.4); background: rgba(60,207,142,.06); }
.req-toggle.on small { color: #7be2b3; }

/* creators */
.creators { padding-top: 24px; }
.creator-hero { padding: 26px 28px; }
.ch-me { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ch-me-text { flex: 1; min-width: 220px; }
.ch-me-text h1 { font-size: 30px; margin: 0 0 4px; }
.ch-me-text p { margin: 0; color: var(--muted); }
.ch-me-text p b { color: #99f6e4; }
.ch-me-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ctabs a { flex: 1; max-width: 220px; height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: var(--faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ctabs a.on { color: var(--text); border-color: var(--text); }
.board-note { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.board { display: flex; flex-direction: column; gap: 10px; }
.board-row { display: grid; grid-template-columns: 54px minmax(220px, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-soft); transition: border-color .15s; }
.board-row:hover { border-color: #334055; }
.board-row.top { background: linear-gradient(90deg, rgba(255,196,87,.06), transparent 50%), var(--surface); }
.br-rank { display: grid; place-items: center; }
.medal { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 17px; color: #1a1625; }
.medal.m1 { background: linear-gradient(135deg, #ffe08a, #f2b33d); box-shadow: 0 0 22px -4px rgba(242,179,61,.8); }
.medal.m2 { background: linear-gradient(135deg, #f1f3f8, #b9c0cf); }
.medal.m3 { background: linear-gradient(135deg, #a5f3fc, #d0814e); }
.rank-n { font-weight: 800; color: var(--faint); font-size: 16px; }
.br-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.br-who div { min-width: 0; }
.br-who b { display: flex; align-items: center; gap: 6px; font-size: 15.5px; }
.br-who small { color: var(--faint); font-size: 12.5px; }
.br-stats { display: flex; gap: 12px; margin-top: 4px; }
.br-stats i { font-style: normal; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.br-stats svg.i { width: 14px; height: 14px; }
.br-top { display: flex; gap: 8px; }
.mini-char { position: relative; width: 92px; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; display: block; isolation: isolate; border: 1px solid var(--line-soft); transition: transform .15s; }
.mini-char:hover { transform: translateY(-2px); }
.mc-art { position: absolute; inset: 0; z-index: -2; }
.mc-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, rgba(10,8,14,.92)); }
.mc-info { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.mc-info .av { margin-bottom: 2px; }
.mc-info b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-info small { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: rgba(255,255,255,.65); }
.mc-info small svg.i { width: 11px; height: 11px; }
.br-view { flex: none; }

/* requests */
.req-seg { margin: 4px 0 6px; }
.req-seg a { display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.req-seg a.on { background: var(--text); color: var(--bg); }
.req-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.req-card { padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-soft); }
.req-card.st-pending { border-color: rgba(255,196,87,.25); }
.rq-head { display: flex; align-items: center; gap: 12px; }
.rq-head > div { flex: 1; min-width: 0; }
.rq-head b { display: block; font-size: 15px; }
.rq-head small { color: var(--faint); font-size: 12.5px; }
.st { flex: none; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; text-transform: capitalize; }
.st-pending { background: rgba(255,196,87,.14); color: #ffd58a; }
.st-accepted { background: rgba(91,140,255,.15); color: #a9c3ff; }
.st-declined { background: rgba(255,93,108,.14); color: #ff9aa3; }
.st-done { background: rgba(60,207,142,.14); color: #7be2b3; }
.rq-body { margin: 12px 0 0; color: #d6deea; white-space: pre-wrap; line-height: 1.5; }
.rq-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--raised); font-size: 12.5px; font-weight: 600; }
.rq-note { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--raised); font-size: 13.5px; color: var(--muted); }
.rq-note b { color: var(--text); }
.rq-result { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(60,207,142,.08); border: 1px solid rgba(60,207,142,.25); }
.rq-result span { flex: 1; }
.rq-result b { display: block; font-size: 14px; }
.rq-result small { color: #7be2b3; font-size: 12px; }
.rq-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.rq-acts:empty { display: none; }

/* public profile */
.user-hero { padding: 28px; margin-top: 24px; }
.uh { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.uh-text { flex: 1; min-width: 240px; }
.uh-text h1 { font-size: 28px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uh-text .handle { color: var(--muted); font-size: 13.5px; }
.uh-text p { margin: 10px 0 0; color: #d6deea; white-space: pre-wrap; }
.uh-stats { display: flex; gap: 24px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.uh-stats b { display: block; font-size: 19px; color: var(--text); }
.uh-acts { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.closed-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 13.5px; font-weight: 600; }

/* creator guide */
.guide-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; margin-top: 16px; align-items: start; }
.guide-toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.guide-toc a { padding: 9px 12px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.guide-toc a:hover { background: var(--surface); color: var(--text); }
.guide-sec { padding: 22px 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-soft); margin-bottom: 14px; scroll-margin-top: 20px; }
.guide-sec h2 { display: flex; align-items: center; gap: 9px; font-size: 19px; margin: 0 0 12px; letter-spacing: -.01em; }
.guide-sec h2 svg.i { color: #5eead4; }
.guide-sec p { color: #d6deea; line-height: 1.6; margin: 0 0 12px; }
.guide-sec code { background: var(--raised); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.steps-list, .tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: #d6deea; line-height: 1.55; }
.tips { margin-top: 12px; }
.tmpl { border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: #0c1118; }
.tmpl-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tmpl pre, pre.plain { margin: 0; padding: 14px; white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: #dde6f1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre.plain { border-radius: 14px; border: 1px solid var(--line); background: #0c1118; }
.example { padding: 14px; border-radius: 14px; background: var(--raised); line-height: 1.7; font-size: 14px; }
.example i { color: #aab6c8; }

/* help & legal */
.help-hero { margin-top: 24px; }
.help-hero h1 { font-size: 34px; margin: 0 0 6px; }
.faq-sec { margin: 26px 0; }
.faq-sec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 10px; }
.faq { border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft); margin-bottom: 8px; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; color: var(--faint); transition: transform .2s; }
.faq[open] summary svg { transform: rotate(180deg); }
.faq p { margin: 0; padding: 0 18px 16px; color: var(--muted); line-height: 1.6; }
.help-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 28px 0 40px; }
.help-links a { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft); font-weight: 700; }
.help-links a:hover { border-color: #334055; }
.legal { padding-top: 28px; }
.legal h1 { font-size: 32px; margin: 18px 0 4px; letter-spacing: -.02em; }
.legal-tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.legal-tabs a { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.legal-tabs a.on { background: var(--text); color: var(--bg); }
.legal-body { margin-top: 20px; color: #d6deea; line-height: 1.65; padding-bottom: 48px; }
.legal-body h3 { margin: 26px 0 8px; font-size: 17px; color: var(--text); }
.legal-body ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.public-page { min-height: 100dvh; background: radial-gradient(60vw 40vw at 100% -10%, rgba(129,140,248,.08), transparent 60%), var(--bg); }
.pub-top { display: flex; align-items: center; justify-content: space-between; max-width: 900px; margin: 0 auto; padding: 18px 20px; }
.public-page .mobile-top { display: none !important; }

@media (max-width: 1100px) and (min-width: 821px) {
  .board-row { grid-template-columns: 48px 1fr auto; }
  .br-view { display: none; }
  .mini-char { width: 74px; }
}
@media (max-width: 820px) {
  .mobile-only { display: block; }
  .page-head .req-toggle { display: none; }
  .req-toggle-row { margin: 4px 0 10px; }
  .req-toggle-row .req-toggle { width: 100%; justify-content: space-between; }
  .creators { padding-top: 4px; }
  .creator-hero { padding: 20px 16px; }
  .ch-me-text h1 { font-size: 24px; }
  .ch-me-acts { width: 100%; }
  .ch-me-acts .req-toggle { flex: 1; justify-content: space-between; }
  .ctabs a { font-size: 13px; gap: 5px; }
  .ctabs a svg.i { display: none; }
  .board-row { grid-template-columns: 40px 1fr; gap: 10px 12px; padding: 12px; }
  .br-top { grid-column: 1 / -1; }
  .mini-char { flex: 1; width: auto; }
  .br-view { display: none; }
  .medal { width: 34px; height: 34px; font-size: 15px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-toc { display: none; }
  .guide-sec { padding: 18px 16px; }
  .user-hero { margin-top: 4px; padding: 20px 16px; }
  .uh-acts { width: 100%; align-items: stretch; }
  .uh-acts .btn, .uh-acts .req-toggle { width: 100%; justify-content: center; }
  .uh-acts .req-toggle { justify-content: space-between; }
  .help-hero, .legal { margin-top: 0; padding-top: 4px; }
  .help-links { grid-template-columns: 1fr; }
  .reason-list { grid-template-columns: 1fr; }
  .nav-foot { display: none; }
  .crisis { margin: 12px 0 6px; }
}
/* fixes */
.rq-head > div:not(.av) { flex: 1; min-width: 0; }
.rq-head > .av { flex: none; }
.rq-head > div.av { flex: 0 0 var(--s); }
.req-card.st-pending { border-color: rgba(255,196,87,.25); background: linear-gradient(90deg, rgba(255,196,87,.05), transparent 40%), var(--surface); }
.rq-head b { color: var(--text); }
.cwrap.is-area .ccount { right: 22px; bottom: 8px; background: transparent; }
.cwrap.is-input .ccount { background: transparent; }
.nav a .dot { left: 26px; top: 9px; }
@media (max-width: 820px) {
  .me-head .acts { display: flex; flex-wrap: wrap; gap: 8px; }
  .me-head .acts .btn { flex: 0 1 auto; }
}
@media (max-width: 820px) {
  .me-head { display: grid; grid-template-columns: 84px 1fr; column-gap: 16px; align-items: center; }
  .me-head > .av { grid-row: span 3; align-self: start; }
  .me-head > div:not(.av) { display: contents; }
  .me-head h1, .me-head .handle, .me-head p { grid-column: 2; margin: 0; }
  .me-head h1 { align-self: end; }
  .me-head .handle { align-self: start; margin-bottom: 0; }
  .me-head .acts { grid-column: 1 / -1; margin-top: 14px; }
}
@media (max-width: 820px) { .me-head > .av { width: 84px !important; height: 84px !important; font-size: 36px; } }

/* ---------- 9 models ---------- */
.model-star { flex: none; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--mc) 60%, transparent)); }
.modal:has(.models-modal) { max-width: 600px; }
.mm-group { margin-bottom: 16px; }
.mm-gh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mm-gh b { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; }
.mm-gh small { color: var(--faint); font-size: 12px; text-align: right; }
.mm-ico { background: color-mix(in srgb, var(--mc) 16%, var(--raised)) !important; }
.mm-best { font-style: normal; font-size: 11px; font-weight: 700; margin-left: 8px; padding: 2px 7px; border-radius: 6px; color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, transparent); vertical-align: 1px; }
.mm-opt input:checked + .mm-box { border-color: var(--mc); background: linear-gradient(160deg, color-mix(in srgb, var(--mc) 10%, transparent), transparent 70%), var(--surface); }
.mm-opt input:checked + .mm-box .g-check { background: var(--mc); }
.mm-cost.free { background: rgba(60,207,142,.12); color: #7be2b3; }
.mm-acts { position: sticky; bottom: -24px; background: var(--surface); padding: 12px 0 4px; margin-bottom: -4px; }
.plan-models { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.pm { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px 0 7px; border-radius: 999px; background: var(--raised); font-size: 12px; font-weight: 700; }
@media (max-width: 820px) {
  .mm-best { display: inline-block; margin: 3px 0 0; }
  .mm-text b { white-space: normal; }
  .mm-gh { flex-direction: column; gap: 2px; }
  .mm-gh small { text-align: left; }
  .mm-acts { bottom: calc(-24px - var(--safe-b)); }
}
@media (max-width: 820px) { .mm-best { margin: 3px 0 0 6px; } }

/* fix: Talewisp + badge centered */
.nav a.plus-link span.plus-label { display: inline-flex; align-items: center; gap: 7px; line-height: 1; }
.plus-sign { display: inline-grid !important; place-items: center; width: 20px; height: 20px; margin: 0 !important; border-radius: 6px; background: var(--grad); flex: none; }
.plus-sign svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3; stroke-linecap: round; fill: none; display: block; }

/* fix: chat tools fit inside the panel */
.chat-tools.in-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chat-tools.in-panel .tool-btn { min-width: 0; width: 100%; padding: 12px 4px; }
.chat-tools.in-panel .tool-btn span { width: 100%; min-width: 0; }
.chat-tools.in-panel .tool-btn b, .chat-tools.in-panel .tool-btn small { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.art-info { box-sizing: border-box; width: 100%; }

/* ---------- model lab ---------- */
.lab { max-width: 1400px; padding-top: 24px; }
.lab-status { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; margin: 14px 0 18px; }
.lab-status.ok { background: rgba(60,207,142,.08); border: 1px solid rgba(60,207,142,.25); color: #a8ecc9; }
.lab-status.off { background: rgba(255,196,87,.08); border: 1px dashed rgba(255,196,87,.35); color: #ffd58a; }
.lab-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.lab-msg { grid-column: 1 / -1; }
.lab-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.lab-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--muted); }
.lab-chip.on { border-color: var(--mc); color: var(--text); background: color-mix(in srgb, var(--mc) 12%, var(--surface)); }
.lab-quick { font-size: 12.5px; color: var(--faint); margin-left: 6px; }
.lab-quick .link { font-size: 12.5px; }
.lab-run { margin-left: auto; }
.lab-greeting { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.lg-row { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); }
.lg-row.you { background: linear-gradient(135deg, rgba(240,112,95,.12), rgba(129,140,248,.12)); }
.lg-row b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 4px; }
.lg-row p { margin: 0; white-space: pre-wrap; font-size: 14px; }
.lg-row em, .lab-out em { color: #aab6c8; }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.lab-col { border-radius: 20px; background: var(--surface); border: 1px solid var(--line-soft); border-top: 3px solid var(--mc); overflow: hidden; }
.lab-col header { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; }
.lab-col header div { flex: 1; min-width: 0; }
.lab-col header b { display: block; font-size: 16px; }
.lab-col header small { display: block; font-size: 11.5px; color: var(--faint); }
.pm-id { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-edited { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(255,196,87,.14); color: #ffd58a; }
.lab-out { margin: 0 16px; padding: 14px; border-radius: 14px; background: var(--raised); white-space: pre-wrap; line-height: 1.55; font-size: 14.5px; min-height: 90px; }
.lab-out.err-out { background: rgba(255,93,108,.08); color: #ff9aa3; font-size: 13px; }
.lab-out .typing { padding: 6px 0; }
.lab-meta { display: flex; gap: 12px; padding: 8px 16px 0; font-size: 12px; color: var(--faint); }
.lab-tune { margin: 12px 16px 14px; }
.lab-tune summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.lab-tune summary::-webkit-details-marker { display: none; }
.lab-tune[open] summary { margin-bottom: 12px; }
.lab-tune .textarea { font-size: 13px; }
.lab-tune-acts { display: flex; gap: 8px; justify-content: flex-end; }
.lab-prompt { margin: 22px 0 40px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft); }
.lab-prompt summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-weight: 700; }
.lab-prompt summary::-webkit-details-marker { display: none; }
.lab-prompt pre { margin: 0; padding: 0 16px 16px; white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; color: #d0d9e5; font-family: ui-monospace, Menlo, Consolas, monospace; }
.ctabs a .star-mark { width: 16px; height: 16px; }
@media (max-width: 820px) {
  .lab { padding-top: 4px; }
  .lab-controls, .lab-greeting { grid-template-columns: 1fr; }
  .lab-grid { grid-template-columns: 1fr; }
  .lab-run { width: 100%; margin: 6px 0 0; }
}
.adult-tag { display: inline-grid; place-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: rgba(255,93,108,.16); color: #ff8b95; font-size: 10.5px; font-weight: 800; margin-right: 4px; }

/* ---------- image cropper ---------- */
.crop-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(5,4,8,.78); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.crop-box { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; animation: pop .15s ease-out; }
.crop-box h3 { margin: 0 0 4px; font-size: 19px; }
.crop-box > p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.crop-stage { position: relative; margin: 0 auto; overflow: hidden; border-radius: 16px; background: #000; cursor: grab; touch-action: none; user-select: none; }
.crop-stage.dragging { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-frame { position: absolute; pointer-events: none; box-shadow: 0 0 0 9999px rgba(10,8,14,.62); outline: 2px solid rgba(255,255,255,.9); }
.crop-stage.is-round .crop-frame { border-radius: 50%; }
.crop-stage.is-tall .crop-frame { border-radius: 14px; }
.crop-stage.is-tall .crop-frame::before, .crop-stage.is-tall .crop-frame::after { content: ''; position: absolute; left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.25); border-right: 1px solid rgba(255,255,255,.25); }
.crop-stage.is-tall .crop-frame::after { left: 0; right: 0; top: 33.33%; bottom: 33.33%; border: 0; border-top: 1px solid rgba(255,255,255,.25); border-bottom: 1px solid rgba(255,255,255,.25); }
.crop-stage.dragging .crop-frame::before, .crop-stage.dragging .crop-frame::after { opacity: 1; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 18px 4px 6px; color: var(--muted); }
.crop-zoom span svg.i { width: 24px; height: 24px; }
.crop-zoom input { flex: 1; accent-color: #818cf8; height: 28px; }
.crop-box .acts { display: flex; gap: 10px; margin-top: 12px; }
@media (max-width: 820px) {
  .crop-wrap { place-items: end center; padding: 0; }
  .crop-box { border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + var(--safe-b)); max-width: none; }
}

/* ---------- per-person model settings ---------- */
.modal:has(.mc-modal) { max-width: 540px; }
.mc-modal .mm-head .mm-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.mc-sec { padding: 14px; border-radius: 16px; background: var(--raised); margin-bottom: 12px; }
.mc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mc-row b { font-size: 14.5px; }
.mc-val { font-weight: 800; font-size: 13.5px; color: var(--mc); }
.mc-note { display: block; color: var(--muted); font-size: 12.5px; margin-top: 8px; line-height: 1.45; transition: color .2s; }
.mc-note.flash { color: #ffd58a; }
.mc-sec .textarea { background: var(--surface); }
.len-wrap { position: relative; padding-top: 4px; }
.len-range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; outline: none; cursor: pointer;
  background:
    linear-gradient(90deg, var(--mc) var(--fill, 0%), transparent var(--fill, 0%)),
    linear-gradient(90deg, rgba(255,255,255,.14) var(--cap), rgba(255,255,255,.04) var(--cap));
}
.len-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--mc); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.len-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--mc); }
.len-wrap::after { content: ''; position: absolute; top: 2px; left: var(--cap); width: 2px; height: 12px; border-radius: 2px; background: rgba(255,255,255,.35); transform: translateX(-1px); pointer-events: none; }
.len-ticks { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--faint); font-weight: 600; }
.mm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 7px; }
.mm-tune { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--text); padding: 4px 9px; border-radius: 8px; background: rgba(255,255,255,.06); cursor: pointer; }
.mm-tune:hover { background: color-mix(in srgb, var(--mc) 22%, transparent); }
.mm-tune svg.i { width: 14px; height: 14px; }
.mm-tuned { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--mc); }
.mm-tuned svg.i { width: 12px; height: 12px; stroke-width: 3; }
.ai-list { display: flex; flex-direction: column; gap: 8px; }
.ai-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: border-color .15s; }
.ai-row:hover { border-color: color-mix(in srgb, var(--mc) 60%, var(--line)); }
.ai-row .mm-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ai-row-text { flex: 1; min-width: 0; }
.ai-row-text b { display: block; font-size: 14.5px; }
.ai-row-text small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-row > svg.i { color: var(--faint); width: 16px; height: 16px; }
.ai-chip { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; color: var(--mc); background: color-mix(in srgb, var(--mc) 15%, transparent); white-space: nowrap; }
.pack { flex-wrap: wrap; }
.pack-extra { order: 3; width: 100%; font-size: 12.5px; font-weight: 800; color: #7be2b3; margin-top: -2px; }
.go-on.pulse { color: #fff; animation: goPulse 1.2s ease-in-out 3; }
@keyframes goPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(129,140,248,.0); background: rgba(255,255,255,.06); } 50% { box-shadow: 0 0 0 6px rgba(129,140,248,.25); background: rgba(129,140,248,.35); } }

/* ---------- view the chat background (phones) ---------- */
.bg-peek { display: none; }
@media (max-width: 820px) {
  .thread { position: relative; }
  .thread.with-bg .bg-peek:not([hidden]) {
    display: grid; place-items: center; position: absolute; z-index: 6; right: 12px; top: calc(76px + var(--safe-t));
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14);
    background: rgba(14,12,18,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: rgba(255,255,255,.85);
  }
  .bg-peek svg.i { width: 17px; height: 17px; }
}
.bg-view { position: fixed; inset: 0; z-index: 90; background: #000; display: grid; place-items: center; animation: bgvIn .18s ease-out; cursor: zoom-out; }
.bg-view.out { opacity: 0; transition: opacity .18s; }
.bgv-blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(30px) brightness(.45); }
.bg-view img { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; }
.bgv-x { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; background: rgba(0,0,0,.45); color: #fff; }
.bgv-hint { position: absolute; bottom: calc(18px + var(--safe-b)); left: 50%; transform: translateX(-50%); font-size: 12.5px; color: rgba(255,255,255,.7); background: rgba(0,0,0,.4); padding: 6px 12px; border-radius: 999px; white-space: nowrap; animation: hintFade 3s forwards; }
@keyframes bgvIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes hintFade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- chat look (customizable in Look) ---------- */
.msg .bubble { font-size: var(--chat-font, 15px); line-height: 1.5; padding: 10px 15px; box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 6px 18px -10px rgba(0,0,0,.45); }
.msg.user .bubble { background: var(--ub, linear-gradient(135deg, rgba(240,112,95,.88), rgba(129,140,248,.88))); background-attachment: fixed; }
.msg.character .bubble, .thread.with-bg .msg.character .bubble { background: var(--cb, rgba(38,33,47,.88)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.05); }
.msg.user .bubble { border: 1px solid rgba(255,255,255,.08); }
.dms .thread.with-bg::before { background: linear-gradient(180deg, rgba(14,12,18,var(--bg-dim, .5)), rgba(14,12,18,min(1, calc(var(--bg-dim, .5) + .12)))); }
.thread.with-bg .ts { display: table; margin-left: auto; margin-right: auto; padding: 3px 10px; border-radius: 999px; background: rgba(14,12,18,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: rgba(255,255,255,.65); }
.thread.with-bg .thread-intro small, .thread.with-bg .ai-disclose { text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.msg.editing .bubble { box-shadow: none; }

/* message buttons: always visible (subtle) unless turned off in Look */
.msg-tools { opacity: .55; }
.msg:hover .msg-tools { opacity: 1; }
.dms.tools-hover .msg-tools { opacity: 0; }
.dms.tools-hover .msg:hover .msg-tools { opacity: 1; }
.thread.with-bg .msg-tools svg.i { color: rgba(255,255,255,.7); filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
@media (max-width: 820px) {
  .msg { flex-wrap: wrap; }
  .msg-tools, .msg.tools-on .msg-tools { display: flex; opacity: .7; order: 5; width: 100%; justify-content: flex-end; margin-top: 1px; gap: 2px; padding-left: 0; }
  .msg.character .msg-tools { justify-content: flex-start; padding-left: 36px; }
  .msg-tools button { width: 30px; height: 28px; }
  .msg-tools svg.i { width: 15px; height: 15px; }
  .dms.tools-hover .msg-tools { display: none; }
  .dms.tools-hover .msg.tools-on .msg-tools { display: flex; opacity: 1; }
}

/* no accidental zoom in chats (phones) */
.no-zoom, .no-zoom body { touch-action: pan-x pan-y; }

/* Look window */
.modal:has(.look-modal) { max-width: 520px; }
.look-modal > p { color: var(--muted); margin: 4px 0 14px; }
.look-prev { padding: 14px 12px; border-radius: 16px; margin-bottom: 12px; background: linear-gradient(160deg, #2a1f3a, #1a1424 60%, #3a2030); display: flex; flex-direction: column; gap: 6px; }
.look-prev .msg { margin: 0; }
.look-prev .bubble { max-width: 80%; }
.len-range.plain { --mc: #818cf8; --cap: 100%; }
.sw-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.12); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.sw:hover { transform: scale(1.08); }
.sw.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #fff; }
.look-toggles { display: flex; flex-direction: column; gap: 12px; }
.look-toggles .pure-row { padding: 0; border: 0; background: none; }
.cs-look { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin: 4px 0 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); color: var(--text); }
.cs-look:hover { border-color: #3f4c62; }
.cs-look span { flex: 1; display: flex; flex-direction: column; }
.cs-look small { color: var(--muted); font-size: 12.5px; }
.cs-look > svg.i:last-child { width: 16px; height: 16px; color: var(--faint); }
.chat-tools.in-panel { grid-template-columns: repeat(2, 1fr); }
.look-toggles .pure-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; }

/* ---------- length presets ---------- */
.len-chosen { display: flex; flex-direction: column; margin: 2px 0 10px; }
.len-chosen b { font-size: 15px; color: var(--mc); }
.len-chosen i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.len-ticks span.locked { opacity: .35; }

/* ---------- Talewisp+ passes + memory ---------- */
.interval.pass-toggle { display: flex; gap: 4px; width: auto; max-width: 420px; margin: 0 auto; }
.interval.pass-toggle button { flex: 1; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 9px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.interval.pass-toggle button.on { background: var(--grad); color: #fff; }
.interval.pass-toggle button i { font-style: normal; font-size: 11px; opacity: .85; }
.pass-note { text-align: center; color: var(--faint); font-size: 12.5px; margin: 10px 0 18px; }
.memory-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin-bottom: 26px; }
.memory-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.55; }
.memory-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.memory-card li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.memory-card li svg.i { color: #7be2b3; width: 17px; height: 17px; flex: none; margin-top: 2px; }
.memory-card b { color: var(--text); }

/* ---------- segmented controls ---------- */
.seg { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13.5px; padding: 8px 16px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--grad); color: #fff; }
.g-seg button, .vis-seg button { flex: 1; }

/* ---------- admin extras ---------- */
.admin-tabs { flex-wrap: wrap; }
.admin-tabs .mini-count { margin-left: 5px; }
.admin-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-bottom: 14px; }
.admin-search input { flex: 1; border: 0; background: none; outline: none; padding: 12px 0; color: var(--text); font-size: 15px; }
.admin-search svg.i { color: var(--faint); }
.admin-users { display: flex; flex-direction: column; gap: 8px; }
.admin-user { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; }
.admin-user .au-who { min-width: 0; }
.admin-user .au-who b { display: block; font-size: 14px; }
.admin-user .au-who small { color: var(--muted); font-size: 12.5px; }
.admin-user > svg.i { color: var(--faint); }
.bg-review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.bg-review { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.bgr-img { aspect-ratio: 3/4; background-size: cover; background-position: center; }
.bgr-info { padding: 10px 12px 0; }
.bgr-info b { font-size: 14px; } .bgr-info small { display: block; color: var(--muted); font-size: 12px; }
.bgr-acts { display: flex; gap: 8px; padding: 10px 12px 12px; }
.bgr-acts .btn { flex: 1; }
.log-view { display: flex; flex-direction: column; gap: 8px; }
.log-msg { display: flex; flex-direction: column; gap: 2px; max-width: 80%; }
.log-msg.user { align-self: flex-end; align-items: flex-end; }
.log-role { font-size: 11px; color: var(--faint); font-weight: 700; padding: 0 4px; }
.log-bubble { padding: 9px 13px; border-radius: 14px; background: var(--raised); font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.log-msg.user .log-bubble { background: linear-gradient(135deg, #22c3b0, #818cf8); color: #fff; }

/* ---------- support modal ---------- */
.support-modal > p { color: var(--muted); margin: 4px 0 0; }

/* ---------- AI creator ---------- */
.ac-images { display: flex; gap: 12px; margin-bottom: 16px; }
.ac-av, .ac-bg { border: 1.5px dashed var(--line); border-radius: 16px; background: var(--surface); color: var(--muted); overflow: hidden; cursor: pointer; display: grid; place-items: center; position: relative; }
.ac-av { width: 110px; height: 110px; border-radius: 50%; flex: none; }
.ac-bg { flex: 1; height: 110px; }
.ac-av img, .ac-bg img { width: 100%; height: 100%; object-fit: cover; }
.ac-av span, .ac-bg span { display: grid; justify-items: center; gap: 4px; font-size: 12px; }
.ac-av svg.i, .ac-bg svg.i { width: 24px; height: 24px; }
.ac-mature { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-size: 14px; }
.ac-mature input { width: 18px; height: 18px; }
.ai-create .len-seg, .ai-create .g-seg, .ai-create .vis-seg { width: 100%; }
.ac-made { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ac-made h2 { margin: 0; font-size: 20px; }
.ac-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin-bottom: 16px; }
.ac-card b { display: block; } .ac-card small { color: var(--muted); font-size: 12.5px; }
.ac-greeting { padding: 14px 16px; border-radius: 16px; background: var(--raised); line-height: 1.55; white-space: pre-wrap; }
.ac-greeting em { color: #aab6c8; font-style: italic; }
.ac-regen { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 12px; }

/* ---------- misc ---------- */
.preview-note { display: flex; gap: 10px; align-items: flex-start; background: rgba(91,140,255,.1); border: 1px solid rgba(91,140,255,.25); border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; font-size: 13.5px; line-height: 1.5; }
.preview-note svg.i { color: #9ab9ff; flex: none; margin-top: 2px; }
.bg-pending-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 12.5px; color: #ffd58a; background: rgba(255,196,87,.08); border-radius: 10px; padding: 9px 11px; line-height: 1.45; }
.bg-pending-note svg.i { flex: none; margin-top: 1px; }
.phone-only { display: none; }
@media (max-width: 820px) { .phone-only { display: flex; } }

/* ---------- rotate guard (phones in landscape) ---------- */
.rotate-note { display: none; position: fixed; inset: 0; z-index: 999; background: var(--bg); color: var(--text); place-items: center; text-align: center; padding: 24px; }
.rotate-note > div { display: grid; justify-items: center; gap: 8px; }
.rotate-note svg.i { width: 40px; height: 40px; color: var(--accent-2); transform: rotate(90deg); }
.rotate-note b { font-size: 18px; } .rotate-note p { color: var(--muted); margin: 0; }
@media (max-width: 920px) and (orientation: landscape) and (max-height: 560px) {
  .rotate-note { display: grid; }
}
.ac-refs { display: flex; flex-wrap: wrap; gap: 10px; }
.ac-ref { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.ac-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-ref button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ac-ref button svg.i { width: 12px; height: 12px; }
.ac-ref.add { display: grid; place-items: center; border-style: dashed; color: var(--muted); cursor: pointer; }

/* sidebar create buttons: aligned with the menu icons; AI one is secondary */
.nav .create-btn { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.nav .create-btn .btn { justify-content: flex-start; gap: 14px; padding: 0 12px; height: 46px; margin: 0; font-size: 15px; }
.nav .create-btn .btn svg.i { width: 22px; height: 22px; flex: none; }
.nav .create-btn .btn.create-ai-btn { background: rgba(129,140,248,.1); color: var(--text); border: 1px solid rgba(129,140,248,.32); box-shadow: none; }
.nav .create-btn .btn.create-ai-btn:hover { background: rgba(129,140,248,.18); filter: none; }
.nav .create-btn .btn.create-ai-btn svg.i { color: #a5b4fc; }
@media (max-width: 1240px) and (min-width: 821px) {
  .nav .create-btn .btn { justify-content: center; padding: 0; }
}
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-pick button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 650; font-size: 13.5px; padding: 8px 13px; border-radius: 999px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.chips-pick button:hover { border-color: #3f4c62; color: var(--text); }
.chips-pick button.on { background: rgba(129,140,248,.18); border-color: #818cf8; color: #fff; }
.rel-other { margin-top: 10px; }
.story-opts { display: flex; flex-direction: column; gap: 10px; }
.yn-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.yn-line b { font-size: 14px; font-weight: 600; }
.yn-seg { flex: none; }
.yn-seg button { padding: 6px 14px; }

/* ---------- chat side panel: show the whole background, no cropping ---------- */
.art-blur { position: absolute; inset: -40px; z-index: -3; background-size: cover; background-position: center; filter: blur(30px) brightness(.55) saturate(1.2); }
.art-img.art-fit { object-fit: contain; object-position: center top; }

/* chat tools: 5 buttons */
.chat-tools { flex-wrap: wrap; }
.chat-tools.in-panel .tool-btn:last-child:nth-child(odd) { grid-column: span 2; }

/* ---------- Create with AI: background panel at the side on PC ---------- */
.ac-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; align-items: start; }
.ac-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 8px; }
.ac-side-label { font-weight: 700; font-size: 14px; }
.ac-side small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.ac-bg { position: relative; }
.ac-bg-side { width: 100%; aspect-ratio: 3 / 4; height: auto; flex: none; }
.ac-bg-inline { display: none; }
.ac-bg img { width: 100%; height: 100%; object-fit: cover; }
.ac-bg-edit { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex !important; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; }
.ac-images { align-items: flex-end; }
@media (max-width: 820px) {
  .ac-layout { display: block; }
  .ac-side { display: none; }
  .ac-bg-inline { display: grid; flex: none; width: 112px; height: 150px; }
  .ac-images { gap: 14px; }
}

/* reply length: word count */
.len-chosen b em { font-style: normal; font-weight: 700; font-size: 12.5px; color: var(--muted); margin-left: 6px; }

/* ---------- Memory window ---------- */
.modal:has(.mem-modal) { max-width: 520px; }
.mem-modal > p { color: var(--muted); margin: 4px 0 14px; line-height: 1.5; }
.mem-bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.mem-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.mem-track { position: relative; height: 10px; border-radius: 99px; background: rgba(255,255,255,.06); margin: 6px 8px 0; }
.mem-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--grad); }
.mem-tick { position: absolute; top: -4px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mem-tick i { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid rgba(255,255,255,.25); }
.mem-tick.ok i { border-color: #818cf8; }
.mem-tick.mine i { background: #fff; border-color: #818cf8; box-shadow: 0 0 0 4px rgba(129,140,248,.25); }
.mem-tick b { font-size: 11.5px; white-space: nowrap; }
.mem-tick small { font-size: 11px; color: var(--muted); }
.mem-tick.locked b, .mem-tick.locked small { opacity: .5; }
.mem-tips { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 6px; }
.mem-tips div { display: flex; gap: 9px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.mem-tips svg.i { color: #7be2b3; flex: none; width: 16px; height: 16px; margin-top: 2px; }
.mem-tips b { color: var(--text); }
.mem-sum { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.mem-sum summary { cursor: pointer; padding: 10px 12px; font-weight: 700; font-size: 13.5px; }
.mem-sum div { padding: 0 12px 12px; white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--muted); max-height: 260px; overflow-y: auto; }
/* daily free replies counter */
.daily-left { font-size: 12.5px; color: var(--muted); text-align: center; padding: 6px 10px; margin: 0 auto 8px; width: fit-content; border-radius: 999px; background: rgba(255,255,255,.05); }
.daily-left.out { color: #ffd58a; background: rgba(255,196,87,.1); }
.thread.with-bg .daily-left { background: rgba(14,12,18,.6); backdrop-filter: blur(8px); }
/* early access label */
.mm-cost.early { background: rgba(129,140,248,.16); color: #a5b4fc; display: inline-flex; align-items: center; gap: 4px; }
.mm-cost.early svg.i { width: 12px; height: 12px; }
/* small plan badge next to creator names */
.plan-badge.sm { font-size: 10.5px; padding: 1px 6px; vertical-align: 1px; }
/* paid avatar ring on profile */
.av-ring { display: inline-flex; border-radius: 50%; padding: 3px; flex: none; }
.av-ring.ring-basic { background: linear-gradient(135deg, #5b8cff, #9ab9ff); }
.av-ring.ring-pro { background: var(--grad); box-shadow: 0 0 24px -4px rgba(56,189,248,.55); }
.av-ring .av { border: 3px solid var(--bg); }
/* premium bubble colors */
.sw.locked { display: grid; place-items: center; opacity: .55; color: #fff; }
.sw.locked svg.i { width: 13px; height: 13px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.small-label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
/* character page buttons on phones: Open chat full width, the rest share a row */
@media (max-width: 820px) {
  .cprofile .actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
  .cprofile .actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap; height: 46px; padding: 0 12px; }
  .cprofile .actions [data-msg] { flex-basis: 100%; }
  .cprofile .actions .icon-only { flex: 0 0 46px; padding: 0; }
}

/* ---------- checkout: choose how to pay ---------- */
.pay-pick h3 { margin: 0 0 14px; }
.pay-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; padding: 13px 15px; margin-bottom: 9px; border-radius: 14px; border: 1px solid var(--line, rgba(255,255,255,.12)); background: rgba(255,255,255,.04); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-opt:hover { border-color: var(--accent, #a78bfa); background: rgba(45,212,191,.08); }
.pay-opt b { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.pay-opt small { opacity: .65; font-size: 12.5px; }

/* ---------- support page ---------- */
.sup-form { padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-soft); margin-bottom: 8px; }
.sup-cats { margin-bottom: 14px; flex-wrap: wrap; }
.sup-form .chip svg.i, .sup-cats .chip svg.i { width: 15px; height: 15px; margin-right: 5px; }
.sup-form [data-methods] { flex-wrap: wrap; margin-top: 6px; }
.sup-hint { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(45,212,191,.08); color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.sup-card.sup-new { border-color: rgba(45,212,191,.45); }
.sup-status { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 12px; font-weight: 700; }
.sup-status.open { color: #ffc457; }
.sup-status.done { background: rgba(80,200,140,.14); color: #6fdca4; }
.sup-status.pay { background: rgba(45,212,191,.15); color: #a5b4fc; }
.sup-thread { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sup-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; background: var(--raised); }
.sup-msg.team { align-self: flex-start; background: rgba(45,212,191,.13); border: 1px solid rgba(45,212,191,.22); }
.sup-msg.me { align-self: flex-end; }
.sup-msg span { display: block; font-size: 11.5px; color: var(--faint); margin-bottom: 3px; }
.sup-msg p { margin: 0; white-space: pre-wrap; line-height: 1.5; font-size: 14px; overflow-wrap: anywhere; }
.sup-reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.sup-reply .textarea { flex: 1; min-height: 0; resize: vertical; }
.sup-tabs { margin-bottom: 14px; display: inline-flex; }
.alt-pay { display: flex; align-items: center; gap: 14px; max-width: 680px; margin: 26px auto 0; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px dashed rgba(45,212,191,.4); color: inherit; text-decoration: none; }
.alt-pay:hover { border-style: solid; }
.alt-pay > svg.i:first-child { flex: none; width: 22px; height: 22px; color: #a5b4fc; }
.alt-pay div { flex: 1; min-width: 0; }
.alt-pay b { display: block; font-size: 15px; }
.alt-pay small { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .sup-msg { max-width: 100%; } .sup-reply { flex-direction: column; align-items: stretch; } }
.sup-reply > :first-child { flex: 1; min-width: 0; width: 100%; }
.sup-reply .textarea { width: 100%; }
.sup-tabs { width: 220px; margin: 0 0 14px; }
.pay-opt.alt { border-style: dashed; }
.pay-tip { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255,196,87,.08); color: var(--muted); font-size: 12.5px; line-height: 1.5; text-align: left; }
.pay-tip svg.i { flex: none; width: 15px; height: 15px; margin-top: 2px; color: #ffc457; }
.pay-tip b { color: var(--text); }
/* free hourly stars line on Talewisp+ */
.free-line { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 2px; font-size: 13px; color: var(--muted); }
.free-line b { color: var(--text); }
.free-line svg.i { width: 14px; height: 14px; }
.free-line > svg.i:first-child { color: #a5b4fc; }
.free-line i { display: inline-flex; opacity: .6; cursor: help; }
/* admin: AI rules */
.rules-form .textarea { min-height: 300px; font-size: 14px; line-height: 1.55; }
.rules-hint { margin: 6px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.rules-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rules-acts > span { flex: 1; }

/* ---------- Talewisp+ mark ---------- */
.plus-mark { display: inline-block; width: .62em; height: .62em; margin-left: .08em; vertical-align: .55em; flex: none; filter: drop-shadow(0 1px 6px rgba(56,189,248,.35)); }
.nav a.plus-link span.plus-label { gap: 0 !important; align-items: flex-start !important; }
.nav a.plus-link .plus-mark { width: 12px; height: 12px; margin: -3px 0 0 2px; vertical-align: 0; }
.plus-title { display: inline-flex; align-items: flex-start; }
.plus-title .plus-mark { width: .55em; height: .55em; margin: .02em 0 0 .06em; vertical-align: 0; }

/* ---------- reply length example + creativity ---------- */
.len-sample { position: relative; margin: 2px 0 14px; padding: 12px 14px 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); }
.ls-tag { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--faint); }
.ls-text { max-height: 168px; overflow-y: auto; font-size: 13.5px; line-height: 1.55; color: #d3dce8; overscroll-behavior: contain; }
.ls-text p { margin: 0 0 8px; } .ls-text p:last-child { margin-bottom: 0; }
.ls-text em, .ls-text i { color: #a7b3c4; }
.cr-wrap::after { display: none; }

/* ---------- admin: paused accounts ---------- */
.admin-user.is-locked { border-color: rgba(255,93,108,.35); background: rgba(255,93,108,.05); }
.lock-tag { font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(255,93,108,.18); color: #ff8d98; margin-left: 4px; vertical-align: 1px; }
.lock-why { display: block; color: #ff8d98 !important; margin-top: 2px; }
.au-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .admin-user { flex-wrap: wrap; } .au-acts { width: 100%; justify-content: flex-start; } }
.ls-text { white-space: pre-line; }
@media (max-width: 640px) {
  .len-ticks.many span:not(:first-child):not(:last-child) { visibility: hidden; }
}
/* admin: review tab "!" */
.bang { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #ffc457; color: #1a1408; font-style: normal; font-weight: 900; font-size: 12px; line-height: 1; flex: none; }
.bang.big { width: 30px; height: 30px; font-size: 17px; }
.review-card { border-color: rgba(255,196,87,.25); }
.review-stats { color: var(--muted) !important; font-size: 13.5px; }
.interval.pass-toggle a { color: var(--muted); text-decoration: none; } .interval.pass-toggle a.on { background: var(--grad); color: #fff; }
.sup-status.blocked { background: rgba(255,93,108,.15); color: #ff8d98; }
.legal-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .legal-tabs::-webkit-scrollbar { display: none; } .legal-tabs a { white-space: nowrap; }
/* custom star amount */
.custom-pack { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -24px 0 40px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.cp-copy { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.cp-copy b { font-size: 15px; } .cp-copy small { color: var(--muted); font-size: 12.5px; }
.cp-input { display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; height: 40px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); font-weight: 800; }
.cp-input input { width: 64px; border: 0; background: none; outline: none; font-weight: 800; font-size: 15px; -moz-appearance: textfield; }
.cp-input input::-webkit-outer-spin-button, .cp-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cp-out { display: inline-flex; align-items: center; gap: 5px; min-width: 120px; font-size: 15px; }
.cp-out small { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .cp-out { flex: 1; } }
