:root {
  --bg: #0e1117;
  --panel: #161b25;
  --panel-2: #1d2430;
  --line: #2a3342;
  --text: #e7ecf3;
  --muted: #93a0b4;
  --accent: #6ea8fe;
  --accent-2: #8b7bf6;
  --user: #2b6cff;
  --eliza: #222b3a;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(110, 168, 254, 0.12), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(139, 123, 246, 0.12), transparent 55%),
    var(--bg);
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  max-width: 1180px;
  height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 22px;
  color: #fff;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.brand h1 { margin: 0; font-size: 22px; letter-spacing: 1px; }
.brand-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); font-family: "IBM Plex Mono", monospace; }

.info-block h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--muted); margin: 0 0 8px;
}
.info-block p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; color: #cdd6e3; }
.info-block strong { color: var(--text); }

.suggestions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.suggestions button {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--panel-2); color: #d7deea;
  border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 12px; font-size: 13px; line-height: 1.35;
  transition: border-color .15s, transform .05s, background .15s;
}
.suggestions button:hover { border-color: var(--accent); background: #232c3b; }
.suggestions button:active { transform: scale(.99); }

.lang-toggle { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 4px; gap: 4px; }
.lang-toggle button {
  flex: 1; cursor: pointer; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  padding: 8px 6px; font-size: 12.5px; font-weight: 600; transition: .15s;
}
.lang-toggle button.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.hint { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; }

.credit { margin-top: auto; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.credit a { color: var(--accent); text-decoration: none; }
.credit a:hover { text-decoration: underline; }

/* ---------- Chat ---------- */
.chat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.status { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #46d39a; box-shadow: 0 0 0 0 rgba(70,211,154,.6); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(70,211,154,.5); }
  70% { box-shadow: 0 0 0 8px rgba(70,211,154,0); }
  100% { box-shadow: 0 0 0 0 rgba(70,211,154,0); }
}
.reset-btn {
  cursor: pointer; background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; font-size: 12.5px; font-weight: 600;
  transition: .15s;
}
.reset-btn:hover { color: var(--text); border-color: var(--accent); }

.messages {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}

.msg { display: flex; gap: 11px; max-width: 78%; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .avatar {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}
.msg .bubble {
  padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5;
  border: 1px solid var(--line);
}

.msg.eliza { align-self: flex-start; }
.msg.eliza .avatar { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.msg.eliza .bubble { background: var(--eliza); border-top-left-radius: 4px; }

.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .avatar { background: #33404f; }
.msg.user .bubble { background: linear-gradient(135deg, #2b6cff, #4d7dff); border: 1px solid #3f74ff; color: #fff; border-top-right-radius: 4px; }

.typing .bubble { display: flex; gap: 5px; align-items: center; padding: 14px; }
.typing span { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; animation: blink 1.4s infinite both; }
.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 ---------- */
.composer {
  display: flex; gap: 10px; padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(255,255,255,0.02), transparent);
}
.composer input {
  flex: 1; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; font-size: 14.5px; outline: none; transition: border-color .15s;
  font-family: inherit;
}
.composer input:focus { border-color: var(--accent); }
.composer input::placeholder { color: #6b7a8f; }
.composer button {
  flex: 0 0 auto; width: 48px; cursor: pointer; color: #fff;
  border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; transition: transform .05s, opacity .15s;
}
.composer button:hover { opacity: .92; }
.composer button:active { transform: scale(.95); }
.composer button:disabled { opacity: .5; cursor: default; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; height: auto; min-height: 100vh; padding: 12px; gap: 12px; }
  .sidebar { order: 2; }
  .chat { order: 1; height: 72vh; }
  .msg { max-width: 88%; }
}
