#booksAssistantHost { flex: 0 0 auto; }
#booksAssistantHost > button { min-height: 44px; white-space: nowrap; font-weight: 650; }
.bb-assistant { margin: auto; box-sizing: border-box; width: min(720px, calc(100% - 24px)); max-height: calc(100% - 30px); max-height: min(850px, calc(100dvh - 30px)); overflow: auto; padding: 18px; color: inherit; background: var(--card, var(--panel, Canvas)); border: 1px solid var(--line, #8092a4); border-radius: 16px; }
.bb-assistant::backdrop { background: #101c2dbb; }
.bb-assistant-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.bb-assistant h2, .bb-assistant h3, .bb-assistant p { margin: 0 0 8px; overflow-wrap: anywhere; }
.bb-assistant .bb-assistant-mode { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bb-assistant select, .bb-assistant button { min-height: 44px; }
.bb-assistant [data-log] { display: grid; gap: 8px; max-height: 45vh; overflow: auto; margin-block: 10px; }
.bb-asst-message { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px; border: 1px solid var(--line, #8092a4); border-radius: 10px; }
.bb-asst-message strong { display: block; margin-bottom: 4px; }
.bb-asst-you { background: color-mix(in srgb, var(--accent, #477dd0), transparent 88%); }
.bb-asst-detail { margin-top: 8px; }
.bb-asst-detail summary { cursor: pointer; white-space: normal; }
.bb-asst-detail li { margin-block: 3px; }
.bb-assistant [data-review] { max-width: 100%; }
.bb-assistant textarea { box-sizing: border-box; width: 100%; resize: vertical; }
.bb-assistant-privacy { font-size: .84rem; margin-top: 7px; }
.bb-assistant [data-mic][aria-pressed="true"] { border-color: #bc4036; outline: 2px solid #bc4036; }
@media (max-width: 640px) { .bb-assistant { padding: 12px; } }

/* The shortcut sits above the phone tab bar and stays in reach on every signed-in view. */
.bb-assistant-float:not([hidden]) {
  position: fixed;
  z-index: 4;
  inset-inline-end: max(16px, calc(env(safe-area-inset-right, 0px) + 12px));
  bottom: calc(var(--tabbar-h, 0px) + env(safe-area-inset-bottom, 0px) + 14px);
  box-sizing: border-box;
  width: 60px;
  height: 60px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #344e7a;
  border-radius: 50%;
  color: #fff;
  background: #173765;
  box-shadow: 0 4px 16px #08142d55;
  touch-action: manipulation;
}
.bb-assistant-float:hover, .bb-assistant-float:focus-visible { background: #244e88; }
.bb-assistant-float:focus-visible { outline: 3px solid #5099ec; outline-offset: 3px; }
body:has(.bb-assistant-float:not([hidden])) main { padding-bottom: calc(var(--tabbar-h, 0px) + env(safe-area-inset-bottom, 0px) + 90px); }
