.book-selection-actions, .book-ask-ai-panel {
  --ask-ink: #183d42;
  --ask-accent: #176c69;
  --ask-line: #bdcdcb;
  --ask-paper: #f7faf8;
  color: var(--ask-ink);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1.5;
  box-sizing: border-box;
}
.book-selection-actions[hidden], .book-ask-ai-panel[hidden] { display: none !important; }
.book-selection-actions {
  position: fixed;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  max-width: calc(100vw - 16px);
  border-radius: 5px;
  box-shadow: 0 2px 9px #183d4224;
}
.book-selection-actions button {
  min-height: 29px;
  padding: 4px 9px;
  border: 1px solid #135854;
  border-radius: 5px;
  background: var(--ask-accent);
  color: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
  cursor: pointer;
}
.book-selection-actions .book-report-trigger {
  border-color: #bdcdcb;
  background: #f7faf8;
  color: var(--ask-ink);
}
.book-selection-actions .book-report-trigger:disabled { opacity: .65; }
.book-ask-ai-panel {
  position: fixed;
  inset: 12px 12px 12px auto;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  border: 1px solid var(--ask-line);
  border-radius: 6px;
  background: var(--ask-paper);
  box-shadow: -5px 4px 28px #183d4230;
  overflow: hidden;
}
#book-ask-ai-panel { z-index: 1050; }
.book-ask-ai-panel *, .book-ask-ai-panel *::before, .book-ask-ai-panel *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}
.book-ask-ai-panel header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--ask-line);
  background: #e5efeb;
}
.book-ask-ai-panel h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ask-ink);
  font-weight: 600;
}
.book-ask-ai-actions { display: flex; flex: none; gap: 5px; }
.book-ask-ai-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ask-ink);
  cursor: pointer;
  font-size: 17px;
}
.book-ask-ai-icon:hover { border-color: var(--ask-line); background: #d8e7e1; }
.book-ask-ai-panel button:focus-visible, .book-selection-actions button:focus-visible,
.book-ask-ai-panel textarea:focus-visible, .book-ask-ai-panel summary:focus-visible {
  outline: 3px solid #c6892b;
  outline-offset: 2px;
}
.book-ask-ai-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 15px; }
.book-ask-ai-location {
  display: block;
  margin: 0 0 12px;
  color: #4b6466;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.book-ask-ai-selection {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid #c6892b;
  background: #f3ecd9;
  color: #344240;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 175px;
  overflow-y: auto;
}
.book-ask-ai-context { margin-bottom: 16px; }
.book-ask-ai-context summary { cursor: pointer; font-size: 13px; color: #4b6466; }
.book-ask-ai-context pre {
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--ask-line);
  border-radius: 3px;
  max-height: 220px;
  overflow: auto;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #edf3ef;
  color: #344240;
}
.book-ask-ai-suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; }
.book-ask-ai-suggestions button {
  margin: 0;
  padding: 6px 9px;
  min-height: 34px;
  border: 1px solid var(--ask-line);
  border-radius: 4px;
  background: #fff;
  color: var(--ask-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.book-ask-ai-suggestions button:hover { border-color: var(--ask-accent); background: #e5efeb; }
.book-ask-ai-message { border-top: 1px solid var(--ask-line); margin-top: 13px; padding-top: 12px; overflow-wrap: anywhere; }
.book-ask-ai-message > header { border: 0; background: none; padding: 0; margin: 0 0 5px; }
.book-ask-ai-message > header strong { font-size: 12px; text-transform: uppercase; color: #496263; font-weight: 600; }
.book-ask-ai-message p { margin: 0 0 9px; font-size: 15px; line-height: 1.55; }
.book-ask-ai-message ul, .book-ask-ai-message ol { padding-left: 22px; }
.book-ask-ai-message code { font-size: 13px; background: #e8efeb; color: #243e3f; }
.book-ask-ai-message pre { padding: 11px; border-radius: 3px; background: #e8efeb; overflow-x: auto; }
.book-ask-ai-message pre code { white-space: pre; overflow-wrap: normal; }
.book-ask-ai-message a { color: var(--ask-accent); }
.book-ask-ai-message .book-ask-ai-icon { width: 29px; height: 29px; font-size: 13px; }
.book-ask-ai-panel footer { flex: none; padding: 11px 15px 13px; border-top: 1px solid var(--ask-line); background: #edf3ef; }
.book-ask-ai-status { min-height: 20px; margin: 0 0 7px; font-size: 12px; line-height: 1.45; color: #4b6466; overflow-wrap: anywhere; }
.book-ask-ai-status[data-error="true"] { color: #963c2e; }
.book-ask-ai-panel form { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.book-ask-ai-panel textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 65px;
  max-height: 150px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid #a4b9b5;
  border-radius: 4px;
  background: #fff;
  color: var(--ask-ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
}
.book-ask-ai-send { background: var(--ask-accent); color: #fff; border-color: var(--ask-accent); margin-bottom: 1px; }
.book-ask-ai-send:hover { background: #135854; color: #fff; }
.book-ask-ai-panel button:disabled { opacity: .55; cursor: default; }
.book-open-issues {
  width: fit-content;
  max-width: 100%;
  margin: 0.25rem 0 0.9rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid #b8d1cb;
  border-radius: 4px;
  background: #edf4f0;
  color: #185750;
  font-size: 11.9px;
  line-height: 1.45;
}
.book-open-issues summary { cursor: pointer; font-weight: 600; }
.book-open-issues ul { margin: 0.4rem 0 0.2rem; padding-left: 1.1rem; }
.book-open-issues li + li { margin-top: 0.2rem; }
.book-open-issues a { color: #185750; overflow-wrap: anywhere; }
.book-open-issues-selection {
  display: block;
  margin-top: 0.1rem;
  padding: 0;
  border: 0;
  background: none;
  color: #185750;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}
.book-open-issues-selection:hover { color: #0d403b; }
.book-open-issues-selection:focus-visible { outline: 2px solid #185750; outline-offset: 2px; }
.book-open-issues-find-status { display: block; color: #596b68; }
::highlight(book-issue-match) { background: #f4d89b; color: #182b2d; }
.book-issue-match-fallback { background: #f4d89b; }
.book-open-issues-status { margin: 0.25rem 0 0.9rem; color: #596b68; font-size: 11.9px; }
@media screen and (min-width: 1100px) {
  body.book-ask-ai-open #quarto-content {
    width: calc(100% - 440px);
    grid-template-columns: [screen-start] 16px [screen-start-inset page-start] 230px
      [page-start-inset body-start-outset body-start body-content-start] minmax(0, 1fr)
      [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 16px [screen-end];
  }
  body.book-ask-ai-open #quarto-sidebar { width: 230px; }
  body.book-ask-ai-open #quarto-margin-sidebar { display: none; }
}
@media (max-width: 600px) {
  .book-selection-actions button { padding: 4px 9px; }
  .book-ask-ai-panel { inset: auto 8px 8px; width: calc(100vw - 16px); height: 82dvh; }
  .book-ask-ai-panel header { padding: 10px 12px; }
  .book-ask-ai-scroll { padding: 12px; }
  .book-ask-ai-panel footer { padding: 10px 12px; }
  .book-ask-ai-selection { max-height: 105px; }
}
@media print {
  .book-selection-actions, .book-ask-ai-panel, .book-open-issues,
  .book-open-issues-status { display: none !important; }
}
