:root {
  --bg: #12141f;
  --panel: #1b1e2e;
  --panel2: #232741;
  --text: #f2f3fa;
  --muted: #9aa0b8;
  --accent: #6c8cff;
  --accent2: #8f6cff;
  --user: linear-gradient(135deg, #6c8cff, #8f6cff);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border-bottom: 1px solid #ffffff12;
}
.title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  font-size: 22px;
  background: var(--user);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h1 { font-size: 17px; margin: 0; }
.sub { margin: 0; font-size: 11px; color: var(--muted); }
.top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ghost {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid #ffffff1f;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.ghost:active { transform: scale(.97); }
.hidden { display: none; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg { display: flex; max-width: 100%; }
.msg.user { justify-content: flex-start; flex-direction: row-reverse; }
.bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 16px;
  line-height: 1.75;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  unicode-bidi: plaintext;
}
.msg.assistant .bubble {
  background: var(--panel);
  border: 1px solid #ffffff10;
  border-start-end-radius: 4px;
}
.msg.user .bubble {
  background: var(--user);
  color: #fff;
  border-start-start-radius: 4px;
}
.hints { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.hint {
  background: var(--panel2);
  border: 1px solid #ffffff1f;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: start;
}
.hint:active { transform: scale(.98); }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid #ffffff12;
}
#input {
  flex: 1;
  resize: none;
  max-height: 120px;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid #ffffff1f;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
}
#input:focus { outline: none; border-color: var(--accent); }
#send {
  background: var(--user);
  color: #fff;
  border: 0;
  border-radius: 14px;
  width: 46px;
  font-size: 17px;
  cursor: pointer;
  transform: scaleX(-1);
}
#send:disabled { opacity: .5; }
.foot {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--panel);
}
.foot p { margin: 2px 0; }
