:root {
  --bg: #ffffff;
  --surface: #f3f4f6;
  --ink: #121417;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #0066b1;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #e9eaec;
  color: var(--ink);
  font: 15px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 740px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
}
.brand-name span {
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 2px;
  font-size: 13px;
  text-transform: uppercase;
  margin-left: 2px;
}
.brand-sub { display: none; }
#reset {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .15s;
  display: inline-flex; align-items: center; gap: 7px;
}
#reset svg { display: none; }
#reset:hover { border-color: var(--ink); }

/* thin BMW M accent */
.mstripe {
  height: 2px;
  background: linear-gradient(90deg, #2e9be6 0 42%, #16588e 42% 71%, #e7222e 71% 100%);
}

/* ---- chat log ---- */
.log {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.row { display: flex; }
.row.user { justify-content: flex-end; }
.row .avatar { display: none; }

.bubble {
  max-width: 76%;
  padding: 12px 16px;
  border-radius: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 15px;
}
.row.bot .bubble {
  background: var(--surface);
  color: var(--ink);
  border-top-left-radius: 2px;
}
.row.user .bubble {
  background: var(--blue);
  color: #fff;
  border-top-right-radius: 2px;
}

/* typing dots */
.typing { display: flex; gap: 5px; padding: 3px 0; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: blink 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,70%,100% { opacity: .25; } 35% { opacity: .9; } }

/* suggestion chips */
.chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  max-width: 76%;
}
.chip {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .12s;
}
.chip:last-child { border-bottom: none; }
.chip:hover { background: var(--surface); }
.chip::before { content: "→"; color: var(--blue); margin-right: 10px; }

/* ---- composer ---- */
.composer {
  display: flex;
  gap: 0;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
}
#input {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 3px 0 0 3px;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  outline: none;
}
#input:focus { border-color: var(--ink); }
#input:focus + #send { border-color: var(--ink); }
#send {
  flex: none;
  width: 54px;
  border: 1px solid var(--line);
  border-left: none;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
}
#send:hover { background: #005596; }
#send:disabled { opacity: .5; cursor: default; }

@media (max-width: 520px) {
  .bubble, .chips { max-width: 88%; }
  .topbar, .log, .composer { padding-left: 16px; padding-right: 16px; }
}
