:root {
  --bg: #fff7f8;
  --surface: #ffffff;
  --surface-2: #fdeef1;
  --text: #1f1a24;
  --muted: #7a6f80;
  --line: #f1dde2;
  --accent: #ff4d6d;
  --accent-2: #ff8fa3;
  --accent-ink: #ffffff;
  --me: #ff4d6d;
  --me-ink: #ffffff;
  --them: #f3eef5;
  --them-ink: #1f1a24;
  --ok: #22c55e;
  --shadow: 0 10px 30px rgba(255, 77, 109, .12);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14111a; --surface: #1d1925; --surface-2: #26202f; --text: #f3eef7; --muted: #a49bb0;
    --line: #2f2839; --them: #2a2434; --them-ink: #f3eef7; --shadow: 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #14111a; --surface: #1d1925; --surface-2: #26202f; --text: #f3eef7; --muted: #a49bb0;
  --line: #2f2839; --them: #2a2434; --them-ink: #f3eef7; --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10;
}
.logo { font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -.02em; }
.logo b { color: var(--accent); }
.top-right { display: flex; gap: 8px; align-items: center; }
.online { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-right: 4px; }
.online i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }

.view { display: none; }
.view.active { display: block; }
#chat.view.active { display: flex; }

/* Landing */
#landing { max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; width: 100%; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 24px 0 32px; }
.tag { display: inline-block; font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 6px 12px; border-radius: 999px; margin: 0 0 16px; }
h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -.03em; }
h1 em { font-style: normal; color: var(--accent); }
.sub { color: var(--muted); font-size: 17px; line-height: 1.55; margin: 0 0 20px; }
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.features li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

.demo { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; transform: rotate(1.5deg); }
.demo-head, .partner { display: flex; gap: 10px; align-items: center; }
.demo-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.demo-head small, .partner small { display: block; color: var(--muted); font-size: 12px; }
.ava { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; flex: none; }
.ava.big { width: 96px; height: 96px; font-size: 54px; }
.demo-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bub { max-width: 78%; padding: 9px 13px; border-radius: 18px; font-size: 14px; line-height: 1.4; position: relative; }
.bub.me { align-self: flex-end; background: var(--me); color: var(--me-ink); border-bottom-right-radius: 6px; }
.bub.them { align-self: flex-start; background: var(--them); color: var(--them-ink); border-bottom-left-radius: 6px; }
.rx { position: absolute; bottom: -10px; right: -6px; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 5px; }
.typing-demo, .typing { display: flex; gap: 4px; padding: 10px 14px; background: var(--them); border-radius: 18px; width: fit-content; }
.typing-demo i, .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing-demo i:nth-child(2), .typing i:nth-child(2) { animation-delay: .2s; }
.typing-demo i:nth-child(3), .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.setup { max-width: 560px; margin: 0 auto 24px; position: relative; }
.steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.steps span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); transition: .2s; }
.steps span.on { background: var(--accent); color: var(--accent-ink); }
.step { display: none; animation: fade .25s ease; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step h2 { text-align: center; margin: 0 0 20px; font-size: 22px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choices button { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 18px 8px; font-size: 15px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: .15s; }
.choices button:hover, .choices button.sel { border-color: var(--accent); background: var(--surface-2); }
.age-pick { display: flex; justify-content: center; align-items: center; gap: 14px; }
.age-pick input { width: 110px; text-align: center; font-size: 40px; font-weight: 800; border: none; background: transparent; color: var(--text); -moz-appearance: textfield; }
.age-pick input::-webkit-inner-spin-button { -webkit-appearance: none; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 24px; }
.hint { text-align: center; color: var(--muted); font-size: 13px; }
.btn { border: none; border-radius: 14px; padding: 12px 18px; font-weight: 700; background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn.big { width: 100%; padding: 16px; font-size: 17px; margin-top: 16px; }
.next-step { display: block; margin: 16px auto 0; min-width: 200px; }
.back-step { border: none; background: none; color: var(--muted); margin-top: 14px; font-size: 14px; }
.lbl { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: none; background: none; padding: 9px; border-radius: 9px; font-size: 14px; font-weight: 600; }
.seg button.sel { background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.08); color: var(--accent); }
.range2 { position: relative; height: 28px; }
.range2 input { position: absolute; width: 100%; top: 0; pointer-events: none; -webkit-appearance: none; appearance: none; background: none; height: 28px; margin: 0; }
.range2::before { content: ''; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 4px; background: var(--line); }
.range2 input::-webkit-slider-thumb { pointer-events: all; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer; position: relative; }
.range2 input::-moz-range-thumb { pointer-events: all; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); cursor: pointer; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tags button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.tags button.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.input { width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; outline: none; }
.input:focus { border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-top: 16px; color: var(--muted); }
.check input { accent-color: var(--accent); margin-top: 2px; }

.rules { max-width: 560px; margin: 0 auto; padding: 20px 24px; box-shadow: none; }
.rules h3 { margin: 0 0 8px; }
.rules p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 6px 0; }
.foot { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; color: var(--muted); font-size: 13px; margin-top: 32px; }

/* Chat */
#chat { flex: 1; flex-direction: column; max-width: 820px; width: 100%; margin: 0 auto; min-height: 0; height: calc(var(--app-h, 100dvh) - 61px); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.partner { flex: 1; min-width: 0; }
.icon-btn { border: none; background: var(--surface-2); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex: none; }
.icon-btn.off { background: #ef4444; }

.media { position: relative; background: #000; aspect-ratio: 16 / 9; max-height: 45dvh; width: 100%; flex: none; }
#remote-video { width: 100%; height: 100%; object-fit: cover; background: #111; }
#local-video { position: absolute; right: 12px; bottom: 12px; width: 28%; max-width: 180px; border-radius: 12px; border: 2px solid rgba(255,255,255,.5); transform: scaleX(-1); background: #222; }
.voice-viz { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, #2a1235, #4a1530); }
.voice-viz .ava { position: relative; z-index: 1; }
.pulse { position: absolute; width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--accent-2); animation: pulse 1.8s infinite; }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(2); opacity: 0; } }
.media-ctrl { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; }
.media-ctrl .icon-btn { background: rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.media-ctrl .icon-btn.off { background: #ef4444; }

.messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 6px; }
.sys { align-self: center; text-align: center; color: var(--muted); font-size: 13px; background: var(--surface-2); padding: 8px 14px; border-radius: 12px; margin: 6px 0; max-width: 90%; line-height: 1.5; }
.sys .common { display: block; margin-top: 4px; color: var(--accent); font-weight: 600; }
.searching { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: auto; color: var(--muted); }
.searching .radar { width: 70px; height: 70px; border-radius: 50%; border: 3px solid var(--accent); position: relative; display: grid; place-items: center; font-size: 30px; }
.searching .radar::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--accent); animation: pulse 1.5s infinite; }

