.main:has(#chat:not(.hide)) { height:100dvh; min-height:0; padding:0; overflow:hidden }
#chat:not(.hide) { height:100%; min-height:0 }
.home-chat {
  position:relative; isolation:isolate; height:100%; display:grid; grid-template-rows:auto minmax(0,1fr);
  padding:clamp(16px,4vw,64px); gap:14px; overflow:hidden;
  background:radial-gradient(ellipse at 73% 43%,#1a5142,transparent 60%),var(--bg);
  color:var(--text); font-family:Inter,system-ui,sans-serif;
}
.home-chat canvas { position:absolute; inset:0; width:100%; height:100%; z-index:-2; pointer-events:none }
.home-chat::after {
  content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background:linear-gradient(90deg,var(--bg) 3%,#0718168c 42%,transparent 75%);
}
.home-brand { display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:-.01em }
.home-brand-mark { width:22px; height:22px; object-fit:contain; filter:drop-shadow(0 0 10px #77e6ce88); animation:vivi-brand-pulse 2.8s ease-in-out infinite }
@keyframes vivi-brand-pulse { 0%,100% { transform:scale(1) rotate(0deg); filter:drop-shadow(0 0 8px #77e6ce66) } 50% { transform:scale(1.1) rotate(4deg); filter:drop-shadow(0 0 16px #b8ffe5cc) } }
.home-brand span { color:var(--muted); font-weight:450 }
.home-brand i { width:14px; height:14px; border-radius:4px; transform:rotate(45deg); background:var(--mint); box-shadow:0 0 20px #77e6ce }
.home-content { min-height:0; width:min(100%,840px); display:flex; flex-direction:column; justify-content:center; gap:16px }
.home-intro { animation:home-enter .65s both }
.home-intro h1 { font-size:clamp(37px,6.7vw,100px); line-height:.98; letter-spacing:-.072em; margin:0 }
.home-intro em { font-style:normal; color:var(--mint) }
.home-intro p { color:var(--muted); margin:15px 0 10px }
.home-log { display:flex; flex-direction:column; gap:12px; overflow:auto; min-height:0; scrollbar-width:thin }
.home-log:empty { display:none }
.home-message {
  align-self:start; max-width:90%; min-width:0; padding:12px 16px; background:var(--p);
  border:1px solid var(--line); border-radius:16px 16px 16px 4px;
}
.home-message:last-child { animation:home-enter .38s both }
.home-message.mine { align-self:end; background:#205342; border-radius:16px 16px 4px 16px }
.home-message small { display:block; color:var(--mint); font-weight:650; margin-bottom:5px }
.home-message.mine small { color:var(--mint) }
.home-text { max-height:min(23dvh,200px); overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.5 }
.home-text strong { color:var(--mint) }
.home-thinking { color:var(--muted); font-size:14px }
.home-thinking i { display:inline-block; width:4px; height:4px; margin-left:4px; background:var(--mint); border-radius:50%; animation:home-dot .9s infinite alternate }
.home-thinking i:nth-child(2) { animation-delay:.18s }
.home-thinking i:nth-child(3) { animation-delay:.36s }
.home-compose {
  display:flex; gap:8px; padding:7px; flex:none; background:#0d2922;
  border:1px solid var(--line); border-radius:18px; box-shadow:0 12px 32px #020c0955;
  transition:border-color .2s,box-shadow .2s;
}
.home-compose:focus-within { border-color:var(--mint); box-shadow:0 0 25px #7deed02a }
.home-compose input { flex:1; min-width:0; color:inherit; background:none; border:0; outline:none; padding:0 9px; font:inherit }
.home-compose input::placeholder { color:var(--muted) }
.home-compose button { flex:0 0 44px; height:44px; background:var(--mint); color:var(--bg); border:0; border-radius:12px; font-size:24px; cursor:pointer }
.home-compose button:disabled { opacity:.5; cursor:wait }
.home-prompts { display:flex; flex-wrap:wrap; gap:7px }
.home-prompts button { color:var(--text); background:var(--p); border:1px solid var(--line); border-radius:20px; padding:8px 12px; font:inherit; font-size:12px; cursor:pointer }
.home-prompts button:hover { border-color:var(--mint) }
.home-chat :focus-visible { outline:2px solid var(--mint); outline-offset:2px }
.home-compose input:focus-visible { outline:none }
@keyframes home-enter { from { opacity:0; transform:translateY(9px) } to { opacity:1; transform:none } }
@keyframes home-dot { from {opacity:.3; transform:translateY(0)} to {opacity:1; transform:translateY(-4px)} }
@media(max-width:660px) {
  .home-chat { padding:14px; gap:12px }
  .home-content { gap:10px }
  .home-chat::after { background:#07181649 }
}
@media(max-height:450px) {
  .home-intro h1 {font-size:clamp(28px,8vh,43px)}
  .home-intro p {margin:6px 0}
  .home-content {gap:7px}
}
@media(prefers-reduced-motion:reduce) {
  .home-intro,.home-message:last-child,.home-thinking i { animation:none }
}
