:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #06101b;
  color: #eaf2fb;
}
* { box-sizing: border-box; }
html, body {
  height: 100%;
}
body {
  margin: 0;
  background: radial-gradient(circle at top, #123451, #06101b 44%);
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
body.keyboard-open {
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
}
body.driving-mode {
  filter: brightness(0.82);
}
.shell {
  max-width: 860px;
  margin: auto;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: max(8px, env(safe-area-inset-top)) 14px max(8px, env(safe-area-inset-bottom));
  overflow: hidden;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  flex: 0 0 auto;
}
h1 { margin: 0; font-size: 1.35rem; }
h2 { margin-top: 0; }
small { color: #8ca6bc; letter-spacing: .12em; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.status-menu { position: relative; }
.status-menu > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #2d5876;
  border-radius: 999px;
  background: #13283a;
  color: #c9dcec;
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
}
.status-menu > summary::-webkit-details-marker { display: none; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f2a34b;
  box-shadow: 0 0 0 3px #f2a34b22;
}
.status-menu.home .status-dot { background: #49c884; box-shadow: 0 0 0 3px #49c88422; }
.status-details {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  min-width: min(300px, calc(100vw - 32px));
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #29465d;
  border-radius: 14px;
  background: #0b1926f5;
  box-shadow: 0 18px 50px #0008;
  color: #a9c0d3;
  font-size: .8rem;
}
.card, .bubble, dialog {
  background: #0d1c2a;
  border: 1px solid #20394c;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 50px #0004;
}
.card + .card { margin-top: 14px; }
label { display: block; color: #a9c0d3; margin: 10px 0; }
input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #29465d;
  background: #07131e;
  color: #f5f9fd;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: #4db7ff;
  color: #04111c;
  font-weight: 750;
  font: inherit;
  cursor: pointer;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Inputs below are display:block, which would otherwise defeat the hidden attribute. */
[hidden] { display: none !important; }
.icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  overflow: visible;
  filter: drop-shadow(0 1px 1px #00060f66);
}
button:active .icon { transform: translateY(1px) scale(.97); }
.secondary, nav button {
  background: #13283a;
  color: #c9dcec;
  border: 1px solid #27465d;
}
#face-login { width: 100%; margin-top: 10px; }
#login {
  overflow: auto;
  min-height: 0;
  grid-row: 2;
}
#app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  grid-row: 2;
}
nav {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 7px;
  margin-bottom: 6px;
  flex: 0 0 auto;
  position: relative;
  z-index: 12;
}
nav button, .nav-menu > summary {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  border-radius: 12px;
}
.nav-menu { position: relative; min-width: 0; }
.nav-menu > summary {
  list-style: none;
  grid-template-columns: auto auto auto;
  justify-content: center;
  background: #13283a;
  color: #c9dcec;
  border: 1px solid #27465d;
  cursor: pointer;
  font-weight: 700;
}
.nav-menu > summary::-webkit-details-marker,
.voice-options > summary::-webkit-details-marker,
.send-options > summary::-webkit-details-marker { display: none; }
.menu-caret { color: #8ca6bc; font-size: .8rem; }
.nav-dropdown, .voice-dropdown, .send-options > div {
  position: absolute;
  z-index: 30;
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid #29465d;
  border-radius: 13px;
  background: #0b1926fa;
  box-shadow: 0 16px 40px #000a;
}
.nav-dropdown {
  top: calc(100% + 6px);
  left: 0;
  width: min(230px, calc(100vw - 28px));
}
.nav-dropdown button {
  display: block;
  width: 100%;
  min-height: 40px;
  text-align: left;
  padding: 9px 12px;
}
/* Keep the selected tab dark so the bright icons stay readable in every state. */
nav .active, .nav-menu > summary.active {
  background: linear-gradient(160deg, #1d4a6b, #0d2739);
  border-color: #58c8ff;
  color: #eaf7ff;
  box-shadow: inset 0 1px #ffffff1f, 0 0 0 1px #58c8ff55, 0 6px 16px #00101c88;
}
nav .active .nav-label { color: #9adcff; }
.nav-icon { width: 29px; height: 29px; }
.nav-label { font-size: .68rem; font-weight: 600; }
.view {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}
#chat-view.view,
#private-view.view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
#private-view.view:has(#private-lock:not([hidden])) {
  grid-template-rows: minmax(0, 1fr);
  overflow: auto;
}
#private-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chat-top {
  display: grid;
  gap: 3px;
  margin-bottom: 3px;
}
.agent-bar { margin-bottom: 0; color: #9fc0d8; font-size: .78rem; }
.agent-bar label { margin: 0; }
.agent-bar select { padding: 10px 12px; }
.voice-route, .chat-status-line {
  margin: 0;
  font-size: .72rem;
  color: #8ea8bd;
}
.chat-status-line { display: none; }
.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 8px;
  margin-bottom: 0;
}
.bubble { max-width: 86%; white-space: pre-wrap; padding: 13px 15px; }
.bubble.user { align-self: flex-end; background: #174a6c; border-color: #2b7097; }
.bubble.assistant { align-self: flex-start; }
.chat-footer {
  display: grid;
  gap: 5px;
  padding-top: 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: linear-gradient(180deg, transparent, #06101be6 18%);
}
.composer { display: grid; gap: 5px; }
.composer-input {
  position: relative;
  display: grid;
  align-items: end;
}
.composer-input textarea {
  margin: 0;
  min-height: 52px;
  max-height: 22vh;
  padding: 14px 94px 14px 48px;
  resize: none;
}
.composer-input:not(:has(.send-options:not([hidden]))) textarea {
  padding-right: 52px;
}
.composer-icon {
  position: absolute;
  z-index: 2;
  bottom: 7px;
  width: 38px;
  height: 38px;
  padding: 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.composer-icon .icon { width: 24px; height: 24px; }
.composer-attach {
  left: 6px;
  background: transparent;
  color: #a5ecff;
}
.composer-send { right: 7px; }
.send-options {
  position: absolute;
  right: 49px;
  bottom: 8px;
  z-index: 4;
}
.send-options > summary {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #13283a;
  border: 1px solid #27465d;
  color: #c9dcec;
  cursor: pointer;
}
.send-options > div {
  right: 0;
  bottom: calc(100% + 6px);
  width: 180px;
}
.send-options button { padding: 9px 10px; font-size: .78rem; }
.attachment-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-button, .composer-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.icon-button { padding: 8px 12px; }
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 7px 6px 10px;
  border: 1px solid #2b5877;
  border-radius: 999px;
  background: linear-gradient(145deg, #18364e, #0b1b2a);
  color: #cce8f9;
  font-size: .74rem;
  box-shadow: inset 0 1px #ffffff12, 0 4px 12px #0005;
}
.attachment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-chip button {
  width: 27px;
  height: 27px;
  padding: 2px;
  border-radius: 50%;
  background: transparent;
}
.attachment-chip .icon { width: 20px; height: 20px; }
.composer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.private-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.private-mode-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.private-mode-switch .active {
  color: #eaf7ff;
  border: 1px solid #59c9ff;
  background: linear-gradient(160deg, #1d4a6b, #0d2739);
  box-shadow: inset 0 1px #ffffff1f, 0 0 0 1px #58c8ff44;
}
.private-bluetooth-panel {
  padding: 12px 0;
  text-align: center;
}
.bluetooth-talk {
  width: min(100%, 300px);
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.bluetooth-talk.listening {
  background: linear-gradient(145deg, #ff8268, #d84d43);
  box-shadow: 0 0 0 4px #ff6b4d33, 0 8px 25px #0007;
}
.bluetooth-talk.processing { opacity: .7; }
.voice-bar {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 6px;
}
.voice-action {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.voice-primary-group {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 3px;
}
.voice-options { position: relative; }
.voice-options > summary {
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #27465d;
  border-radius: 10px;
  background: #13283a;
  color: #c9dcec;
  cursor: pointer;
}
.voice-dropdown {
  left: 0;
  bottom: calc(100% + 6px);
  width: 150px;
}
.voice-dropdown button {
  width: 100%;
  padding: 9px;
  font-size: .8rem;
}
.voice-bar .hot { background: #ff6b4d; color: #1a0603; }
.voice-action.active-voice {
  border-color: #58c8ff;
  box-shadow: inset 0 1px #ffffff1f, 0 0 0 1px #58c8ff44;
}
.voice-action.muted-voice {
  opacity: .85;
}
#interrupt-voice {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(145deg, #ff8268, #d84d43);
  color: #1a0603;
}
#play-reply {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(145deg, #4fd0a6, #1f8f74);
  color: #04211a;
}
.voice-label { font-size: .7rem; }
.driving-hint {
  margin: 0;
  font-size: .7rem;
  color: #9fc0d8;
}
.notice { font-size: .78rem; color: #8ea8bd; }
.error { color: #ff9d9d; }
.settings-card {
  margin-bottom: 9px;
  border: 1px solid #20394c;
  border-radius: 15px;
  background: #0d1c2a;
  overflow: hidden;
}
.settings-card > summary {
  list-style: none;
  padding: 15px 16px;
  color: #eaf2fb;
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
}
.settings-card > summary::-webkit-details-marker { display: none; }
.settings-card > summary::after {
  content: "›";
  margin-left: auto;
  color: #8ca6bc;
  transform: rotate(90deg);
  transition: transform .15s ease;
}
.settings-card[open] > summary::after { transform: rotate(-90deg); }
.settings-card > :not(summary) { margin-left: 16px; margin-right: 16px; }
.settings-card > :last-child { margin-bottom: 16px; }
.settings-card p { color: #a9c0d3; font-size: .86rem; line-height: 1.35; }
.provider-voice-setting {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #d8efff;
}
.provider-voice-setting input {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #3fb3f7;
}
.pairing-code {
  display: block;
  min-height: 1.5em;
  margin-top: 14px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: #8ed2ff;
}
dialog { max-width: min(92vw, 720px); color: #eaf2fb; }
dialog::backdrop { background: #000b; }
pre {
  max-height: 46vh;
  overflow: auto;
  white-space: pre-wrap;
  background: #050c13;
  padding: 12px;
  border-radius: 10px;
  color: #b9d8ee;
}
.actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 560px) {
  .shell { padding-left: 14px; padding-right: 14px; }
  .bubble { max-width: 94%; }
  nav button, .nav-menu > summary { padding: 6px 4px; }
  .voice-action .icon { width: 23px; height: 23px; }
  .voice-label { display: inline; }
  .voice-bar { gap: 4px; }
}
