.ra-launch {
  position: fixed; z-index: 65; right: 22px; bottom: 24px;
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 17px;
  color: #ebf8f7; background: #193b40; border: 1px solid #4e7176;
  border-radius: 22px; box-shadow: 0 5px 18px #07111d40; font-weight: 600;
}
.ra-launch svg { width: 17px; height: 17px; color: #bde5df; }
.ra-launch:hover { background: #244a50; }
#ride-assistant {
  --ra-bg: #171e28; --ra-fg: #edf2f6; --ra-muted: #abb7c6; --ra-line: #35404e;
  --ra-raised: #222d39; --ra-mint: #a4dbd3;
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(470px, 100%);
  max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0;
  box-sizing: border-box; overflow: hidden; border: 0; border-radius: 0; border-left: 1px solid #435160;
  color-scheme: dark; background: var(--ra-bg); color: var(--ra-fg);
  box-shadow: -10px 0 36px #060c153d;
}
#ride-assistant[open] { display: flex; flex-direction: column; }
html:has(#ride-assistant[open]) { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  #ride-assistant[open] { animation: ra-slide-in 160ms ease-out; }
  @keyframes ra-slide-in { from { transform: translateX(24px); } to { transform: translateX(0); } }
}
#ride-assistant::backdrop { background: rgb(7 13 22 / 32%); }
#ride-assistant :is(button, textarea, select) { font: inherit; }
#ride-assistant :is(button, summary) { cursor: pointer; }
#ride-assistant :focus-visible { outline: 2px solid var(--ra-mint); outline-offset: 2px; }
#ride-assistant button:disabled { opacity: .45; cursor: wait; }
.ra-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.ra-brand, .ra-welcome-icon { display: grid; place-items: center; color: var(--ra-mint); }
.ra-brand { width: 29px; height: 29px; border-radius: 8px; background: #294143; }
.ra-brand svg { width: 17px; height: 17px; }
.ra-head h2 { margin: 0; font-size: 17px; color: var(--ra-fg); letter-spacing: -.025em; }
#ra-close { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 8px;
  color: var(--ra-muted); background: transparent; font-size: 23px !important; line-height: 1; }
#ra-close:hover, #ra-mic:hover { background: #34414e; color: var(--ra-fg); }

.ra-context { position: relative; display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; padding: 8px 21px 12px; border-bottom: 1px solid var(--ra-line); font-size: 12px; }
.ra-snapshot { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; color: var(--ra-muted); }
#ra-soc { color: var(--ra-fg); font-variant-numeric: tabular-nums; }
.ra-meter { position: relative; display: inline-flex; border: 1px solid #8baea9; border-radius: 3px;
  width: 22px; height: 12px; padding: 2px; margin-right: 2px; }
.ra-meter::after { content: ''; position: absolute; top: 3px; right: -3px; width: 2px; height: 4px; background: #8baea9; }
.ra-meter i { display: block; background: var(--ra-mint); border-radius: 1px; }
.ra-stale .ra-meter i { background: var(--amber); }
.ra-stale #ra-time { color: var(--amber); }
#ra-time { color: var(--ra-muted); }
.ra-settings { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
.ra-settings summary, .ra-msg summary { color: var(--ra-muted); list-style: none; }
.ra-settings summary::-webkit-details-marker, .ra-msg summary::-webkit-details-marker { display: none; }
.ra-settings summary::after, .ra-msg summary::before { content: ''; display: inline-block; width: 5px; height: 5px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; }
.ra-settings summary::after { margin: 0 2px 3px 6px; transform: rotate(45deg); }
.ra-settings[open] summary::after { transform: rotate(225deg); margin-bottom: 0; }
.ra-settings .ra-settings-card { position: absolute; z-index: 2; right: 16px; top: calc(100% - 6px); max-width: calc(100% - 32px);
  width: 295px; padding: 14px 16px; background: var(--ra-raised); border: 1px solid var(--ra-line); border-radius: 12px; box-shadow: 0 6px 24px #090f1680; }
.ra-settings label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.ra-settings select { width: auto; padding: 5px 8px; }
.ra-settings small { display: block; margin-top: 8px; color: var(--ra-muted); font-size: 12px; }

.ra-scroll { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; overflow: auto;
  overscroll-behavior: contain; scrollbar-color: #425060 transparent; scrollbar-width: thin; }
.ra-welcome { width: min(320px, calc(100% - 48px)); margin: auto; padding: 26px 0; }
.ra-welcome-icon { width: 48px; height: 48px; margin: 0 0 15px; border: 1px solid #416063; border-radius: 15px;
  background: linear-gradient(135deg,#304d52,#22353f); }
.ra-welcome-icon svg { width: 28px; height: 28px; }
.ra-welcome h3 { font-size: clamp(21px, 4vw, 24px); font-weight: 600; letter-spacing: -.04em; color: var(--ra-fg); }
.ra-suggestions { display: grid; gap: 7px; margin-top: 20px; }
.ra-suggestions button { display: flex; align-items: center; gap: 11px; text-align: left; min-height: 45px;
  padding: 10px 13px; border: 1px solid #354453; border-radius: 10px; background: #202a35; color: #e3ebf2; }
.ra-suggestions button:hover { background: #2a3745; border-color: #607986; }
.ra-suggestions svg { width: 16px; height: 16px; color: #adc2d4; }
.ra-suggestions svg:last-child { margin-left: auto; width: 13px; }

.ra-thread:not(:empty) { padding: 22px 22px 10px; }
.ra-msg { width: fit-content; margin-bottom: 19px; overflow-wrap: anywhere; }
.ra-msg p { margin: 0; color: var(--ra-fg); font-size: 15px; line-height: 1.75; white-space: pre-wrap; }
.ra-user { max-width: 88%; margin-left: auto; padding: 9px 14px; border-radius: 16px 16px 5px 16px; background: #2a3848; }
.ra-reply { padding-right: 9px; }
.ra-msg details { margin: 5px 0 0; padding: 0; border: 0; font-size: 12px; }
.ra-msg strong { color: #f2f9fa; font-weight: 700; white-space: nowrap; }
.ra-msg summary { width: fit-content; padding: 3px 0; }
.ra-msg summary::before { margin: 0 8px 2px 2px; transform: rotate(-45deg); }
.ra-msg details[open] summary::before { transform: rotate(45deg); }
.ra-msg details p { padding: 7px 10px; margin: 4px 0 0 3px; border-left: 2px solid #536776; color: var(--ra-muted); font-size: 13px; }

.ra-compose { flex: 0 0 auto; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); }
.ra-compose form { margin: 0; padding: 12px 12px 9px; border: 1px solid #475564; border-radius: 18px; background: var(--ra-raised); }
.ra-compose form:focus-within { border-color: #76949e; }
#ra-question { display: block; resize: none; width: 100%; min-height: 35px; max-height: 108px; margin: 0;
  padding: 3px 4px; box-shadow: none; border: 0; border-radius: 0; background: transparent; color: var(--ra-fg);
  font-size: 15px; line-height: 1.5; }
#ride-assistant #ra-question:focus-visible { outline: none; }
#ra-question::placeholder { color: #abb7c6; }
.ra-tools { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
#ra-provider { margin: 0 auto 0 4px; font-size: 12px; color: var(--ra-muted); }
#ra-mic, #ra-send { display: inline-flex; justify-content: center; align-items: center; border: 0; }
#ra-mic { padding: 6px 8px; gap: 5px; border-radius: 8px; background: transparent; color: #d6e1e8; font-size: 13px !important; }
#ra-mic svg { width: 16px; height: 16px; }
#ra-mic[aria-pressed=true] { color: var(--ra-mint); background: #294345; }
#ra-send { width: 34px; height: 34px; border-radius: 50%; background: #dbede9; color: #142e30; }
#ra-send:hover { background: white; }
#ra-send span { font-size: 22px; line-height: 1; }
.ra-follow-up { margin-top: 10px; border: 1px solid var(--ra-line); border-radius: 12px; padding: 5px 10px;
  background: transparent; color: #c6d9db; font-size: 13px !important; }
.ra-follow-up:hover { background: var(--ra-raised); }
.ra-playback { display: flex; width: fit-content; align-items: center; gap: 7px; color: var(--ra-muted); font-size: 12px; padding: 7px 4px 0; cursor: pointer; }
.ra-options { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
#ra-location { padding: 4px; background: transparent; border: 0; color: var(--ra-muted); font-size: 12px; }
#ra-location:hover { color: var(--ra-fg); }
#ra-speak { width: 14px; height: 14px; margin: 0; accent-color: var(--ra-mint); }
#ra-status:not(:empty) { display: block; margin: 0 4px 6px; color: var(--ra-muted); font-size: 13px; }
.ra-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 700px) {
  .ra-launch { right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); padding: 9px 13px; }
  #ride-assistant { width: min(100%, 470px); }
  #ra-question { font-size: 16px; }
  .ra-head { padding: 11px 16px; }
  .ra-context { padding-inline: 16px; }
  .ra-thread:not(:empty) { padding-inline: 17px; }
  .ra-compose { padding-inline: 12px; }
}
@media (max-height: 500px) {
  .ra-welcome { padding-block: 10px; }
  .ra-welcome-icon { display: none; }
}
@media print { .ra-launch, #ride-assistant { display: none !important; } }