.msg { display: flex; flex-direction: column; max-width: 78%; position: relative; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; align-items: flex-start; }
.msg .bub { max-width: 100%; word-wrap: break-word; white-space: pre-wrap; }
.msg.me .bub { background: var(--me); color: var(--me-ink); border-bottom-right-radius: 6px; }
.msg.them .bub { background: var(--them); color: var(--them-ink); border-bottom-left-radius: 6px; }
.msg.has-rx { margin-bottom: 10px; }
.msg .quote { font-size: 12px; opacity: .8; border-left: 3px solid currentColor; padding: 2px 8px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.msg img { max-width: 240px; max-height: 300px; border-radius: 12px; display: block; cursor: pointer; }
.msg img.blur { filter: blur(18px); }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 2px; padding: 0 4px; }
.msg .tools { position: absolute; top: 50%; transform: translateY(-50%); display: none; gap: 2px; }
.msg.me .tools { right: 100%; padding-right: 6px; }
.msg.them .tools { left: 100%; padding-left: 6px; }
.msg:hover .tools, .msg.show-tools .tools { display: flex; }
.msg .tools button { border: none; background: var(--surface-2); border-radius: 8px; width: 30px; height: 30px; font-size: 14px; }
.msg .rx { cursor: pointer; }
.msg.me .rx { right: auto; left: -6px; }

