:root {
  --bg: #eef3fb;
  --card: #ffffff;
  --ink: #16233c;
  --muted: #6b7a93;
  --navy: #1a3a7a;        /* logo deep navy */
  --blue: #4a7bba;        /* logo highlight blue */
  --accent: var(--blue);
  --accent-dark: var(--navy);
  --border: #c9d8ef;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", "Noto Sans Devanagari", "Noto Sans Tamil",
    "Noto Sans Bengali", "Noto Sans Telugu", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: #fff;
  padding: 16px 24px;
  box-shadow: 0 2px 10px rgba(26, 58, 122, 0.25);
}

.brand { display: flex; align-items: center; gap: 14px; max-width: 860px; margin: 0 auto; }

/* logo sits on a white badge so it reads cleanly on the blue gradient */
.logo {
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(10, 20, 45, 0.35);
}
.logo img { width: 44px; height: 44px; display: block; border-radius: 8px; }

h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.brand p { margin: 2px 0 0; font-size: 13px; opacity: 0.9; }

main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(22, 35, 60, 0.08);
}

/* settings row */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
}
.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
  min-width: 140px;
}
select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
}

/* chat */
.chat-card { display: flex; flex-direction: column; padding: 18px 20px; }
.chat {
  min-height: 280px;
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 4px 12px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.assistant {
  align-self: flex-start;
  background: #e8eefb;
  border-bottom-left-radius: 4px;
}
.msg.greeting { background: #dfe9fb; color: var(--navy); font-weight: 500; }
.msg .note {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.status {
  min-height: 22px;
  font-size: 13px;
  color: var(--accent-dark);
  font-weight: 600;
  padding: 0 4px 8px;
}

/* input bar */
.inputbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
textarea {
  flex: 1;
  resize: none;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  max-height: 120px;
}
textarea:focus, select:focus { outline: 2px solid var(--blue); border-color: transparent; }

.mic {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: filter 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.mic:hover { filter: brightness(1.12); }
.mic:active { transform: scale(0.94); }
.mic.recording {
  background: #c0392b;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

.send {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--navy);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.send:hover { background: #122c5c; }
.send:disabled, .mic:disabled { opacity: 0.5; cursor: not-allowed; }

footer {
  text-align: center;
  padding: 14px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 560px) {
  .controls { gap: 10px; }
  .msg { max-width: 92%; }
}
