:root {
  --bg: #0b0f1a;
  --panel: #151b2b;
  --panel-2: #1e2639;
  --ink: #e8edf5;
  --muted: #8d97b0;
  --accent: #7bd88f;
  --accent-ink: #0b0f1a;
  --user: #3b82f6;
  --larry: #2a3550;
  --border: #2a3245;
  --warn: #fbbf24;
  font-family: system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  max-width: 820px;
  margin: 0 auto;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

header .brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

header .nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 18px;
  font-size: 14px;
}
header .nav a:hover { color: var(--ink); }

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

.msg {
  margin: 12px 0;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg.user {
  background: var(--user);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.msg.larry {
  background: var(--larry);
  color: var(--ink);
  margin-right: auto;
  border-bottom-left-radius: 4px;
  position: relative;
}

.msg.larry .replay {
  position: absolute;
  top: 6px; right: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.msg.larry .replay:hover { color: var(--ink); }

.msg.system {
  color: var(--warn);
  background: transparent;
  text-align: center;
  font-size: 13px;
  max-width: none;
}

.msg .math { font-family: "Latin Modern Math", "STIX Two Math", serif; }

footer.compose {
  padding: 12px 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
}

.mic {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s, background 0.2s;
}
.mic:hover { background: #2a334d; }
.mic.recording {
  background: #ef4444;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

textarea.input {
  resize: none;
  min-height: 54px;
  max-height: 160px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}
textarea.input:focus { border-color: var(--accent); }

.send {
  height: 54px;
  padding: 0 20px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 15px;
}
.send:disabled { opacity: 0.5; cursor: not-allowed; }

.hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 24px auto;
  max-width: 500px;
  line-height: 1.5;
}
.hint a { color: var(--accent); }

/* ---- Voice picker page ---- */
.picker {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}
.picker h1 {
  margin: 10px 0 6px;
  font-size: 22px;
}
.picker p.sub {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 18px;
}
.voice-list {
  display: grid;
  gap: 10px;
}
.voice {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}
.voice.selected { border-color: var(--accent); background: #1a2338; }
.voice .name { font-weight: 600; }
.voice .meta { color: var(--muted); font-size: 12px; }
.voice button {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.voice button.primary { background: var(--accent); color: var(--accent-ink); border: none; font-weight: 600; }
