:root {
  --ba-bg: #090a0c;
  --ba-panel: #141518;
  --ba-panel-raised: #1d1f22;
  --ba-line: rgba(255, 255, 255, 0.1);
  --ba-line-strong: rgba(255, 255, 255, 0.16);
  --ba-text: #f6f6f7;
  --ba-muted: rgba(255, 255, 255, 0.56);
  --ba-dim: rgba(255, 255, 255, 0.38);
  --ba-brand-art: var(--brand-art, url('/assets/web/energy-glass.jpg'));
}

.ba-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(12px, 3vw, 32px);
  border: 0;
  background: rgba(0, 0, 0, 0.76);
  color: var(--ba-text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
.ba-overlay::backdrop {
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.ba-modal {
  position: relative;
  box-sizing: border-box;
  width: min(100%, 520px);
  max-height: min(92dvh, 860px);
  overflow: auto;
  border: 1px solid var(--ba-line-strong);
  border-radius: 24px;
  background: linear-gradient(155deg, #191a1d 0%, #111214 72%);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  overscroll-behavior: contain;
}
.ba-x {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(8, 9, 10, 0.58);
  color: rgba(255, 255, 255, 0.82);
  font: 22px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.ba-x:hover {
  border-color: rgba(255, 255, 255, 0.23);
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}
.ba-x:focus-visible,
.ba-overlay button:focus-visible,
.ba-overlay input:focus-visible,
.ba-overlay select:focus-visible,
.ba-assistant button:focus-visible,
.ba-assistant select:focus-visible {
  outline: 2px solid #c2dcff;
  outline-offset: 3px;
}
.ba-eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
}
.ba-muted { color: var(--ba-muted); }

/* Sign-in and account creation */
.ba-overlay.ba-auth-dialog .ba-modal {
  width: min(100%, 980px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #3b3d42 transparent;
}
.ba-auth-layout {
  display: grid;
  min-height: min(680px, 82dvh);
  grid-template-columns: minmax(0, 0.94fr) minmax(380px, 1fr);
}
.ba-auth-brand {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  isolation: isolate;
}
.ba-brand-visual {
  position: relative;
  height: clamp(320px, 52dvh, 440px);
  flex: none;
  background: #000;
}
.ba-brand-visual img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  object-fit: contain;
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.ba-brand-visual::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 76%, #000 100%);
  content: "";
}
.ba-auth-brand-copy { box-sizing: border-box; width: 100%; max-width: 460px; margin: auto auto 0; padding: 0 32px 32px; }
.ba-wordmark,
.ba-auth-mobile-wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.ba-wordmark img,
.ba-auth-mobile-wordmark img { width: 23px; height: 23px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 6px; object-fit: cover; }
.ba-auth-brand-copy .ba-eyebrow { margin-bottom: 18px; }
.ba-auth-brand-copy h2 {
  max-width: 370px;
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 580;
  letter-spacing: -0.045em;
  line-height: 1.14;
}
.ba-auth-brand-copy > p:last-child {
  max-width: 350px;
  margin: 0;
  color: rgba(255, 255, 255, 0.69);
  font-size: 14px;
  line-height: 1.7;
}
.ba-auth-panel {
  position: relative;
  min-width: 0;
  padding: 44px clamp(30px, 4vw, 56px) 28px;
  background: linear-gradient(155deg, #191a1d, #111214 74%);
}
.ba-auth-heading { margin: 2px 0 24px; padding-right: 22px; }
.ba-auth-heading .ba-eyebrow { margin-bottom: 10px; }
.ba-auth-heading h1 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.16;
}
.ba-auth-heading > p:last-child {
  max-width: 400px;
  margin: 0;
  color: var(--ba-muted);
  font-size: 13px;
  line-height: 1.65;
}
.ba-auth-mobile-wordmark { display: none; }
.ba-providers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ba-oauth {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--ba-line-strong);
  border-radius: 14px;
  background: #202124;
  color: #f7f7f8;
  font: 600 13px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.ba-oauth:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.27); background: #27292c; }
.ba-oauth:disabled { opacity: 0.58; cursor: wait; }
.ba-oauth[data-unavailable] { cursor: default; }
.ba-oauth small { color: var(--ba-muted); font-size: 10px; font-weight: 400; }
.ba-wechat { grid-column: 1 / -1; }
.ba-wechat:disabled { opacity: 0.7; cursor: default; transform: none; background: #202124; border-color: var(--ba-line-strong); }
.ba-wechat-mark { display: flex; flex: none; width: 21px; height: 21px; }
.ba-wechat-mark svg { width: 100%; height: 100%; }
.ba-wechat small { color: var(--ba-muted); font-size: 10px; font-weight: 400; }
.ba-apple-mark { color: #fff; font-size: 19px; line-height: 1; }
.ba-google-mark { color: #8db3ff; font-size: 17px; font-weight: 800; }
.ba-provider-note {
  margin: 9px 0 17px;
  color: var(--ba-dim);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.ba-divider { display: flex; align-items: center; gap: 12px; margin: 0 0 15px; color: rgba(255, 255, 255, 0.39); }
.ba-divider::before,
.ba-divider::after { height: 1px; flex: 1; background: rgba(255, 255, 255, 0.09); content: ""; }
.ba-divider span { font-size: 9px; font-weight: 650; letter-spacing: 0.13em; white-space: nowrap; }
.ba-providers[hidden], .ba-provider-note[hidden], .ba-divider[hidden] { display: none; }
.ba-auth-form { display: grid; gap: 12px; }
.ba-text-link { min-height: 32px; padding: 5px 0; border: 0; background: none; color: rgba(255, 255, 255, 0.84); font: inherit; cursor: pointer; text-underline-offset: 3px; }
.ba-text-link:hover { color: #fff; text-decoration: underline; }
.ba-forgot { margin: -7px 0 -8px; text-align: right; font-size: 11px; }
.ba-forgot .ba-text-link { color: var(--ba-muted); }
.ba-auth-switch { margin: 14px 0 0; color: var(--ba-muted); font-size: 12px; line-height: 1.5; text-align: center; }
.ba-field { display: grid; min-width: 0; gap: 7px; margin: 0; color: rgba(255, 255, 255, 0.77); font-size: 12px; font-weight: 560; }
.ba-field input,
.ba-setting-row select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ba-line);
  border-radius: 14px;
  outline: none;
  background: #101113;
  color: #fff;
  font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: border-color 160ms ease, background 160ms ease;
}
.ba-field input::placeholder { color: rgba(255, 255, 255, 0.31); }
.ba-field input:focus,
.ba-setting-row select:focus { border-color: rgba(213, 224, 241, 0.5); background: #141518; }
.ba-primary,
.ba-secondary {
  display: inline-flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: #f1f1f0;
  color: #101112;
  font: 650 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}
.ba-primary:hover { transform: translateY(-1px); background: #fff; }
.ba-primary:disabled,
.ba-secondary:disabled { opacity: 0.52; cursor: wait; transform: none; }
.ba-auth-form .ba-primary { width: 100%; margin-top: 4px; }
.ba-secondary { background: rgba(255, 255, 255, 0.055); color: rgba(255, 255, 255, 0.87); }
.ba-secondary:hover { background: rgba(255, 255, 255, 0.1); }
.ba-auth-legal { margin: 14px 0 0; color: rgba(255, 255, 255, 0.36); font-size: 10px; line-height: 1.5; text-align: center; }
.ba-auth-legal a {color:#999ba3;font-size:11px;text-decoration:none;}
.ba-auth-legal a:hover {color:#e2e3e6;text-decoration:underline;}
.ba-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #a8d6b3;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ba-status:empty { min-height: 0; margin: 0; }
.ba-status.error { color: #ffaaaa; }

/* Account preferences */
.ba-overlay.ba-settings-dialog .ba-modal { width: min(100%, 610px); }
.ba-settings { position: relative; padding: 34px; }
.ba-settings-profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 6px 42px 23px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.085);
}
.ba-settings-profile > img,
.ba-settings-profile > .ba-avatar { width: 58px; height: 58px; flex: none; border-radius: 18px; object-fit: cover; }
.ba-avatar { display: grid; place-items: center; background: linear-gradient(145deg, #46484c, #252629); color: white; font-size: 21px; font-weight: 650; }
.ba-settings-profile-copy { min-width: 0; flex: 1; }
.ba-settings-profile-copy .ba-eyebrow { margin-bottom: 4px; }
.ba-settings-profile h1 { overflow: hidden; margin: 0; color: #fff; font-size: 19px; font-weight: 620; letter-spacing: -0.025em; text-overflow: ellipsis; white-space: nowrap; }
.ba-settings-profile-copy > p:last-child { overflow: hidden; margin: 3px 0 0; color: var(--ba-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ba-account-status { display: flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, 0.53); font-size: 10px; white-space: nowrap; }
.ba-account-status i { width: 6px; height: 6px; border-radius: 50%; background: #97cba1; box-shadow: 0 0 11px rgba(151, 203, 161, 0.42); }
.ba-settings-intro { padding: 24px 0 22px; }
.ba-settings-intro .ba-eyebrow { margin-bottom: 8px; }
.ba-settings-intro h2 { max-width: 440px; margin: 0 0 7px; color: #fff; font-size: 22px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.22; }
.ba-settings-intro > p:last-child { max-width: 480px; margin: 0; color: var(--ba-muted); font-size: 12px; line-height: 1.55; }
.ba-settings-section { margin-top: 3px; }
.ba-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.ba-section-heading h3 { margin: 0; color: rgba(255, 255, 255, 0.88); font-size: 13px; font-weight: 620; }
.ba-section-heading p { margin: 3px 0 0; color: var(--ba-dim); font-size: 11px; }
.ba-section-mark { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border: 1px solid var(--ba-line); border-radius: 12px; color: rgba(255, 255, 255, 0.61); }
.ba-settings-card { overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 18px; background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)); }
.ba-setting-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 15px; }
.ba-setting-row + .ba-setting-row { border-top: 1px solid rgba(255, 255, 255, 0.075); }
.ba-setting-copy { display: grid; min-width: 0; gap: 4px; }
.ba-setting-copy strong { color: rgba(255, 255, 255, 0.9); font-size: 12px; font-weight: 600; }
.ba-setting-copy small { color: var(--ba-muted); font-size: 10px; line-height: 1.45; }
.ba-setting-row select { width: min(190px, 42%); height: 42px; flex: none; padding: 0 30px 0 12px; border-radius: 12px; background-color: #111214; font-size: 11px; }
.ba-settings-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 20px; }
.ba-settings-actions .ba-secondary { min-width: 128px; }
.ba-settings-actions .ba-primary,
.ba-settings-actions .ba-secondary { margin: 0; }
.ba-settings .ba-status { min-height: 18px; }

.ba-overlay.ba-consent-dialog .ba-modal { width: min(100%, 480px); }
.ba-consent { position: relative; padding: 36px; }
.ba-consent .ba-eyebrow { margin: 0 42px 10px 0; }
.ba-consent h1 { margin: 0 42px 12px 0; color: #fff; font-size: 23px; font-weight: 620; letter-spacing: -0.035em; }
.ba-consent-copy { margin: 0; color: var(--ba-muted); font-size: 14px; line-height: 1.7; }
.ba-consent-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 26px; }
.ba-consent-actions button { width: 100%; }

/* Assistant */
.ba-assistant {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #35363a transparent;
  scroll-padding-block: 88px 16px;
  background: #08090a;
  color: var(--ba-text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
.ba-assistant-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  min-height: 58px;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 9, 10, 0.86);
  backdrop-filter: blur(18px);
}
.ba-assistant-title { position: absolute; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.9); font-size: 14px; font-weight: 620; white-space: nowrap; }
.ba-beta { margin-left: 6px; padding: 3px 7px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 20px; color: rgba(255, 255, 255, 0.53); font-size: 8px; font-weight: 650; letter-spacing: 0.12em; vertical-align: 2px; }
.ba-circle {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 50%;
  background: #f1f1f0;
  color: #101112;
  font-size: 17px;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}
.ba-circle:hover { transform: translateY(-1px); background: #fff; }
.ba-thread {
  position: relative;
  z-index: 0;
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 22px max(18px, calc((100% - 780px) / 2)) 20px;
  scrollbar-color: #35363a transparent;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.ba-welcome { display: flex; width: min(100%, 700px); flex-direction: column; align-items: center; margin: 0 auto; padding: 46px 0 24px; text-align: center; }
/* Welcome cards keep their natural height when a browser window gets shorter. */
.ba-assistant:has(.ba-welcome) .ba-thread { flex: 1 0 auto; overflow: visible; }
.ba-welcome, .ba-welcome-copy, .ba-prompts, .ba-composer { min-width: 0; }
.ba-welcome-copy, .ba-prompt-copy { overflow-wrap: anywhere; }
.ba-welcome-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
.ba-welcome-copy { max-width: 600px; }
.ba-welcome-copy .ba-eyebrow { margin: 0 0 8px; color: rgba(255, 255, 255, 0.44); }
.ba-welcome h1 { margin: 0; color: #f6f6f7; font-size: 24px; font-weight: 620; letter-spacing: -0.03em; line-height: 1.28; }
.ba-welcome-subtitle { margin: 8px 0 0; color: var(--ba-muted); font-size: 12px; line-height: 1.5; }
.ba-prompts { position: relative; isolation: isolate; display: grid; width: min(100%, 610px); gap: 16px; margin-top: 22px; }
/* Match AssistantView's shared prompt aura, without doubling light between cards. */
.ba-prompts:not(.ba-prompts-article)::before,
.ba-prompts:not(.ba-prompts-article)::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to top right, #85a3f5, #ab9ee8, rgba(135, 153, 204, 0.45));
}
.ba-prompts:not(.ba-prompts-article)::before {
  inset: -11.5px;
  border-radius: 28px;
  filter: blur(24px);
  opacity: 0.28;
  animation: ba-aura-breathe 6s ease-in-out infinite;
}
.ba-prompts:not(.ba-prompts-article)::after {
  inset: -3.2px;
  border-radius: 22px;
  filter: blur(12px);
  opacity: 0.32;
  transform: translate(-3px, 4px);
  animation: ba-aura-detail-breathe 6s ease-in-out -0.8s infinite;
}
@keyframes ba-aura-breathe {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.28; }
}
@keyframes ba-aura-detail-breathe {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.32; }
}
@keyframes ba-composer-breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.ba-prompts button {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  background: linear-gradient(135deg, #242424, #181818);
  box-shadow: -2px 2px 18px rgba(163, 179, 232, 0.22);
  color: rgba(255, 255, 255, 0.86);
  text-align: left;
  font: 550 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: border-color 170ms ease, background 170ms ease, transform 170ms ease;
}
.ba-prompts button:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.2); background: linear-gradient(135deg, #232529, #151619 82%); }
.ba-prompts-article button { background: #0c0c0c; border-color: rgba(255, 255, 255, 0.08); box-shadow: none; }
.ba-prompt-copy { display: grid; min-width: 0; gap: 4px; }
.ba-prompt-copy small { color: rgba(255, 255, 255, 0.42); font-size: 10px; font-weight: 450; }
.ba-prompt-arrow { display: grid; width: 31px; height: 31px; flex: none; place-items: center; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 50%; color: rgba(255, 255, 255, 0.66); font-size: 14px; }
.ba-composer {
  position: relative;
  display: flex;
  width: min(calc(100% - 32px), 760px);
  min-height: 118px;
  flex: none;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  margin: 12px auto max(16px, env(safe-area-inset-bottom));
  padding: 12px;
  border: 0.5px solid transparent;
  border-radius: 22px;
  background: linear-gradient(#131313, #131313) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)) border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.ba-composer::before {
  content: "";
  position: absolute;
  inset: -0.5px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 44px rgba(255, 255, 255, 0.20),
    0 0 14px rgba(255, 255, 255, 0.095);
  animation: ba-composer-breathe 6s ease-in-out -1.5s infinite;
}
.ba-composer textarea { box-sizing: border-box; width: 100%; min-height: 48px; max-height: none; flex: none; resize: none; overflow: hidden; padding: 3px 4px; border: 0; border-radius: 10px; outline: none; box-shadow: none; background: transparent; color: #fff; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.ba-composer textarea:focus, .ba-composer textarea:focus-visible { outline: none; box-shadow: none; }
.ba-composer textarea::placeholder { color: rgba(255, 255, 255, 0.4); }
.ba-composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ba-reasoning { position: relative; z-index: 3; }
.ba-reasoning summary { display: flex; height: 30px; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 20px; background: rgba(255, 255, 255, 0.055); color: rgba(255, 255, 255, 0.56); font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
.ba-reasoning summary::-webkit-details-marker { display: none; }
.ba-reasoning summary[aria-disabled=true] { opacity: 0.45; cursor: default; }
.ba-reasoning summary:hover { background: rgba(255, 255, 255, 0.08); }
.ba-reasoning summary:focus-visible, .ba-reasoning-slider:focus-visible { outline: 1px solid rgba(255, 255, 255, 0.35); outline-offset: 4px; border-radius: 24px; }
.ba-reasoning-chevron { display: flex; transform: rotate(180deg); transition: transform 180ms ease; }
.ba-reasoning-chevron svg { width: 11px; height: 11px; }
.ba-reasoning[open] .ba-reasoning-chevron { transform: rotate(0); }
.ba-reasoning-panel { box-sizing: border-box; position: fixed; z-index: 60; width: 256px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 12px 12px 8px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 18px; background: #222224; box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5); }
.ba-reasoning-track { position: relative; height: 28px; }
.ba-reasoning-track::before { content: ""; position: absolute; inset: 2px 0; border-radius: 12px; background: rgba(255, 255, 255, 0.13); }
.ba-reasoning-fill { position: absolute; top: 2px; bottom: 2px; left: 0; width: min(100%, calc(26px + (100% - 28px) * var(--effort-progress))); border-radius: 12px; background: #2e94fa; transition: width 350ms ease; }
.ba-reasoning-fill::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(110deg, #2e7dfa, #9457ff, #6e33e0); background-size: 120% 100%; opacity: 0; transition: opacity 350ms ease; }
.ba-reasoning[data-effort=high] .ba-reasoning-fill::before { opacity: 1; }
.ba-reasoning[open] .ba-reasoning-fill::before { animation: ba-reasoning-flow 9.6s ease-in-out infinite; }
.ba-reasoning-sparks { position: absolute; inset: 2px 0; overflow: hidden; border-radius: 12px; pointer-events: none; opacity: 0; transition: opacity 350ms ease; }
.ba-reasoning[open][data-effort=high] .ba-reasoning-sparks { opacity: 1; }
.ba-reasoning-sparks > span { position: absolute; inset: 0; transform: translateX(var(--spark-x)); }
.ba-reasoning-sparks i { position: absolute; left: 0; top: var(--spark-y); width: calc(var(--spark-size) * .75); height: calc(var(--spark-size) * .75); border-radius: 50%; background: white; box-shadow: 0 0 3px rgba(255, 255, 255, 0.3); animation: ba-reasoning-star-pulse var(--spark-pulse) ease-in-out var(--spark-phase) infinite paused; }
.ba-reasoning[open] .ba-reasoning-sparks * { animation-play-state: running; }
@keyframes ba-reasoning-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes ba-reasoning-star-pulse { 0%, 100% { opacity: 0.48; } 50% { opacity: 1; } }
.ba-reasoning-stops { position: absolute; inset: 0 11.5px; display: flex; align-items: center; justify-content: space-between; }
.ba-reasoning-stops i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); transition: opacity 350ms ease; }
.ba-reasoning[data-effort=high] .ba-reasoning-stops i:not(:last-child) { opacity: 0; }
.ba-reasoning-thumb { position: absolute; top: 0; left: calc((100% - 28px) * var(--effort-progress)); width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2); pointer-events: none; transition: left 350ms ease; }
.ba-reasoning-slider { position: absolute; top: -8px; left: 0; display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 44px; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.ba-reasoning-slider::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.ba-reasoning-slider::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; }
.ba-reasoning-slider::-moz-range-track { height: 28px; background: transparent; }
.ba-reasoning-slider::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; }
.ba-reasoning-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ba-reasoning-labels button { padding: 4px 0; border: 0; border-radius: 5px; background: transparent; color: rgba(255, 255, 255, 0.42); font: 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; }
.ba-reasoning-labels button[aria-pressed=true] { color: rgba(255, 255, 255, 0.82); }
.ba-send { display: grid; width: 40px; height: 40px; flex: none; place-items: center; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 50%; background: #f1f1f0; color: #101112; font-size: 19px; font-weight: 700; cursor: pointer; transition: transform 150ms ease, background 150ms ease; }
.ba-send:hover { transform: translateY(-1px); background: #fff; }
.ba-message { max-width: 760px; margin: 0 auto 24px; overflow-wrap: anywhere; white-space: normal; }
.ba-message.user { width: fit-content; max-width: min(82%, 600px); margin-right: max(0px, calc((100% - 780px) / 2)); margin-left: auto; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, 0.075); border-radius: 18px 18px 5px 18px; background: #222427; color: #f5f5f5; }
.ba-message.assistant { padding: 3px 0; color: rgba(255, 255, 255, 0.88); font-size: 14px; line-height: 1.72; }
.ba-message code { padding: 2px 5px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); }
.ba-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ba-sources a { padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; background: rgba(255, 255, 255, 0.025); color: #cbd6f2; font-size: 10px; text-decoration: none; }
.ba-sources a:hover { border-color: rgba(255, 255, 255, 0.22); text-decoration: underline; }
.ba-assistant-error { width: min(calc(100% - 36px), 760px); margin: 0 auto; padding: 12px 14px; border: 1px solid rgba(255, 120, 120, 0.23); border-radius: 14px; background: rgba(110, 27, 27, 0.2); color: #ffb7b7; font-size: 12px; }
.ba-assistant-error button { margin-left: 8px; border: 0; background: none; color: white; font: inherit; text-decoration: underline; cursor: pointer; }
.ba-history { position: absolute; z-index: 2; inset: 0 auto 0 0; width: min(320px, 84%); overflow: auto; padding: 18px 14px; border-right: 1px solid rgba(255, 255, 255, 0.09); background: #131416; box-shadow: 18px 0 42px rgba(0, 0, 0, 0.35); }
.ba-history-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; color: rgba(255, 255, 255, 0.88); font-size: 13px; font-weight: 630; }
.ba-history-title button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--ba-line); border-radius: 50%; background: #202124; color: white; font-size: 18px; cursor: pointer; }
.ba-history > button:not(.ba-circle) { display: block; width: 100%; overflow: hidden; margin: 5px 0; padding: 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: rgba(255, 255, 255, 0.74); font: inherit; font-size: 12px; line-height: 1.4; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ba-history > button:hover { border-color: rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.055); }
.ba-history .ba-muted { padding: 14px 8px; color: var(--ba-muted); font-size: 12px; }

@media (min-width: 1000px) {
  #assistant .ba-welcome { padding-top: 46px; }
  #assistant .ba-welcome h1 { font-size: 24px; }
  #assistant .ba-prompts { width: min(100%, 660px); gap: 16px; }
  #assistant .ba-history { width: 280px; }
  #assistant .ba-assistant:has(.ba-history) { padding-left: 280px; }
}
@media (max-width: 720px) {
  .ba-overlay { padding: 12px; }
  .ba-overlay.ba-auth-dialog .ba-modal { width: min(100%, 520px); max-height: min(94dvh, 860px); overflow: auto; }
  .ba-auth-layout { min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .ba-auth-brand { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .ba-brand-visual { height: clamp(180px, 30dvh, 240px); }
  .ba-auth-brand-copy { max-width: 520px; padding: 0 22px 22px; }
  .ba-auth-brand-copy .ba-eyebrow,
  .ba-auth-brand-copy > p:last-child { display: none; }
  .ba-auth-brand-copy h2 { max-width: 440px; margin: 9px 0 0; font-size: 23px; line-height: 1.2; }
  .ba-auth-brand-copy .ba-wordmark { font-size: 10px; }
  .ba-auth-panel { padding: 24px 22px 22px; }
  .ba-auth-heading { margin: 0 0 19px; }
  .ba-auth-heading h1 { font-size: 26px; }
  .ba-auth-mobile-wordmark { display: none; }
  .ba-overlay.ba-settings-dialog .ba-modal { width: min(100%, 540px); }
  .ba-settings { padding: 26px 22px 22px; }
  .ba-consent { padding: 28px 22px 22px; }
  .ba-consent-actions { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 22px; }
  .ba-settings-profile { padding-right: 38px; }
  .ba-account-status { display: none; }
  .ba-welcome { padding-top: 46px; }
  .ba-thread { padding-right: 16px; padding-left: 16px; }
}
@media (max-width: 420px) {
  .ba-providers { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ba-oauth { min-height: 46px; }
  .ba-provider-note { margin: 7px 0 13px; }
  .ba-auth-panel { padding: 22px 18px 18px; }
  .ba-settings { padding: 24px 18px 18px; }
  .ba-consent { padding: 24px 18px 18px; }
  .ba-settings-profile > img,
  .ba-settings-profile > .ba-avatar { width: 50px; height: 50px; border-radius: 15px; }
  .ba-settings-intro h2 { font-size: 20px; }
  .ba-setting-row { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px; }
  .ba-setting-row select { width: 100%; max-width: none; }
  .ba-settings-actions { grid-template-columns: minmax(0, 1fr); }
  .ba-settings-actions .ba-secondary { width: 100%; }
  .ba-welcome { padding-top: 46px; }
  .ba-prompts { gap: 12px; margin-top: 19px; }
  .ba-composer { width: calc(100% - 24px); border-radius: 19px; }
}
@media (max-width: 360px) {
  .ba-overlay { padding: 8px; }
  .ba-overlay.ba-auth-dialog .ba-modal { max-height: calc(100dvh - 16px); border-radius: 20px; }
  .ba-auth-brand-copy { padding: 0 18px 18px; }
  .ba-auth-brand-copy h2 { font-size: 21px; }
  .ba-auth-panel { padding: 19px 15px 16px; }
  .ba-auth-heading { padding-right: 20px; }
  .ba-auth-heading h1 { font-size: 23px; }
  .ba-settings { padding: 21px 15px 15px; }
  .ba-settings-intro { padding-top: 19px; }
  .ba-settings-intro h2 { padding-right: 20px; font-size: 18px; }
  .ba-welcome h1 { font-size: 22px; }
  .ba-prompts button { padding: 11px 12px; }
}
@media (max-height: 700px) {
  #assistant .ba-assistant-head { min-height: 58px; }
  #assistant .ba-welcome { padding-top: clamp(10px, 3dvh, 22px); padding-bottom: 16px; }
  #assistant .ba-thread { padding-top: 16px; padding-bottom: 16px; }
  #assistant .ba-welcome-symbol { margin-bottom: 10px; }
  #assistant .ba-prompts { margin-top: 16px; gap: 12px; }
  #assistant .ba-composer { margin-top: 8px; margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ba-overlay *, .ba-assistant * { scroll-behavior: auto !important; transition: none !important; }
  .ba-prompts::before, .ba-prompts::after, .ba-composer::before { animation: none !important; }
  .ba-reasoning-fill, .ba-reasoning-fill::before, .ba-reasoning-sparks, .ba-reasoning-sparks * { animation: none !important; }
}