.typing { position: absolute; left: 16px; bottom: 8px; margin: 0; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.reply-bar > div { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 10px; }
.reply-bar small { color: var(--accent); font-weight: 600; }
.reply-bar p { margin: 2px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.composer .input { flex: 1; min-width: 0; }
.btn.next { background: var(--text); color: var(--bg); }
.btn.next.confirm { background: #ef4444; color: #fff; }
.attach { cursor: pointer; }
.send { width: 48px; padding: 0; font-size: 18px; }

.reaction-picker { position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; display: flex; gap: 2px; box-shadow: var(--shadow); }
.reaction-picker button { border: none; background: none; font-size: 20px; width: 38px; height: 38px; border-radius: 50%; }
.reaction-picker button:hover { background: var(--surface-2); transform: scale(1.15); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); border-radius: 20px; padding: 24px; max-width: 520px; width: 100%; max-height: 85dvh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-box h3 { margin-top: 0; padding-right: 40px; }
.modal-box p, .modal-box li { color: var(--muted); line-height: 1.6; font-size: 14px; }
.modal-box .reasons { display: flex; flex-direction: column; gap: 8px; }
.modal-box .reasons button { text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.modal-box .reasons button:hover { border-color: var(--accent); }

.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 200; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .demo { transform: none; max-width: 420px; }
  .card { padding: 22px 16px; }
  .msg { max-width: 85%; }
  .online span[data-i18n] { display: none; }
}
@media (max-width: 420px) {
  .features { grid-template-columns: 1fr; }
  .choices button { padding: 14px 4px; font-size: 14px; }
  .btn.next { padding: 12px; }
}

/* Bolzoo+ */
.chip.plus { background: linear-gradient(135deg, #ffb703, #ff4d6d); color: #fff; border: none; }
.chip.plus.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #ffb703; }
.badge { font-size: 14px; }
.seg button.lockable.locked::after { content: ' 🔒'; font-size: 11px; }
.plans { display: grid; gap: 10px; margin: 16px 0; }
.plan { display: flex; align-items: center; justify-content: space-between; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 16px; text-align: left; }
.plan:hover, .plan.sel { border-color: var(--accent); background: var(--surface-2); }
.plan b { font-size: 16px; }
.plan .price { font-weight: 800; color: var(--accent); }
.plan .save { font-size: 11px; background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.perks { list-style: none; padding: 0; margin: 0; }
.perks li { padding: 4px 0; }
.pay-box { text-align: center; }
.pay-box .qr { width: 220px; height: 220px; border-radius: 14px; background: #fff; padding: 8px; margin: 8px auto; display: block; }
.pay-box .amount { font-size: 22px; font-weight: 800; }
.bank-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 14px; }
.bank-list a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; text-decoration: none; color: var(--muted); text-align: center; }
.bank-list img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.pay-status { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 10px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.only-mobile { display: none; }
@media (pointer: coarse) { .only-mobile { display: block; } }

/* Contacts */
.contacts { max-width: 560px; margin: 0 auto 24px; padding: 20px 24px; box-shadow: none; }
.contacts h3 { margin: 0 0 12px; }
.contacts h3 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.contacts-list { display: flex; flex-direction: column; gap: 8px; }
.contact { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); }
.contact .ava { position: relative; }
.contact .ava i { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); border: 2px solid var(--surface-2); }
.contact .ava i.on { background: var(--ok); }
.contact .who { flex: 1; min-width: 0; }
.contact .who small { display: block; color: var(--muted); font-size: 12px; }
.contact .btn { padding: 8px 12px; font-size: 13px; }
.contact .icon-btn { width: 34px; height: 34px; font-size: 14px; background: none; }
#save-btn.saved { background: var(--accent); }
#save-btn.pending { box-shadow: 0 0 0 2px var(--accent) inset; }

/* GIF */
.icon-btn.gif { font-size: 12px; font-weight: 800; }
.gif-panel { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 12px; }
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; margin-top: 8px; }
.gif-grid img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; cursor: pointer; background: var(--surface-2); }
.giphy { display: block; text-align: right; color: var(--muted); font-size: 10px; margin-top: 4px; }
@media (max-width: 420px) { .chip.plus span { display: none; } }

/* Account */
.chip.account { display: inline-flex; align-items: center; gap: 6px; }
.chip.account[hidden] { display: none; }
.chip.account img { width: 20px; height: 20px; border-radius: 50%; margin: -2px 0; }
.account-box { text-align: center; }
.account-box .pic { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 8px; display: block; background: var(--surface-2); }
.account-box .email { color: var(--muted); font-size: 14px; }
#g-btn { display: flex; justify-content: center; margin: 16px 0 8px; min-height: 44px; }
.login-hint { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.login-hint a { color: var(--accent); font-weight: 600; cursor: pointer; }
@media (max-width: 420px) { .chip.account span { display: none; } }

.head-actions { display: flex; gap: 6px; }

/* Display name (legacy) */
.me-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: -6px 0 18px; background: var(--surface-2); border-radius: 16px; }
.me-ava { border: 2px solid transparent; width: 48px; height: 48px; font-size: 28px; cursor: pointer; background: var(--surface); }
.me-ava:hover { border-color: var(--accent); }
.me-name-wrap { flex: 1; min-width: 0; cursor: text; }
.me-name-wrap small { display: block; color: var(--muted); font-size: 12px; }
.me-name-row { display: flex; align-items: center; gap: 6px; }
.me-name { flex: 1; min-width: 0; border: none; border-bottom: 2px dashed transparent; background: none; color: var(--text); font: inherit; font-size: 18px; font-weight: 700; padding: 2px 0; outline: none; }
.me-name:hover, .me-name:focus { border-bottom-color: var(--accent); }
.me-name-row .pen { font-size: 13px; opacity: .6; }
.me-card .icon-btn { background: var(--surface); }
.ava-picker { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: -8px 0 16px; }
.ava-picker button { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-size: 22px; }
.ava-picker button.sel, .ava-picker button:hover { border-color: var(--accent); background: var(--surface-2); }
.saved-tag { color: var(--accent); font-weight: 600; }
.partner > div { min-width: 0; }
.partner b, .partner small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Persona */
.me-card { width: 100%; text-align: left; border: none; cursor: pointer; }
.me-card:hover { box-shadow: 0 0 0 2px var(--accent) inset; }
.me-card b { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-mood { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-chip { flex: none; }
.ava { color: #1f1a24; }
.ava.plus-ring { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #ffb703; }
.pe h3 { margin-bottom: 4px; }
.pe .sub { font-size: 14px; margin: 0 0 14px; }
.pe-preview { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 16px; padding: 12px; margin-bottom: 14px; }
.pe-preview .ava { width: 56px; height: 56px; font-size: 32px; }
.pe-preview b { display: block; font-size: 17px; }
.pe-preview small { color: var(--muted); display: block; font-size: 13px; }
.pe label.lbl { margin: 14px 0 6px; }
.pe .grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.pe .grid button { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 22px; padding: 0; position: relative; }
.pe .grid button.sel { border-color: var(--accent); background: var(--surface-2); }
.pe .grid button.locked { opacity: .55; }
.pe .grid button.locked::after { content: '🔒'; position: absolute; right: -4px; bottom: -4px; font-size: 11px; }
.pe .colors { display: flex; gap: 8px; flex-wrap: wrap; }
.pe .colors button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); padding: 0; }
.pe .colors button.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.pe .moods { display: flex; flex-wrap: wrap; gap: 6px; }
.pe .moods button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.pe .moods button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.pe .count { float: right; color: var(--muted); font-weight: 500; font-size: 12px; }
.pe .actions { display: flex; gap: 10px; margin-top: 18px; }
.pe .actions .btn { flex: 1; }
.pe .history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.pe .history h4 { margin: 0 0 8px; }
.pe .history div { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; color: var(--muted); }
.pe .history b { color: var(--text); }
.pe .history .paid { color: var(--ok); font-weight: 600; margin-left: 6px; }
@media (max-width: 420px) { .pe .grid { grid-template-columns: repeat(6, 1fr); } }

.sys .persona { display: block; margin-top: 6px; color: var(--text); }
.sys .persona i { font-style: normal; color: var(--muted); display: block; }
.searching .tip { max-width: 320px; text-align: center; font-size: 14px; line-height: 1.5; min-height: 3em; transition: opacity .3s; }
.searching .resp { font-size: 12px; color: var(--muted); max-width: 320px; text-align: center; border-top: 1px solid var(--line); padding-top: 10px; }
/* live queue while searching: makes a mode or filter mismatch obvious */
.wait-stats { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wait-stats small { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.wchips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.wchip { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.wchip b { font-variant-numeric: tabular-nums; }
.wchip.me { border-color: var(--accent); color: var(--text); cursor: default; }
.wchip.hot { border-color: var(--accent); color: var(--text); animation: pulse-chip 1.8s infinite; }
.wchip.wide { margin-top: 4px; font-size: 12px; }
.gsi-hint { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: left; }
.gsi-hint code { font-size: 12px; word-break: break-all; }
@keyframes pulse-chip { 50% { opacity: .55; } }

/* Chat scrolling: only the message list scrolls; the page itself stays put */
body.chat-open { height: var(--app-h, 100dvh); overflow: hidden; }
.msg-area { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages > :first-child { margin-top: auto; }
.jump-btn { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow); }
.msg.blocked .bub { background: #ef4444 !important; color: #fff; opacity: .6; text-decoration: line-through; }
.msg.blocked .meta { color: #ef4444; }
.sys.warn { background: color-mix(in srgb, #ef4444 15%, var(--surface)); color: #b91c1c; }
