:root{
  --bg:#0c0a12; --bg2:#171224; --ink:#f0eafa; --muted:#9d90b8;
  --lilac:#a983ff; --lilac-light:#e4c4ff; --line:#ffffff17;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  display:flex; justify-content:center;
}
main{
  width:100%; max-width:520px; min-height:100dvh;
  display:flex; flex-direction:column; position:relative; padding:0 16px 28px;
}

/* ---- orb (marka imzası: dinleyen, gizemli bir varlık) ---- */
.orb{
  width:64px; height:64px; margin:28px auto 6px; border-radius:50%;
  background:radial-gradient(circle at 32% 28%, var(--lilac-light), var(--lilac) 55%, #4a2f8a 100%);
  box-shadow:0 0 40px #a983ff55;
  animation:breathe 5s ease-in-out infinite;
}
@keyframes breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}
@media (prefers-reduced-motion:reduce){.orb{animation:none}}

.brand{text-align:center; margin-bottom:6px}
.brand h1{
  margin:0; font-size:30px; font-weight:600; letter-spacing:-0.01em;
  font-variant:small-caps; color:var(--ink);
}
.brand p{margin:6px 0 0; color:var(--muted); font-size:14.5px; line-height:1.5}

/* ---- sohbet ---- */
.chat{flex:1; display:flex; flex-direction:column; gap:8px; padding:18px 2px 12px; overflow-y:auto; scroll-behavior:smooth}

.date-sep{align-self:center; color:var(--muted); font-size:11.5px; background:var(--bg2); border:1px solid var(--line); padding:4px 12px; border-radius:12px; margin:6px 0}

.bubble{
  max-width:86%; padding:10px 14px 8px; border-radius:16px; font-size:15px; line-height:1.5;
  animation:bubbleIn .28s ease both;
}
@keyframes bubbleIn{from{opacity:0; transform:translateY(8px) scale(.98)} to{opacity:1; transform:translateY(0) scale(1)}}
@media (prefers-reduced-motion:reduce){.bubble{animation:none}}

.bubble.system{align-self:flex-start; background:var(--bg2); border:1px solid var(--line); border-bottom-left-radius:5px}
.bubble.user{align-self:flex-end; background:linear-gradient(135deg,var(--lilac),#7c5cd6); color:#160d20; font-weight:500; border-bottom-right-radius:5px}
.bubble.followup{align-self:flex-start; background:#241c36; border:1px solid #a983ff40; border-bottom-left-radius:5px}
.bubble .bubble-text{white-space:pre-wrap; word-break:break-word}
.bubble .bubble-time{
  display:block; text-align:right; font-size:10.5px; margin-top:3px; opacity:.6;
}
.bubble.system .bubble-time, .bubble.followup .bubble-time{color:var(--muted)}
.bubble.user .bubble-time{color:#2a1840}

.rate-row{display:flex; align-items:center; gap:2px; margin-top:4px}
.rate-btn{
  background:transparent; border:0; font-size:14px; cursor:pointer; opacity:.55;
  padding:2px 4px; border-radius:6px; line-height:1;
}
.rate-btn:hover{opacity:1; background:#ffffff10}
.rate-btn:disabled{cursor:default}
.rate-row.rated .rate-btn:not(.rate-chosen){opacity:.2}
.rate-btn.rate-chosen{opacity:1}
.rate-note{font-size:11px; color:var(--muted); margin-left:4px; opacity:0; transition:opacity .2s ease}
.rate-row.rated .rate-note{opacity:1}

.bubble.typing .bubble-text{display:flex; gap:4px; align-items:center; padding:2px 0}
.bubble.typing .dot{width:6px; height:6px; border-radius:50%; background:var(--muted); animation:dotPulse 1.1s infinite ease-in-out}
.bubble.typing .dot:nth-child(2){animation-delay:.15s}
.bubble.typing .dot:nth-child(3){animation-delay:.3s}
@keyframes dotPulse{0%,60%,100%{opacity:.3; transform:translateY(0)} 30%{opacity:1; transform:translateY(-2px)}}

form#form{
  display:flex; align-items:flex-end; gap:6px; background:var(--bg2);
  border:1px solid var(--line); border-radius:18px; padding:8px 8px 8px 16px;
  margin-bottom:6px;
}
form#form textarea{
  flex:1; background:transparent; border:0; color:var(--ink); font-size:15.5px;
  resize:none; max-height:168px; min-height:24px; padding:8px 0; font-family:inherit;
  outline:none; line-height:1.4; overflow-y:auto;
}
form#form textarea::placeholder{color:var(--muted); transition:opacity .2s ease}
.icon-btn{
  width:40px; height:40px; flex:0 0 40px; border-radius:50%; border:0;
  background:transparent; color:var(--muted); font-size:17px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.icon-btn:hover{background:#ffffff10; color:var(--lilac-light)}
.icon-btn.listening{color:#ff8fa3; background:#ff8fa322}
.icon-btn.send{
  background:linear-gradient(135deg,var(--lilac),var(--lilac-light)); color:#160d20;
}
.icon-btn.send:hover{background:linear-gradient(135deg,var(--lilac),var(--lilac-light)); opacity:.9}
.icon-btn:disabled{opacity:.5; cursor:default}

.actions{display:flex; justify-content:center; gap:10px; margin-top:12px; flex-wrap:wrap}
.actions button{
  background:transparent; border:1px solid var(--line); color:var(--muted);
  padding:9px 14px; border-radius:20px; font-size:13px; cursor:pointer;
}
.actions button:hover{border-color:var(--lilac); color:var(--lilac-light)}

#install{
  text-align:center; font-size:13px; color:var(--muted); margin-top:14px;
  background:var(--bg2); border:1px solid var(--line); border-radius:14px; padding:12px;
}
#install button{
  margin-left:8px; background:var(--lilac); color:#160d20; border:0;
  border-radius:10px; padding:7px 12px; font-size:13px; cursor:pointer;
}

/* ---- modal (kod göster / kod gir) ---- */
.modal-backdrop{position:fixed; inset:0; background:#08060ecc; display:flex; align-items:center; justify-content:center; padding:20px; z-index:10}
.modal{width:100%; max-width:360px; background:#171224; border:1px solid var(--line); border-radius:18px; padding:22px}
.modal h3{margin:0 0 8px}
.modal p{color:var(--muted); font-size:13.5px; line-height:1.5}
.modal .code{
  font-size:22px; letter-spacing:2px; text-align:center; padding:14px; margin:14px 0;
  background:#0f0c18; border:1px dashed var(--lilac); border-radius:12px; color:var(--lilac-light);
}
.modal input{
  width:100%; padding:12px 14px; border-radius:10px; border:1px solid var(--line);
  background:#0f0c18; color:#fff; font-size:15px; margin:10px 0;
}
.modal .row{display:flex; gap:8px; margin-top:10px}
.modal button{flex:1; padding:11px; border-radius:10px; border:0; cursor:pointer; font-size:14px}
.modal .primary{background:var(--lilac); color:#160d20; font-weight:600}
.modal .ghost{background:transparent; border:1px solid var(--line); color:var(--muted)}
.modal .msg{font-size:13px; margin-top:8px}
.modal .msg.err{color:#ff8fa3}
.modal .msg.ok{color:#7fe0b0}
