/* Digital test interface, modeled on the Bluebook testing app. */
.bb {
  --bb-ink: #1e1e1e;
  --bb-blue: #324dc7;
  --bb-blue-dark: #2a40a8;
  --bb-chrome: #edf1f8;
  --bb-gray: #f0f0f0;
  --bb-line: #c8c8c8;
  --bb-red: #c13145;
  --bb-yellow: #fedb00;
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: #fff; color: var(--bb-ink);
  font-family: var(--sans);
}

/* ---------- Header ---------- */
.bb-header {
  flex: none; height: 76px; padding: 0 28px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--bb-chrome);
}
.bb-h-left { min-width: 0; }
.bb-section-title { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-directions-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 0;
  background: none; border: none; cursor: pointer; font-weight: 600; font-size: 15px;
}
.bb-directions-btn svg { transition: transform .15s; }
.bb-directions-btn.open svg { transform: rotate(180deg); }
.bb-directions-btn:hover { text-decoration: underline; }

.bb-h-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bb-timer { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; display: flex; align-items: center; height: 28px; }
.bb-timer.warn { color: #b3261e; }
.bb-timer-icon { display: none; }
.bb-timer.hidden-time .bb-timer-text { display: none; }
.bb-timer.hidden-time .bb-timer-icon { display: inline-flex; }
.bb-timer-caption { font-size: 12px; color: #555; }
.bb-hide-btn {
  border: 1px solid var(--bb-ink); background: transparent; border-radius: 999px;
  padding: 1px 12px; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 20px;
}
.bb-hide-btn:hover { background: #fff; }

.bb-h-right { display: flex; justify-content: flex-end; align-items: center; gap: 22px; }
.bb-tool {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; padding: 4px 2px; font-size: 12.5px; font-weight: 600;
  border-bottom: 2px solid transparent;
}
.bb-tool:hover span { text-decoration: underline; }
.bb-tool.on { color: var(--bb-blue); border-bottom-color: var(--bb-blue); }
.bb-more-wrap { position: relative; }
.bb-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 220px;
  background: #fff; border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.22); padding: 6px 0;
}
.bb-menu button { display: block; width: 100%; text-align: left; padding: 10px 18px; background: none; border: none; cursor: pointer; font-size: 15px; }
.bb-menu button:hover { background: var(--bb-gray); }

/* The dashed rule that frames the header and footer. */
.bb-dashes {
  flex: none; height: 3px;
  background: repeating-linear-gradient(90deg, var(--bb-ink) 0 20px, transparent 20px 26px);
  background-color: var(--bb-chrome);
}

/* ---------- Directions ---------- */
.bb-directions {
  position: absolute; top: 79px; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(0,0,0,.35);
}
.bb-directions-card {
  background: #fff; max-height: calc(100% - 40px); overflow: auto;
  padding: 28px 48px 20px; box-shadow: 0 6px 20px rgba(0,0,0,.2);
  font-family: var(--serif); font-size: 16.5px; line-height: 1.6;
}
.bb-directions-body { max-width: 980px; }
.bb-directions-body p { margin: 0 0 12px; }
.bb-directions-body ul { margin: 0 0 12px; padding-left: 22px; }
.bb-directions-body .bb-spr-dir { font-size: 16px; }
.bb-directions-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.bb-btn-yellow {
  background: var(--bb-yellow); color: var(--bb-ink); border: 1px solid var(--bb-ink); border-radius: 999px;
  padding: 9px 26px; font-weight: 700; font-family: var(--sans); font-size: 15px; cursor: pointer;
}
.bb-btn-yellow:hover { filter: brightness(.96); }

/* ---------- Main ---------- */
.bb-main { flex: 1; min-height: 0; position: relative; background: #fff; }
.bb-loading { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #555; }
.bb-loading.bb-error p { margin: 0; }

.bb-split { --split: 50%; display: flex; height: 100%; }
.bb-pane { position: relative; min-width: 0; height: 100%; overflow: hidden; }
.bb-pane-left { flex: 0 0 var(--split); }
.bb-pane-right { flex: 1 1 auto; }
.bb-pane-inner { height: 100%; overflow-y: auto; padding: 36px 48px 48px; }
.bb-pane-left .bb-pane-inner { padding-right: 40px; }
.bb-pane-right .bb-pane-inner { padding-left: 40px; }
.bb-pane-expand {
  position: absolute; top: 8px; right: 12px; z-index: 2; width: 30px; height: 30px; border-radius: 6px;
  background: transparent; border: none; cursor: pointer; display: grid; place-items: center; color: var(--bb-ink);
}
.bb-pane-expand:hover { background: var(--bb-gray); }
.bb-divider {
  flex: none; width: 6px; background: #d4d4d4; position: relative; cursor: col-resize; touch-action: none;
}
.bb-grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 24px; height: 40px; border-radius: 8px; background: var(--bb-ink); color: #fff;
  display: grid; place-items: center;
}
body.dragging, body.dragging * { cursor: col-resize !important; user-select: none !important; }

.bb-single { height: 100%; overflow-y: auto; }
.bb-single-inner { max-width: 760px; margin: 0 auto; padding: 36px 24px 56px; }

/* Content typography */
.bb-passage, .bb-stem, .bb-stim-inline, .bb-opt-text, .bb-rationale, .bb-spr-dir {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.65; color: var(--bb-ink);
}
.bb-passage p, .bb-stem p, .bb-stim-inline p { margin: 0 0 14px; }
.bb-passage p:last-child, .bb-stem p:last-child { margin-bottom: 0; }
.bb-passage img, .bb-stem img, .bb-stim-inline img, .bb-opt-text img, .bb-rationale img { max-width: 100%; height: auto; }
/* Baseline offset for image math is set per image in QB.util.typeset. */
.bb-passage img.math-img, .bb-stem img.math-img, .bb-stim-inline img.math-img, .bb-opt-text img.math-img, .bb-rationale img.math-img { vertical-align: -11px; }
.bb-passage svg, .bb-stem svg, .bb-stim-inline svg, .bb-rationale svg { max-width: 100%; height: auto; }
.bb-passage figure, .bb-stem figure, .bb-stim-inline figure { margin: 0 auto 14px; text-align: center; }
.bb-passage table, .bb-stem table, .bb-stim-inline table, .bb-rationale table {
  border-collapse: collapse; margin: 6px auto 16px; font-size: 15px; line-height: 1.4;
}
.bb-passage th, .bb-passage td, .bb-stem th, .bb-stem td, .bb-stim-inline th, .bb-stim-inline td, .bb-rationale td, .bb-rationale th {
  border: 1px solid var(--bb-ink); padding: 6px 10px; text-align: center; vertical-align: middle;
}
.bb-passage .table_Borderless td, .bb-stem .table_Borderless td, .bb-stim-inline .table_Borderless td { border: none; }
.bb-passage caption, .bb-stem caption, .bb-stim-inline caption { font-weight: 700; padding-bottom: 6px; caption-side: top; }
.bb-passage ul, .bb-passage ol { margin: 0 0 14px; padding-left: 24px; }
.bb-passage .italic, .bb-stem .italic, .bb-opt-text .italic, .bb-rationale .italic { font-style: italic; }
.bb-passage .bold, .bb-stem .bold { font-weight: 700; }
.bb-stim-inline { margin-bottom: 18px; }
.bb-stem { margin: 20px 0 22px; }
.bb-question .bb-stem:first-child { margin-top: 0; }
.bb-pane-right .bb-stem { margin-top: 18px; }
mjx-container[jax="CHTML"] { line-height: 0; }
mjx-container[display="true"] { margin: .6em 0 !important; }

/* ---------- Question header strip ---------- */
.bb-qhead {
  display: flex; align-items: center; gap: 10px; height: 36px; padding-right: 8px;
  background: var(--bb-gray);
  border-bottom: 2px dashed #9b9b9b;
  margin-bottom: 18px;
}
.bb-qnum {
  height: 100%; min-width: 34px; padding: 0 8px; background: var(--bb-ink); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.bb-mark {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer;
  font-size: 14.5px; font-weight: 600; padding: 4px 6px; border-radius: 4px;
}
.bb-mark:hover span { text-decoration: underline; }
.bb-mark.on svg { color: var(--bb-red); }
.bb-qhead-fill { flex: 1; }
.bb-abc {
  background: #fff; border: 1px solid var(--bb-ink); border-radius: 4px; cursor: pointer;
  padding: 1px 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; position: relative; height: 24px;
}
.bb-abc span { position: relative; }
.bb-abc span::after {
  content: ''; position: absolute; left: -3px; right: -3px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(-12deg);
}
.bb-abc.on { background: var(--bb-blue); color: #fff; border-color: var(--bb-blue); }

/* ---------- Answer choices ---------- */
.bb-options { display: flex; flex-direction: column; gap: 14px; }
.bb-opt-row { display: flex; align-items: center; gap: 12px; }
.bb-opt {
  flex: 1; position: relative; display: flex; align-items: center; gap: 14px; text-align: left;
  min-height: 50px; padding: 10px 14px; background: #fff; cursor: pointer;
  border: 1px solid var(--bb-ink); border-radius: 8px;
  transition: box-shadow .08s;
}
.bb-opt:hover:not([aria-disabled="true"]) { box-shadow: inset 0 0 0 1px var(--bb-ink); }
.bb-opt-letter {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bb-ink);
  display: grid; place-items: center; font-family: var(--sans); font-weight: 700; font-size: 14px;
}
.bb-opt-text { flex: 1; min-width: 0; font-size: 16px; line-height: 1.5; }
.bb-opt-text p { margin: 0; }
.bb-opt.selected { border-color: var(--bb-blue); box-shadow: inset 0 0 0 2px var(--bb-blue); }
.bb-opt.selected .bb-opt-letter { background: var(--bb-blue); border-color: var(--bb-blue); color: #fff; }
.bb-opt[aria-disabled="true"] { cursor: default; }

/* Cross-out (ABC) mode */
.bb-elim, .bb-undo { display: none; flex: none; }
.abc-on .bb-elim, .abc-on .bb-undo { display: inline-flex; }
.bb-elim {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--bb-ink); background: #fff;
  align-items: center; justify-content: center; position: relative; cursor: pointer; font-size: 12px; font-weight: 700;
}
.bb-elim::after {
  content: ''; position: absolute; left: -5px; right: -5px; top: 50%; height: 1.5px; background: var(--bb-ink);
}
.bb-elim:hover { background: var(--bb-gray); }
.bb-undo { background: none; border: none; cursor: pointer; font-weight: 700; font-size: 14px; text-decoration: underline; width: 40px; padding: 0; }
.bb-opt.out { color: #8a8a8a; border-color: #9a9a9a; }
.bb-opt.out .bb-opt-letter { border-color: #9a9a9a; color: #8a8a8a; }
.bb-opt.out::after {
  content: ''; position: absolute; left: -6px; right: -6px; top: 50%; height: 2px; background: var(--bb-ink);
}
.bb-opt.out mjx-container { opacity: .55; }

/* Revealed answers */
.bb-opt.is-correct { border-color: #0f7a35; box-shadow: inset 0 0 0 2px #0f7a35; background: #f0faf3; }
.bb-opt.is-correct .bb-opt-letter { background: #0f7a35; border-color: #0f7a35; color: #fff; }
.bb-opt.is-wrong { border-color: #b3261e; box-shadow: inset 0 0 0 2px #b3261e; background: #fdf3f2; }
.bb-opt.is-wrong .bb-opt-letter { background: #b3261e; border-color: #b3261e; color: #fff; }
.bb-opt-flag { flex: none; display: inline-flex; align-items: center; gap: 4px; font-family: var(--sans); font-size: 12.5px; font-weight: 700; }
.bb-opt-flag.ok { color: #0f7a35; }
.bb-opt-flag.bad { color: #b3261e; }

/* ---------- Student-produced response ---------- */
.bb-spr { margin-top: 6px; }
.bb-spr-input {
  width: 180px; height: 52px; padding: 0 14px; font-size: 20px; font-family: var(--sans); font-weight: 500;
  border: 1px solid var(--bb-ink); border-radius: 8px; background: #fff; color: var(--bb-ink);
  border-bottom-width: 3px;
}
.bb-spr-input:focus { outline: none; border-color: var(--bb-blue); box-shadow: 0 0 0 1px var(--bb-blue); }
.bb-spr-input:disabled { background: #f7f7f7; }
.bb-spr-preview { margin-top: 14px; font-size: 15px; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.bb-spr-prev { font-family: var(--serif); font-size: 18px; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; margin: 0 2px; }
.frac-n { border-bottom: 1.5px solid currentColor; padding: 0 3px; }
.frac-d { padding: 0 3px; }
.bb-spr-dir h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 12px; }
.bb-spr-dir ul { padding-left: 20px; margin: 0 0 18px; }
.bb-spr-dir li { margin-bottom: 8px; }
.bb-spr-ex-title { font-weight: 700; text-align: center; margin-bottom: 6px; }
.bb-spr-examples table { width: 100%; border-collapse: collapse; font-size: 15px; }
.bb-spr-examples th, .bb-spr-examples td { border: 1px solid var(--bb-ink); padding: 8px 10px; text-align: center; vertical-align: middle; }
.bb-spr-examples th { font-family: var(--sans); font-size: 13.5px; background: var(--bb-gray); }
.frac-inline { font-size: .8em; vertical-align: super; }

/* ---------- Explanation (practice / review) ---------- */
.bb-explain { margin-top: 28px; border-top: 2px dashed #9b9b9b; padding-top: 18px; }
.bb-explain-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-bottom: 10px; }
.res-big { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; }
.res-big svg { width: 20px; height: 20px; }
.res-big.ok { color: #0f7a35; }
.res-big.bad { color: #b3261e; }
.res-big.omit { color: #555; }
.bb-explain-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.bb-explain-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.bb-explain-tags span { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bb-gray); color: #444; }
.bb-rationale { font-size: 15.5px; background: #f8f9fc; border-radius: 8px; padding: 16px 18px; }
.bb-rationale p { margin: 0 0 10px; }
.bb-rationale p:last-child { margin-bottom: 0; }
.bb-selfgrade { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #fff8db; border: 1px solid #ecd36b; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }

/* ---------- Footer ---------- */
.bb-footer {
  flex: none; height: 68px; padding: 0 28px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--bb-chrome); position: relative;
}
.bb-f-left { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-f-center { position: relative; display: flex; justify-content: center; }
.bb-qnav {
  display: inline-flex; align-items: center; gap: 8px; background: var(--bb-ink); color: #fff; border: none;
  border-radius: 8px; padding: 8px 16px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.bb-qnav svg { transition: transform .15s; }
.bb-qnav.open svg { transform: rotate(180deg); }
.bb-qnav:hover { background: #000; }
.bb-f-right { display: flex; justify-content: flex-end; gap: 12px; align-items: center; }
.bb-btn {
  background: var(--bb-blue); color: #fff; border: none; border-radius: 999px;
  padding: 10px 26px; font-weight: 700; font-size: 15px; cursor: pointer; min-width: 88px;
}
.bb-btn:hover { background: var(--bb-blue-dark); }
.bb-btn-outline {
  background: #fff; color: var(--bb-blue); border: 1.5px solid var(--bb-blue); border-radius: 999px;
  padding: 8px 20px; font-weight: 700; font-size: 14.5px; cursor: pointer;
}
.bb-btn-outline:hover:not(:disabled) { background: #eef1fc; }
.bb-btn-outline:disabled { color: #8d8d8d; border-color: #bdbdbd; cursor: not-allowed; }

/* ---------- Question navigator ---------- */
.bb-nav-pop {
  position: absolute; bottom: calc(100% + 18px); left: 50%; transform: translateX(-50%); z-index: 80;
  width: min(600px, calc(100vw - 32px)); background: #fff; border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,.25); padding: 20px 24px 22px;
}
.bb-nav-pop::after {
  content: ''; position: absolute; bottom: -9px; left: 50%; width: 18px; height: 18px; background: #fff;
  transform: translateX(-50%) rotate(45deg); box-shadow: 3px 3px 6px rgba(0,0,0,.08);
}
.bb-nav-head { display: flex; align-items: center; justify-content: center; position: relative; padding-bottom: 14px; }
.bb-nav-head .bb-icon-btn { position: absolute; right: -8px; top: -6px; }
.bb-nav-title { font-weight: 700; font-size: 17px; text-align: center; }
.bb-legend {
  display: flex; justify-content: center; gap: 28px; padding: 12px 0; font-size: 14px;
  border-top: 1px solid #d0d0d0; border-bottom: 1px solid #d0d0d0; margin-bottom: 22px;
}
.bb-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.lg-box { width: 16px; height: 16px; border: 1px dashed var(--bb-ink); display: inline-block; }
.lg-flag { color: var(--bb-red); display: inline-flex; }
.lg-flag svg, .lg-pin svg { width: 16px; height: 16px; }
.bb-grid { display: flex; flex-wrap: wrap; gap: 20px 16px; justify-content: center; max-height: 300px; overflow-y: auto; padding: 14px 6px 6px; }
.bb-cell {
  position: relative; width: 40px; height: 40px; border: 1px dashed var(--bb-ink); background: #fff;
  color: var(--bb-blue); font-weight: 700; font-size: 16px; cursor: pointer;
}
.bb-cell:hover { background: #eef1fc; }
.bb-cell.answered { background: var(--bb-blue); border: 1px solid var(--bb-blue); color: #fff; }
.bb-cell.answered:hover { background: var(--bb-blue-dark); }
.bb-cell-pin { position: absolute; top: -21px; left: 50%; transform: translateX(-50%); color: var(--bb-ink); display: inline-flex; }
.bb-cell-flag { position: absolute; top: -8px; right: -7px; color: var(--bb-red); display: inline-flex; }
.bb-cell-flag svg { width: 16px; height: 16px; filter: drop-shadow(0 0 1px #fff); }
.bb-cell-res {
  position: absolute; bottom: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; border: 1.5px solid #fff;
}
.bb-cell-res svg { width: 10px; height: 10px; }
.bb-cell-res.correct { background: #0f7a35; }
.bb-cell-res.incorrect { background: #b3261e; }
.bb-cell-res.omitted, .bb-cell-res.ungraded { background: #777; }
.bb-nav-foot { display: flex; justify-content: center; margin-top: 22px; }

.bb-review-page { height: 100%; overflow-y: auto; padding: 40px 24px 56px; text-align: center; }
.bb-review-page h1 { font-size: 30px; font-weight: 700; margin-bottom: 18px; font-family: var(--sans); }
.bb-review-page p { margin: 0 auto 6px; max-width: 640px; font-size: 16px; }
.bb-review-card {
  max-width: 860px; margin: 28px auto 0; background: #fff; border-radius: 10px;
  box-shadow: 0 2px 14px rgba(0,0,0,.18); padding: 22px 32px 30px; text-align: left;
}
.bb-review-card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid #d0d0d0; padding-bottom: 14px; margin-bottom: 10px; }
.bb-review-card-head .bb-legend { border: none; margin: 0; padding: 0; gap: 20px; }
.bb-review-card .bb-grid { justify-content: flex-start; max-height: none; }

/* ---------- Floating tools ---------- */
.bb-icon-btn { width: 32px; height: 32px; border-radius: 6px; border: none; background: transparent; cursor: pointer; display: inline-grid; place-items: center; color: inherit; }
.bb-icon-btn:hover { background: rgba(127,127,127,.18); }
.bb-float {
  position: fixed; z-index: 75; background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 6px 30px rgba(0,0,0,.28); display: flex; flex-direction: column;
}
.bb-float-head {
  flex: none; height: 42px; padding: 0 6px 0 16px; display: flex; align-items: center; justify-content: space-between;
  background: var(--bb-ink); color: #fff; font-weight: 700; font-size: 15px; cursor: move; user-select: none; touch-action: none;
}
.bb-float-head > div { display: flex; }
.bb-calc { top: 96px; left: 24px; width: 460px; height: min(600px, calc(100vh - 190px)); resize: both; }
.bb-calc.wide { width: min(900px, calc(100vw - 48px)); }
.bb-calc-body { flex: 1; min-height: 0; }
.bb-ref { top: 96px; right: 24px; width: 560px; max-height: calc(100vh - 190px); }
.bb-ref-body { overflow-y: auto; padding: 16px 20px; font-family: var(--serif); font-size: 15px; }
.bb-ref-body p { margin: 6px 0; }
.bb-ref-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; margin-bottom: 12px; color: var(--bb-ink); }
.bb-ref-grid figure { margin: 0; text-align: center; }
.bb-ref-grid figcaption { font-size: 14px; line-height: 1.4; }
.bb-ref-grid .fr { font-size: .85em; }

/* ---------- Highlights & notes ---------- */
mark.bb-hl { color: inherit; padding: 0; border-radius: 2px; cursor: pointer; }
mark.hl-yellow { background: #fbe67b; }
mark.hl-blue { background: #b9dcf8; }
mark.hl-pink { background: #f8c6e2; }
mark.hl-underline { background: transparent; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
mark.has-note { border-bottom: 2px dotted var(--bb-ink); }
.bb-hl-toolbar {
  position: fixed; z-index: 90; display: flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 8px; padding: 6px 8px; box-shadow: 0 3px 16px rgba(0,0,0,.25);
}
.hl-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.hl-swatch.hl-yellow { background: #fbe67b; }
.hl-swatch.hl-blue { background: #b9dcf8; }
.hl-swatch.hl-pink { background: #f8c6e2; }
.hl-swatch.on, .hl-swatch:hover { border-color: var(--bb-ink); }
.hl-tool { height: 30px; min-width: 30px; padding: 0 8px; border-radius: 6px; border: none; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.hl-tool:hover, .hl-tool.on { background: var(--bb-gray); }
.hl-sep { width: 1px; height: 22px; background: #d0d0d0; }
.bb-note {
  position: absolute; left: 0; right: 0; bottom: 71px; z-index: 65; background: #fff;
  border-top: 1px solid #c8c8c8; box-shadow: 0 -4px 16px rgba(0,0,0,.12); padding: 12px 28px 16px;
}
.bb-note-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14.5px; margin-bottom: 8px; }
.bb-note-quote { font-family: var(--serif); font-style: italic; }
.bb-note textarea { width: 100%; height: 76px; resize: vertical; border: 1px solid var(--bb-ink); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 15px; }
.bb-note textarea:focus { outline: 2px solid var(--bb-blue); outline-offset: -1px; }
.bb-note-actions { display: flex; gap: 10px; margin-top: 8px; }

/* Bluebook-styled confirmation dialogs */
.bb-modal { border-radius: 10px; }
.bb-modal .btn { border-radius: 999px; }
.bb-modal .btn-primary { background: var(--bb-blue, #324dc7); }

/* ---------- Narrow screens ---------- */
@media (max-width: 820px) {
  .bb-header { padding: 0 14px; height: 70px; grid-template-columns: 1fr auto auto; gap: 10px; }
  .bb-section-title { font-size: 15px; }
  .bb-h-right { gap: 10px; }
  .bb-tool span { display: none; }
  .bb-directions { top: 73px; }
  .bb-split { flex-direction: column; overflow-y: auto; }
  .bb-pane { height: auto; overflow: visible; flex: none !important; }
  .bb-pane-inner { height: auto; overflow: visible; padding: 22px 16px !important; }
  .bb-pane-left { border-bottom: 6px solid #d4d4d4; }
  .bb-divider, .bb-pane-expand { display: none; }
  .bb-single-inner { padding: 22px 16px 40px; }
  .bb-footer { padding: 0 12px; grid-template-columns: auto 1fr; gap: 8px; height: 64px; }
  .bb-f-left { display: none; }
  .bb-f-center { justify-content: flex-start; }
  .bb-qnav { padding: 7px 10px; font-size: 13.5px; }
  .bb-btn { padding: 9px 16px; min-width: 0; }
  .bb-btn-outline { padding: 7px 12px; font-size: 13px; }
  .bb-f-right { gap: 6px; }
  .bb-calc { left: 8px; right: 8px; width: auto; top: 80px; }
  .bb-ref { left: 8px; right: 8px; width: auto; top: 80px; }
  .bb-ref-grid { grid-template-columns: repeat(2, 1fr); }
  .bb-nav-pop { position: fixed; bottom: 80px; }
  .bb-note { bottom: 67px; padding: 10px 14px; }
}
