:root {
  --bg: #090b10;
  --panel: #0f1219;
  --panel-2: #141924;
  --panel-3: #191f2c;
  --line: rgba(255,255,255,.08);
  --text: #f6f8fb;
  --muted: #8f99aa;
  --blue: #6b7cff;
  --blue-2: #8b6cff;
  --green: #4ee39d;
  --danger: #ff667d;
  --shadow: 0 24px 80px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 65% 10%, rgba(107,124,255,.09), transparent 32%),
    radial-gradient(circle at 20% 90%, rgba(139,108,255,.06), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea { font: inherit; }

.shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(10,12,17,.82);
  backdrop-filter: blur(20px);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 4px 10px; }
.logo, .hero-orb, .ai-icon {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 10px 30px rgba(107,124,255,.25);
  font-weight: 900;
}
.logo { width: 38px; height: 38px; border-radius: 11px; }
.brand-name { font-weight: 800; letter-spacing: .04em; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.new-chat {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
}
.new-chat:hover { transform: translateY(-1px); border-color: rgba(107,124,255,.45); }

.side-section { display: flex; flex-direction: column; gap: 7px; }
.side-label { color: #667087; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 0 8px 4px; }
.quick {
  border: 0;
  background: transparent;
  color: #aeb6c5;
  padding: 10px 9px;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
}
.quick:hover { background: rgba(255,255,255,.045); color: white; }

.status-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  background: rgba(255,255,255,.025);
}
.status-row { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #687083; box-shadow: 0 0 0 3px rgba(104,112,131,.08); }
.dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(78,227,157,.10), 0 0 16px rgba(78,227,157,.35); }
.dot.offline { background: var(--danger); }
.model-name, .dataset-count { color: var(--muted); font-size: 11px; margin-top: 7px; line-height: 1.4; word-break: break-word; }

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  height: 100vh;
}

.topbar {
  padding: 24px 34px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.eyebrow { color: #69758e; font-size: 10px; font-weight: 800; letter-spacing: .18em; margin-bottom: 5px; }
h1 { font-size: 23px; margin: 0; letter-spacing: -.03em; }
.pill {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: #9ea8ba;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
}

.chat {
  overflow-y: auto;
  padding: 18px 34px 40px;
  scroll-behavior: smooth;
}

.hero {
  min-height: 72%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 760px;
  margin: auto;
}
.hero-orb { width: 58px; height: 58px; border-radius: 17px; font-size: 24px; margin-bottom: 18px; }
.hero h2 { font-size: clamp(30px, 4vw, 50px); margin: 0; letter-spacing: -.05em; }
.hero p { color: var(--muted); max-width: 570px; line-height: 1.7; margin: 14px auto 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  color: #b6becd;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: rgba(107,124,255,.38); color: white; }

.message { max-width: 900px; margin: 0 auto 28px; }
.message-label { color: #7e899e; font-size: 10px; font-weight: 800; letter-spacing: .14em; margin-bottom: 8px; }
.user-message { display: flex; flex-direction: column; align-items: flex-end; }
.user-message .message-label { margin-right: 4px; }
.bubble {
  max-width: min(720px, 88%);
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 18px 18px 5px 18px;
  padding: 13px 16px;
  color: #e9edf5;
  line-height: 1.55;
}
.message-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.message-head .message-label { margin: 0 0 2px; }
.ai-icon { width: 31px; height: 31px; border-radius: 9px; font-size: 12px; }
.mini-status { color: var(--muted); font-size: 11px; }

.result-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #0b0e14;
  box-shadow: var(--shadow);
}
.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  color: #98a2b5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.copy-btn {
  border: 1px solid var(--line);
  background: #131824;
  color: #b9c0cd;
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
pre { margin: 0; padding: 16px; overflow: auto; max-height: 520px; }
code {
  color: #cdd5e4;
  font: 12.5px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.typing {
  max-width: 900px; margin: 0 auto 25px;
  display: flex; align-items: center; gap: 10px; color: var(--muted);
}
.typing-dots { display: flex; gap: 4px; }
.typing-dots span {
  width: 5px; height: 5px; border-radius: 50%; background: #8590a5;
  animation: bounce 1.1s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .4 } 30% { transform: translateY(-4px); opacity: 1 } }

.error-card {
  max-width: 900px; margin: 0 auto 22px; border: 1px solid rgba(255,102,125,.25);
  background: rgba(255,102,125,.06); color: #ff9cad; padding: 12px 14px; border-radius: 12px;
  font-size: 13px;
}

.composer-wrap { padding: 10px 34px 23px; background: linear-gradient(180deg, transparent, rgba(9,11,16,.92) 28%); }
.composer {
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(18,22,31,.95);
  border-radius: 18px;
  padding: 10px 10px 10px 15px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  box-shadow: 0 18px 60px rgba(0,0,0,.3);
}
.composer:focus-within { border-color: rgba(107,124,255,.42); box-shadow: 0 18px 60px rgba(0,0,0,.3), 0 0 0 3px rgba(107,124,255,.07); }
textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  min-height: 40px;
  max-height: 170px;
  padding: 9px 0;
  line-height: 1.5;
}
textarea::placeholder { color: #657085; }
.send-btn {
  border: 0;
  color: white;
  cursor: pointer;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(107,124,255,.24);
}
.send-btn:disabled { opacity: .5; cursor: not-allowed; }
.arrow { font-size: 16px; }
.hint { max-width: 900px; margin: 7px auto 0; text-align: center; color: #596276; font-size: 10px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar, .chat, .composer-wrap { padding-left: 18px; padding-right: 18px; }
  .topbar { padding-top: 18px; }
  .pill { display: none; }
  .hero { min-height: 68%; }
  .send-btn span:first-child { display: none; }
}
