/* =========================================================
   น้ำ's Wingman — ธีมมืดโรแมนติก ดำ-ม่วงเข้ม + ชมพู/magenta
   โครงไฟล์: ตัวแปรสี → พื้นหลัง → Header → Sidebar → Panel/แชท
            → Welcome → Composer → Dialog → Responsive
   ========================================================= */

:root {
  --bg: #07050a;
  --text: #f6eff3;
  --muted: #9b8e98;
  --pink: #ff5c8d;
  --pink-soft: #f08aa8;
  --magenta: #c2255c;
  --panel: rgba(16, 11, 18, .72);
  --card: rgba(24, 16, 26, .75);
  --ai-bubble: #242126;
  --ai-text: #f4eef2;
  --line: rgba(255, 92, 141, .30);
  --line-soft: rgba(255, 92, 141, .13);
  --user-from: #d63f6c;
  --user-to: #a3234f;
  --glow: 0 0 22px rgba(255, 70, 130, .28);
  --font: "Noto Sans Thai", "Sarabun", system-ui, sans-serif;
  --font-h: "Prompt", var(--font);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
[data-theme="light"] {
  --bg: #fff3f6;
  --text: #2b1622;
  --muted: #8a6f7b;
  --panel: rgba(255, 255, 255, .78);
  --card: rgba(255, 255, 255, .85);
  --ai-bubble: #ffffff;
  --ai-text: #2b1622;
  --line: rgba(214, 63, 108, .35);
  --line-soft: rgba(214, 63, 108, .16);
  --glow: 0 0 18px rgba(214, 63, 108, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { fill: none; }
svg use { pointer-events: none; }
.pink { color: var(--pink); }
.muted { color: var(--muted); }
.ic { width: 1em; height: 1em; vertical-align: -.12em; color: var(--pink); }
.ic.red { color: #ff3b5c; }
[hidden] { display: none !important; }

/* ---------- พื้นหลัง: แสงฟุ้ง + กุหลาบ + กลีบ ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.bg-glow { position: absolute; border-radius: 50%; filter: blur(80px); }
.bg-glow-1 { width: 60vw; height: 60vw; left: -20vw; top: -25vw; background: radial-gradient(circle, rgba(130, 30, 110, .45), transparent 65%); }
.bg-glow-2 { width: 55vw; height: 40vw; right: -15vw; top: 8vh; background: radial-gradient(circle, rgba(255, 40, 110, .28), transparent 65%); transform: rotate(-20deg); }
.bg-rose { position: absolute; width: 38vw; height: 38vw; bottom: -14vw; filter: blur(14px); opacity: .9;
  background:
    radial-gradient(circle at 40% 45%, #9b1d4a 0 9%, #5d0f2c 10% 20%, transparent 21%),
    radial-gradient(circle at 62% 60%, #7a1238 0 10%, #3d0a1e 11% 24%, transparent 25%),
    radial-gradient(circle at 28% 68%, #6b1030 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, rgba(140, 20, 70, .5), transparent 62%); }
.bg-rose-l { left: -12vw; }
.bg-rose-r { right: -12vw; transform: scaleX(-1); opacity: .65; }
.bg-ghost { position: absolute; left: -4vw; top: 6vh; height: 78vh; opacity: 0; filter: blur(3px) saturate(.6);
  -webkit-mask-image: linear-gradient(90deg, #000 20%, transparent 85%); mask-image: linear-gradient(90deg, #000 20%, transparent 85%);
  transition: opacity .8s; }
.welcome .bg-ghost { opacity: .14; }
[data-theme="light"] .bg-glow-1 { background: radial-gradient(circle, rgba(255, 150, 190, .5), transparent 65%); }
[data-theme="light"] .bg-rose { opacity: .35; }

.petals { position: absolute; inset: 0; }
.petal { position: absolute; top: -40px; width: 14px; height: 18px; border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, #ff6b9a, #b3194f); opacity: 0; will-change: transform, opacity;
  animation: fall linear infinite; }
@keyframes fall {
  0%   { transform: translate3d(0, -5vh, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: .55; }
  100% { transform: translate3d(var(--dx, 60px), 108vh, 0) rotate(var(--rot, 540deg)); opacity: .05; }
}

/* ---------- โครงหน้าหลัก ---------- */
.app { position: relative; z-index: 1; height: 100%; height: 100dvh; display: flex; flex-direction: column; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; gap: 20px; padding: 0 20px 14px 20px; }

/* ---------- Header ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 24px 10px; position: relative; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-soft), transparent); opacity: 0; transition: opacity .4s; }
.welcome .topbar::after { opacity: 1; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand h1 { margin: 0; font: 500 30px/1.1 var(--font-h); letter-spacing: .2px; white-space: nowrap; }
.status { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); opacity: .9; }
.dot { width: 13px; height: 13px; border-radius: 50%; background: #2ee66a; box-shadow: 0 0 10px #2ee66a; display: inline-block; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.tagline { font-style: italic; color: var(--pink); font-size: 18px; text-shadow: 0 0 18px rgba(255, 70, 130, .4); }
.vsep { width: 1px; height: 34px; background: var(--line-soft); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; transition: background .2s; }
.icon-btn:hover { background: rgba(255, 92, 141, .12); }
.icon-btn svg { width: 26px; height: 26px; color: var(--text); }
.crown-top { width: 30px; height: 30px; color: #f6b95e; filter: drop-shadow(0 0 8px rgba(246, 185, 94, .5)); }
.only-drawer { display: none; }

.theme-toggle { position: relative; width: 66px; height: 32px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.theme-toggle svg { width: 16px; height: 16px; color: var(--muted); z-index: 1; }
.theme-toggle .knob { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--pink); box-shadow: var(--glow); transition: transform .3s cubic-bezier(.4, 1.4, .5, 1); }
[data-theme="light"] .theme-toggle .knob { transform: translateX(34px); }

/* ---------- Avatar ---------- */
.avatar { position: relative; flex: none; border-radius: 50%; border: 2px solid var(--pink); box-shadow: 0 0 0 3px rgba(255, 92, 141, .12), var(--glow); background: #16101a; }
.avatar .av-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .crown { position: absolute; width: 38%; height: 38%; right: -10%; top: -14%; color: var(--pink-soft); filter: drop-shadow(0 0 5px rgba(255, 92, 141, .6)); transform: rotate(14deg); }
.avatar-md { width: 106px; height: 106px; margin: -4px 0 -34px; z-index: 3; }
.avatar-sm { width: 66px; height: 66px; border-width: 1.5px; }
.avatar-xl { width: 240px; height: 240px; border-width: 3px; box-shadow: 0 0 0 6px rgba(255, 92, 141, .1), 0 0 50px rgba(255, 70, 130, .45); }
.avatar-xl .crown { width: 26%; height: 26%; right: -2%; top: -10%; color: #f6a8c0; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 18px; min-height: 0; padding-top: 40px; }
.nav { display: flex; flex-direction: column; gap: 9px; }
.nav-item { display: flex; align-items: center; gap: 18px; padding: 13px 22px; border-radius: 14px; font-size: 18px; color: var(--text); opacity: .86; text-align: left; transition: background .2s, opacity .2s, transform .2s; }
.nav-item svg { width: 26px; height: 26px; flex: none; }
.nav-item:hover { opacity: 1; background: rgba(255, 92, 141, .08); }
.nav-item.active { color: var(--pink); opacity: 1; background: linear-gradient(90deg, rgba(214, 63, 108, .45), rgba(214, 63, 108, .12)); border: 1px solid var(--line); box-shadow: var(--glow); }

.card { border-radius: 18px; background: var(--card); border: 1px solid var(--line-soft); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.love-card { padding: 18px 18px 14px; }
.love-title { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.love-row { display: flex; align-items: center; gap: 12px; }
.love-heart { width: 26px; height: 26px; color: var(--pink); filter: drop-shadow(0 0 6px rgba(255, 70, 130, .6)); flex: none; }
.bar { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
[data-theme="light"] .bar { background: rgba(0, 0, 0, .08); }
.bar i { display: block; height: 100%; width: 85%; border-radius: 4px; background: linear-gradient(90deg, #b3194f, var(--pink)); box-shadow: 0 0 10px rgba(255, 70, 130, .6); transition: width .6s ease; }
.love-row b { font-weight: 500; font-size: 15px; min-width: 38px; text-align: right; }
.love-quote { margin: 14px 0 2px; text-align: center; font-style: italic; font-size: 14.5px; line-height: 1.7; color: var(--pink); }

.promo-card { flex: 1; min-height: 120px; max-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; overflow: hidden; position: relative;
  background: radial-gradient(circle at 20% 110%, rgba(150, 20, 60, .7), transparent 55%), radial-gradient(circle at 90% 120%, rgba(110, 15, 50, .6), transparent 50%), var(--card); }
.promo-heart { width: 48px; height: 48px; color: var(--pink); filter: drop-shadow(0 0 10px rgba(255, 70, 130, .8)); animation: beat 2.4s ease-in-out infinite; }
.promo-card p { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.5; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.08); } 48% { transform: scale(1); } }

/* ---------- Panel / แชท ---------- */
.panel { position: relative; min-height: 0; display: flex; flex-direction: column; border-radius: 26px; background: var(--panel); border: 1px solid var(--line-soft); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 0 0 6px; overflow: hidden; transition: background .5s, border-color .5s; }
.chat-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 22px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 92, 141, .3) transparent; contain: strict; }
.vl-inner { position: relative; width: 100%; }
.vl-row { position: absolute; left: 0; right: 0; top: 0; padding: 12px 0; will-change: transform; contain: layout style; }

.row { display: flex; align-items: flex-end; gap: 14px; animation: pop .35s ease both; }
@keyframes pop { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
.row.user { justify-content: flex-end; }
.row .avatar-sm { align-self: flex-start; }
.bubble { position: relative; max-width: min(640px, 78%); padding: 15px 22px; border-radius: 22px; font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; word-break: break-word; }
.row.ai .bubble { background: var(--ai-bubble); color: var(--ai-text); border: 1px solid rgba(255, 255, 255, .04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.row.user .bubble { background: linear-gradient(135deg, var(--user-from), var(--user-to)); color: #fff; border: 1px solid rgba(255, 150, 180, .4); box-shadow: 0 4px 22px rgba(214, 63, 108, .3), inset 0 1px 0 rgba(255, 255, 255, .22); }
.row.user .bubble { padding: 11px 22px; border-radius: 26px; }
.row.err .bubble { border-color: rgba(255, 90, 90, .5); }
.time { font-size: 14px; color: var(--muted); padding-bottom: 6px; white-space: nowrap; flex: none; }
.row .time { order: 3; }
.row.user .time { order: -1; }
.user-av { width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; flex: none; align-self: center; }
.user-av::before { content: ""; width: 24px; height: 24px; background: #fff; opacity: .85; clip-path: path("M12 12a5 5 0 100-10 5 5 0 000 10zm0 2c-5 0-9 2.500-9 6v2h18v-2c0-3.500-4-6-9-6z"); }
.bm { position: absolute; right: -6px; bottom: -8px; width: 28px; height: 28px; border-radius: 50%; background: var(--ai-bubble); border: 1px solid var(--line-soft); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.bm svg { width: 15px; height: 15px; color: var(--pink); }
.row.ai:hover .bm, .bm:focus-visible, .bm.on { opacity: 1; }
@media (hover: none) { .bm { opacity: .75; } }
.typing { display: inline-flex; gap: 6px; padding: 6px 2px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); opacity: .35; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ---------- Welcome ---------- */
.hero { position: absolute; inset: 0 0 150px 0; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; animation: fadeUp .6s ease both; z-index: 2; }
.welcome .hero { display: flex; }
.welcome .chat-scroll { visibility: hidden; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-avatar { position: relative; margin-bottom: 26px; }
.orbit { position: absolute; width: 520px; height: 286px; left: 50%; top: 50%; translate: -50% -50%; pointer-events: none; animation: orbitGlow 4s ease-in-out infinite; }
@keyframes orbitGlow { 50% { filter: drop-shadow(0 0 10px rgba(255, 70, 130, .8)); } }
.float-heart { position: absolute; width: 44px; height: 44px; right: -62px; top: 34px; color: var(--pink); filter: drop-shadow(0 0 10px rgba(255, 70, 130, .9)); animation: floaty 3.4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(6deg); } }
.hero-title { position: relative; margin: 0; font: 500 clamp(34px, 5vw, 58px)/1.2 var(--font-h); text-shadow: 0 2px 24px rgba(0, 0, 0, .5); }
.swoosh { position: absolute; width: 150px; height: 14px; right: -24px; bottom: -8px; filter: drop-shadow(0 0 6px rgba(255, 70, 130, .8)); }
.hero-sub { margin: 14px 0 30px; font-size: clamp(20px, 2.6vw, 30px); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.chip { display: inline-flex; align-items: center; gap: 14px; padding: 15px 22px; border-radius: 999px; font-size: 18px; border: 1px solid var(--line); background: rgba(20, 12, 22, .55); backdrop-filter: blur(6px); transition: transform .2s, box-shadow .2s, background .2s; }
[data-theme="light"] .chip { background: rgba(255, 255, 255, .7); }
.chip svg { width: 28px; height: 28px; color: var(--pink); flex: none; }
.chip .chev { width: 18px; height: 18px; margin-left: 6px; }
.chip:hover { transform: translateY(-2px); box-shadow: var(--glow); background: rgba(255, 92, 141, .1); }
.chip-sm { padding: 9px 16px; font-size: 14px; gap: 10px; white-space: nowrap; }
.chip-sm svg { width: 22px; height: 22px; }
.chip-sm svg.ic { width: 1em; height: 1em; }

.quick { display: none; gap: 10px; padding: 8px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }

/* ---------- Memories ---------- */
.memories { position: absolute; inset: 0 0 150px 0; overflow-y: auto; padding: 28px 30px; z-index: 2; }
.memories h2 { margin: 0 0 4px; font: 500 28px var(--font-h); }
.mem-list { display: grid; gap: 14px; margin-top: 18px; }
.mem { position: relative; padding: 16px 52px 14px 20px; border-radius: 18px; background: var(--ai-bubble); border: 1px solid var(--line-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.mem small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.mem button { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.mem button:hover { background: rgba(255, 92, 141, .14); color: var(--pink); }
.mem button svg { width: 18px; height: 18px; }

/* ---------- Composer ---------- */
.composer { display: flex; align-items: center; gap: 14px; padding: 8px 12px 0; }
.input-pill { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; min-height: 66px; padding: 6px 22px 6px 14px; border-radius: 40px; border: 1.5px solid var(--line); background: rgba(14, 9, 16, .78); box-shadow: inset 0 0 22px rgba(255, 70, 130, .06), var(--glow); transition: border-color .2s, box-shadow .2s; }
[data-theme="light"] .input-pill { background: rgba(255, 255, 255, .9); }
.input-pill:focus-within { border-color: var(--pink); box-shadow: inset 0 0 22px rgba(255, 70, 130, .1), 0 0 26px rgba(255, 70, 130, .4); }
.attach { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.attach svg { width: 28px; height: 28px; color: var(--pink-soft); }
.attach:hover { background: rgba(255, 92, 141, .12); }
.isep { width: 1px; height: 30px; background: var(--line); flex: none; margin: 0 12px 0 4px; }
#input { flex: 1; min-width: 0; resize: none; background: transparent; border: 0; outline: 0; font-size: 19px; line-height: 1.5; padding: 10px 0; max-height: 140px; }
#input::placeholder { color: var(--muted); }
.send { display: inline-flex; align-items: center; gap: 12px; height: 62px; padding: 0 30px; border-radius: 34px; font-size: 18px; font-weight: 500; color: #fff; background: linear-gradient(135deg, #dc4a78, #a82552); border: 1px solid rgba(255, 170, 195, .5); box-shadow: 0 6px 26px rgba(214, 63, 108, .45), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .15s, filter .2s; flex: none; }
.send svg { width: 26px; height: 26px; }
.send:hover { filter: brightness(1.1); transform: translateY(-1px); }
.send:active { transform: scale(.96); }
.send.busy { filter: saturate(.8); }
.safe { margin: 12px 12px 4px; text-align: center; font-size: 13.5px; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.safe .shield { width: 22px; height: 22px; color: #2ee66a; }

/* ---------- Dialog / Toast ---------- */
.dlg { width: min(460px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 22px; background: #140d17; color: var(--text); padding: 24px; box-shadow: 0 20px 80px rgba(0, 0, 0, .7), var(--glow); }
[data-theme="light"] .dlg { background: #fff; }
.dlg::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.dlg h3 { margin: 0 0 14px; font: 500 22px var(--font-h); }
.dlg label { display: block; margin: 12px 0; font-size: 14px; color: var(--muted); }
.dlg input:not([type=range]), .dlg select { display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .05); color: var(--text); outline: 0; font-size: 15px; }
.dlg select option { background: #1b1220; color: #fff; }
.dlg input:focus, .dlg select:focus { border-color: var(--pink); }
.dlg input[type=range] { width: 100%; accent-color: var(--pink); margin-top: 8px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.dlg-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 14px; font-size: 15px; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { border: 1px solid var(--line-soft); }
.btn.ghost:hover { background: rgba(255, 92, 141, .1); }
.btn.danger { color: #ff7b8f; }
.btn.primary { background: linear-gradient(135deg, #dc4a78, #a82552); color: #fff; box-shadow: var(--glow); }
.toast { position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); translate: -50% 20px; opacity: 0; pointer-events: none; padding: 10px 20px; border-radius: 999px; background: #2a1520; border: 1px solid var(--line); color: #fff; font-size: 15px; z-index: 50; transition: opacity .25s, translate .25s; }
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- Welcome บน Desktop: ซ่อน Sidebar (เป็นลิ้นชัก) + แผงโปร่ง ---------- */
.welcome .panel { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.welcome .layout { grid-template-columns: 1fr; }
.welcome .tagline, .welcome .brand h1 + .status { }
.welcome .brand-text h1 { font-size: 26px; }
.welcome .tagline { display: none; }
.welcome .avatar-md { width: 74px; height: 74px; margin: 0; }
.welcome .only-drawer { display: grid; }

/* ลิ้นชัก Sidebar (มือถือ และตอน Welcome) */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20; }
@media (min-width: 821px) {
  .welcome .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 310px; padding: 90px 16px 16px; background: #0d0710; border-right: 1px solid var(--line-soft); transform: translateX(-102%); transition: transform .3s ease; z-index: 30; overflow-y: auto; }
  [data-theme="light"] .welcome .sidebar { background: #fff0f4; }
  .welcome.nav-open .sidebar { transform: none; }
  .welcome.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .welcome .promo-card { flex: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  body { font-size: 15px; }
  .layout { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .only-drawer { display: grid; }
  .desk-only, .tagline { display: none; }
  .topbar { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; gap: 8px; }
  .top-actions { gap: 8px; }
  .crown-top { display: none; }
  .brand { gap: 10px; }
  .brand h1, .welcome .brand-text h1 { font-size: 22px; }
  .status { font-size: 13px; }
  .avatar-md, .welcome .avatar-md { width: 58px; height: 58px; margin: 0; }
  .theme-toggle { width: 56px; height: 28px; padding: 0 6px; }
  .theme-toggle .knob { width: 18px; height: 18px; top: 4px; }
  [data-theme="light"] .theme-toggle .knob { transform: translateX(28px); }
  .panel { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; padding-bottom: calc(6px + var(--safe-b)); }
  .chat-scroll { padding: 4px 14px; }
  .bubble { font-size: 16px; padding: 12px 17px; max-width: 80%; border-radius: 20px; }
  .row.user .bubble { padding: 10px 17px; }
  .row { gap: 9px; }
  .row.ai .avatar-sm, .avatar-sm { width: 48px; height: 48px; }
  .time { font-size: 12px; }
  .user-av { display: none; }
  .composer { padding: 6px 12px 0; gap: 10px; }
  .input-pill { min-height: 56px; padding: 4px 16px 4px 8px; }
  #input { font-size: 16px; }
  .send { width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 50%; }
  .send span { display: none; }
  .safe { font-size: 11.5px; margin-top: 8px; gap: 6px; }
  .safe b { display: none; }
  .quick { display: flex; }
  .welcome .quick { display: none; }
  .orbit { width: 340px; height: 190px; }
  .avatar-xl { width: 180px; height: 180px; }
  .float-heart { width: 34px; height: 34px; right: -40px; }
  .chips { flex-direction: column; gap: 12px; width: min(340px, 100%); }
  .chip { width: 100%; justify-content: flex-start; }
  .chip .chev { margin-left: auto; }
  .hero { inset: 0 0 100px 0; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(310px, 86vw); padding: 80px 14px 16px; background: #0d0710; border-right: 1px solid var(--line-soft); transform: translateX(-102%); transition: transform .3s ease; z-index: 30; overflow-y: auto; }
  [data-theme="light"] .sidebar { background: #fff0f4; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .promo-card { flex: none; }
  .memories { inset: 0 0 90px 0; padding: 18px 16px; }
  .toast { bottom: calc(150px + var(--safe-b)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .petal { display: none; }
}
