/* ============================================================
   Khan SAT-1600 · Digital SAT — интерфейс экзамена (v147)
   Author: Xudoyorxon Bunyodov / Худоёрхон Бунёдов

   Экран теста повторяет структуру цифрового SAT: шапка с разделом,
   таймером и инструментами, пунктирные разделители, текст слева и
   вопрос справа, нижняя панель с навигатором вопросов. Экзамен всегда
   светлый — тёмная тема платформы сюда намеренно не проникает, как и
   на настоящем тесте.
   ============================================================ */

.bb, .bb-center, .bb-breakv, .bb-modal-bg, .bb-hlpop, .bb-notepop {
  --bb-ink: #1b1b1b;
  --bb-sub: #4d4d4d;
  --bb-line: #cfcfcf;
  --bb-blue: #324dc7;
  --bb-blue-d: #22379f;
  --bb-blue-l: #edf0fc;
  --bb-bar: #f1f1f1;
  --bb-red: #c8102e;
  --bb-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --bb-serif: "Noto Serif", "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
}

html.bb-on, html.bb-on body { overflow: hidden !important; }
html.bb-on #ksat-bottomnav, html.bb-on #eduSide, html.bb-on #eduBurger,
html.bb-on #eduVeil, html.bb-on #ext-sheet-bg, html.bb-on #nx-po { display: none !important; }

.bb {
  position: fixed; inset: 0; z-index: 800;
  display: flex; flex-direction: column;
  background: #fff; color: var(--bb-ink);
  font-family: var(--bb-sans); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.bb *, .bb *::before, .bb *::after { box-sizing: border-box; }
.bb button { font-family: var(--bb-sans); color: inherit; letter-spacing: normal; text-transform: none; box-shadow: none; }
.bb button:focus-visible, .bb input:focus-visible { outline: 3px solid #7a8ff0; outline-offset: 2px; }
.bb svg { flex: none; }

/* ---------- шапка ---------- */
.bb-head {
  flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 12px; padding: 10px 24px 8px; min-height: 66px; background: #fff;
}
.bb-sec-title { font-weight: 700; font-size: 17px; line-height: 1.25; }
.bb-dir-btn {
  margin-top: 4px; background: none; border: 0; padding: 2px 0; cursor: pointer;
  font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.bb-dir-btn svg { width: 12px; height: 12px; transition: transform .15s; }
.bb-dir-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.bb-head-c { text-align: center; min-width: 120px; }
.bb-timer { font-weight: 700; font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: .4px; min-height: 28px; }
.bb-timer svg { width: 24px; height: 24px; vertical-align: -5px; }
.bb-timer.is-low { color: #b00020; }
.bb-hide {
  margin-top: 3px; border: 1.5px solid #6b6b6b; background: #fff; border-radius: 14px;
  padding: 1px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.bb-hide:hover { background: #f3f3f3; }
.bb-head-r { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.bb-tool {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; padding: 5px 10px; border-radius: 8px;
  font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.bb-tool svg { width: 22px; height: 22px; }
.bb-tool:hover, .bb-tool.is-on { background: var(--bb-blue-l); }
.bb-more-wrap { position: relative; }
.bb-more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px;
  background: #fff; border-radius: 10px; padding: 6px;
  box-shadow: 0 10px 34px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.06);
}
.bb-more-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; background: none; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.bb-more-menu button:hover { background: #f1f3fb; }
.bb-more-menu hr { border: 0; border-top: 1px solid #e3e3e3; margin: 4px 6px; }

/* пунктирные разделители под шапкой и над подвалом */
.bb-dash {
  flex: 0 0 3px; height: 3px;
  background: repeating-linear-gradient(90deg, #262626 0 11px, transparent 11px 17px);
}

/* ---------- рабочая область ---------- */
.bb-main { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; background: #fff; }
.bb-split { display: flex; height: 100%; }
.bb-pane { height: 100%; overflow: auto; overscroll-behavior: contain; }
.bb-pane--l { flex: 0 0 var(--bb-left, 50%); }
.bb-pane--r { flex: 1 1 0; min-width: 0; }
.bb-pane-in { padding: 30px 40px 56px; max-width: 780px; margin: 0 auto; }
.bb-divider { flex: 0 0 5px; position: relative; background: #cfcfcf; cursor: col-resize; touch-action: none; }
.bb-grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 46px; border-radius: 10px; background: #fff; border: 1.5px solid #555;
  display: grid; place-items: center; color: #333;
}
.bb-grip svg { width: 12px; height: 12px; }
.bb-single { height: 100%; overflow: auto; }
.bb-single-in { max-width: 780px; margin: 0 auto; padding: 30px 24px 56px; }

/* строка вопроса */
.bb-qbar { display: flex; align-items: center; gap: 10px; background: var(--bb-bar); height: 38px; padding-right: 8px; }
.bb-qnum {
  background: #1b1b1b; color: #fff; font-weight: 700; font-size: 15px;
  min-width: 34px; height: 38px; padding: 0 9px; display: grid; place-items: center;
}
.bb-mark {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; cursor: pointer;
  font-weight: 600; font-size: 14px; padding: 4px 6px; border-radius: 4px;
}
.bb-mark svg { width: 15px; height: 18px; }
.bb-mark:hover { background: #e6e6e6; }
.bb-mark.is-on svg path { fill: var(--bb-red); stroke: var(--bb-red); }
.bb-abc {
  margin-left: auto; position: relative; cursor: pointer; background: #fff; color: #1b1b1b;
  border: 1.5px solid #1b1b1b; border-radius: 4px; height: 26px; min-width: 42px;
  font-weight: 700; font-size: 11.5px; letter-spacing: .5px;
}
.bb-abc::after {
  content: ''; position: absolute; left: 5px; right: 5px; top: 50%;
  height: 1.5px; background: currentColor; transform: rotate(-14deg);
}
.bb-abc.is-on { background: var(--bb-blue); color: #fff; border-color: var(--bb-blue); }
.bb-qbar-dash {
  height: 2px; margin-bottom: 20px;
  background: repeating-linear-gradient(90deg, #6b6b6b 0 6px, transparent 6px 10px);
}

/* текст и вопрос */
.bb-passage, .bb-stem { font-family: var(--bb-serif); font-size: 16.5px; line-height: 1.72; color: #1b1b1b; }
.bb-passage p, .bb-stem p { margin: 0 0 14px; }
.bb-stem { margin-bottom: 20px; }
.bb-passage, .bb-stem, .bb-ctext { -webkit-user-select: text; user-select: text; }
.bb-tt { font-family: var(--bb-sans); font-weight: 700; font-size: 15px; margin: 18px 0 6px; }
.bb-tt:first-child { margin-top: 0; }
.bb-notes { margin: 6px 0 0; padding-left: 22px; }
.bb-notes li { margin: 0 0 8px; padding-left: 2px; }
.bb-blank { display: inline-block; width: 70px; border-bottom: 1.6px solid #1b1b1b; transform: translateY(-4px); margin: 0 3px; }
.bb-fig { margin: 16px 0; text-align: center; }
.bb-fig img { max-width: 100%; height: auto; cursor: zoom-in; }
.bb-fig svg { max-width: 100%; height: auto; }
.bb-fig--snap img { border: 1px solid #e0e0e0; border-radius: 6px; }

/* варианты ответа */
.bb-choices { display: flex; flex-direction: column; gap: 14px; }
.bb-crow { display: flex; align-items: center; gap: 12px; position: relative; }
.bb-choice {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 14px; position: relative;
  text-align: left; background: #fff; border: 1.5px solid #3b3b3b; border-radius: 8px;
  padding: 10px 14px; min-height: 52px; cursor: pointer;
  font-family: var(--bb-serif) !important; font-size: 16px; line-height: 1.45; color: #1b1b1b;
}
.bb-choice:hover { border-color: var(--bb-blue); }
.bb-letter {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #1b1b1b;
  display: grid; place-items: center; font-family: var(--bb-sans); font-weight: 700; font-size: 13.5px; background: #fff;
}
.bb-choice.is-sel { border-color: var(--bb-blue); box-shadow: 0 0 0 1.5px var(--bb-blue); }
.bb-choice.is-sel .bb-letter { background: var(--bb-blue); border-color: var(--bb-blue); color: #fff; }
.bb-crow.is-crossed .bb-choice { color: #8c8c8c; border-color: #b8b8b8; }
.bb-crow.is-crossed .bb-letter { color: #8c8c8c; border-color: #8c8c8c; }
.bb-crow.is-crossed .bb-choice::after {
  content: ''; position: absolute; left: -7px; right: -7px; top: 50%; height: 2px; background: #1b1b1b;
}
.bb-x {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; position: relative; cursor: pointer;
  border: 1.5px solid #1b1b1b; background: #fff; font-weight: 700; font-size: 11px;
}
.bb-x::after { content: ''; position: absolute; left: -4px; right: -4px; top: 50%; height: 1.5px; background: #1b1b1b; }
.bb-undo {
  flex: 0 0 40px; background: none; border: 0; cursor: pointer; padding: 0;
  font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 2px;
}

/* ответ с вводом */
.bb-spr { margin-top: 6px; }
.bb-spr-in {
  width: 180px; height: 50px; padding: 0 14px; border: 1.5px solid #3b3b3b; border-radius: 8px;
  font: 600 22px var(--bb-sans); color: #1b1b1b; background: #fff; letter-spacing: 1px;
}
.bb-spr-in:focus { outline: none !important; border-color: var(--bb-blue) !important; box-shadow: 0 0 0 1.5px var(--bb-blue) !important; }
.bb-calc-in:focus, .bb-graph-fx input:focus { outline: none !important; box-shadow: none !important; }
.bb-spr-prev { margin-top: 14px; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; min-height: 40px; }
.bb-frac { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; vertical-align: middle; }
.bb-frac span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 4px; }
.bb-sprdir { font-size: 15px; line-height: 1.6; }
.bb-sprdir h2 { font-size: 18px; margin: 0 0 12px; font-weight: 700; }
.bb-sprdir ul { padding-left: 20px; margin: 0 0 18px; }
.bb-sprdir li { margin-bottom: 8px; }
.bb-ex { border-collapse: collapse; width: 100%; font-size: 14px; }
.bb-ex th, .bb-ex td { border: 1px solid #bdbdbd; padding: 7px 10px; text-align: left; vertical-align: top; }
.bb-ex th { background: #f5f5f5; font-weight: 700; }

/* ---------- подвал ---------- */
.bb-foot {
  flex: 0 0 auto; position: relative; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 12px; padding: 10px 24px; min-height: 62px; background: #fff;
}
.bb-foot-l { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-foot-r { display: flex; justify-content: flex-end; gap: 10px; }
.bb-btn {
  background: var(--bb-blue); color: #fff !important; border: 0; border-radius: 24px;
  padding: 11px 28px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.bb-btn:hover { background: var(--bb-blue-d); }
.bb-btn:disabled { opacity: .5; cursor: default; }
.bb-btn-o {
  background: #fff; color: var(--bb-blue) !important; border: 1.5px solid var(--bb-blue); border-radius: 24px;
  padding: 9px 22px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.bb-btn-o:hover { background: var(--bb-blue-l); }
.bb-btn-y { background: #fedb00; color: #1b1b1b !important; }
.bb-btn-y:hover { background: #f2cf00; }
.bb-qnav {
  display: inline-flex; align-items: center; gap: 8px; background: #1b1b1b; color: #fff !important;
  border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 700; font-size: 14.5px; cursor: pointer;
}
.bb-qnav svg { width: 12px; height: 12px; transition: transform .15s; }
.bb-qnav[aria-expanded="true"] svg { transform: rotate(180deg); }

/* навигатор вопросов */
.bb-pop {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  width: min(620px, 94vw); background: #fff; border-radius: 12px; padding: 18px 22px 22px; z-index: 70;
  box-shadow: 0 14px 50px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.05);
}
.bb-pop::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; width: 16px; height: 16px; background: #fff;
  transform: translateX(-50%) rotate(45deg); box-shadow: 4px 4px 6px rgba(0,0,0,.06);
}
.bb-pop-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; font-size: 15.5px; padding-bottom: 12px; border-bottom: 1px solid #d9d9d9; }
.bb-pop-x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.bb-leg { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; padding: 12px 0; font-size: 13.5px; border-bottom: 1px solid #d9d9d9; margin-bottom: 18px; }
.bb-leg span { display: inline-flex; align-items: center; gap: 7px; }
.bb-leg svg { width: 13px; height: 16px; }
.bb-leg-un { width: 15px; height: 15px; border: 1.5px dashed #3b3b3b; display: inline-block; }
.bb-leg .bb-leg-flag { color: var(--bb-red); }
.bb-grid { display: flex; flex-wrap: wrap; gap: 18px 13px; padding: 6px 2px; }
.bb-cell {
  width: 38px; height: 38px; position: relative; cursor: pointer; border-radius: 2px;
  border: 1.5px dashed #3b3b3b; background: #fff; color: var(--bb-blue) !important; font-weight: 700; font-size: 15px;
}
.bb-cell.is-ans { background: var(--bb-blue); border: 1.5px solid var(--bb-blue); color: #fff !important; }
.bb-cell:hover { outline: 2px solid #9aa9ee; outline-offset: 1px; }
.bb-cell .bb-pin { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 13px; height: 16px; color: #1b1b1b; display: block; }
.bb-cell .bb-flag { position: absolute; top: -8px; right: -6px; width: 12px; height: 15px; color: var(--bb-red); display: block; }
.bb-pin svg, .bb-flag svg { width: 100%; height: 100%; display: block; }
.bb-pop-f { text-align: center; margin-top: 20px; }

/* страница проверки перед отправкой модуля */
.bb-review { height: 100%; overflow: auto; padding: 34px 24px 56px; text-align: center; }
.bb-review h1 { font-size: 30px; font-weight: 700; margin: 6px 0 12px; }
.bb-review > p { max-width: 640px; margin: 0 auto 26px; color: #333; line-height: 1.6; }
.bb-review-card { max-width: 780px; margin: 0 auto; text-align: left; background: #fff; border-radius: 12px; padding: 20px 26px 26px; box-shadow: 0 2px 18px rgba(0,0,0,.14); }
.bb-rc-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid #d9d9d9; font-weight: 700; }
.bb-rc-h .bb-leg { border: 0; padding: 0; margin: 0; }
.bb-grid--big { margin-top: 20px; }
.bb-grid--big .bb-cell { width: 46px; height: 46px; font-size: 16px; }

/* указания к разделу */
.bb-dirm { position: absolute; inset: 0; z-index: 55; background: rgba(0,0,0,.32); display: flex; justify-content: center; }
.bb-dirm-in {
  background: #fff; width: min(1000px, 100%); max-height: calc(100% - 36px); overflow: auto;
  border-radius: 0 0 14px 14px; padding: 28px 38px 22px; box-shadow: 0 16px 40px rgba(0,0,0,.25);
}
.bb-dirm-body { font-family: var(--bb-serif); font-size: 16px; line-height: 1.7; }
.bb-dirm-body h3 { font-family: var(--bb-sans); font-size: 16px; margin: 0 0 10px; }
.bb-dirm-body ul { padding-left: 22px; }
.bb-dirm-f { display: flex; justify-content: flex-end; margin-top: 18px; }

.bb-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 65;
  background: #1b1b1b; color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: bbfade 5.5s forwards;
}
@keyframes bbfade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* плавающие панели: калькулятор, формулы */
.bb-panel {
  position: absolute; top: 16px; left: 16px; z-index: 50; width: 390px; max-width: calc(100% - 24px);
  background: #fff; border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100% - 32px);
  box-shadow: 0 14px 44px rgba(0,0,0,.3), 0 0 0 1px rgba(0,0,0,.06);
}
.bb-panel--ref { left: auto; right: 16px; width: 560px; }
.bb-panel-h {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: move;
  background: #1b1b1b; color: #fff; padding: 9px 12px 9px 16px; border-radius: 12px 12px 0 0;
  font-weight: 700; font-size: 14.5px; touch-action: none; user-select: none;
}
.bb-panel-h button { background: none; border: 0; color: #fff; cursor: pointer; font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.bb-panel-h button:hover { background: rgba(255,255,255,.14); }
.bb-panel-b { overflow: auto; padding: 14px; }

.bb-calc-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.bb-calc-tabs button { flex: 1; border: 1.5px solid #c9c9c9; background: #fff; border-radius: 8px; padding: 6px; font-weight: 600; cursor: pointer; }
.bb-calc-tabs button.is-on { border-color: var(--bb-blue); color: var(--bb-blue); background: var(--bb-blue-l); }
.bb-calc-disp { border: 1.5px solid #c9c9c9; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.bb-calc-in { width: 100%; border: 0; font: 500 18px var(--bb-sans); outline: none; color: #1b1b1b; background: transparent; }
.bb-calc-out { text-align: right; font-weight: 700; font-size: 22px; min-height: 30px; color: var(--bb-blue); word-break: break-all; }
.bb-calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bb-calc-keys button { height: 38px; border: 0; border-radius: 8px; background: #f0f0f0; font-weight: 600; font-size: 15px; cursor: pointer; }
.bb-calc-keys button:hover { background: #e2e2e2; }
.bb-calc-keys .op { background: #e4e8fa; }
.bb-calc-keys .eq { background: var(--bb-blue); color: #fff; }
.bb-calc-mode { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; color: var(--bb-sub); }
.bb-calc-mode button { border: 1.5px solid #c9c9c9; background: #fff; border-radius: 12px; padding: 2px 10px; font-weight: 600; cursor: pointer; }
.bb-calc-hist { margin-top: 8px; max-height: 110px; overflow: auto; font-size: 13px; color: var(--bb-sub); }
.bb-calc-hist div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #e2e2e2; cursor: pointer; }
.bb-graph-fx { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.bb-graph-fx label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bb-graph-fx i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.bb-graph-fx input { flex: 1; min-width: 0; border: 1.5px solid #c9c9c9; border-radius: 8px; padding: 6px 8px; font: 15px var(--bb-sans); }
.bb-graph-cv { width: 100%; height: 280px; border: 1px solid #d9d9d9; border-radius: 8px; display: block; touch-action: none; cursor: grab; background: #fff; }
.bb-graph-bar { display: flex; gap: 6px; margin-top: 6px; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--bb-sub); }
.bb-graph-bar button { border: 1.5px solid #c9c9c9; background: #fff; border-radius: 8px; padding: 3px 10px; font-weight: 700; cursor: pointer; }

.bb-ref { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bb-ref figure { margin: 0; border: 1px solid #e0e0e0; border-radius: 10px; padding: 8px; text-align: center; }
.bb-ref svg { width: 100%; height: 86px; }
.bb-ref figcaption { font-family: var(--bb-serif); font-size: 14px; line-height: 1.4; }
.bb-ref-notes { margin-top: 12px; font-family: var(--bb-serif); font-size: 14.5px; line-height: 1.6; }

/* пометки и заметки */
.bb-hl { background: #ffe680; border-radius: 2px; cursor: pointer; }
.bb-hl--b { background: #bfe0ff; }
.bb-hl--p { background: #ffc8e1; }
.bb-hl--u { background: none; text-decoration: underline 2px; text-underline-offset: 3px; }
.bb-hl.has-note { box-shadow: inset 0 -2px 0 var(--bb-red); }
.bb-hlpop {
  position: fixed; z-index: 1000; display: flex; gap: 6px; align-items: center;
  background: #1b1b1b; border-radius: 10px; padding: 6px 8px; box-shadow: 0 8px 26px rgba(0,0,0,.3);
}
.bb-hlpop button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; cursor: pointer; font: 700 13px var(--bb-sans); color: #fff; background: transparent; display: grid; place-items: center; }
.bb-hlpop .c-y { background: #ffe680; }
.bb-hlpop .c-b { background: #bfe0ff; }
.bb-hlpop .c-p { background: #ffc8e1; }
.bb-hlpop .c-u { text-decoration: underline; }
.bb-notepop {
  position: fixed; z-index: 1001; width: 290px; background: #fff; border-radius: 12px; padding: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.3); font-family: var(--bb-sans);
}
.bb-notepop b { display: block; margin-bottom: 6px; font-size: 13.5px; }
.bb-notepop textarea { width: 100%; min-height: 90px; border: 1.5px solid #c9c9c9; border-radius: 8px; padding: 8px; font: 14px var(--bb-sans); resize: vertical; box-sizing: border-box; }
.bb-notepop div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.bb-notepop button { border: 0; border-radius: 16px; padding: 6px 14px; font-weight: 700; cursor: pointer; background: var(--bb-blue); color: #fff; }
.bb-notepop button.ghost { background: #eee; color: #1b1b1b; }

/* построчное чтение */
.bb-lr-top, .bb-lr-bot { position: absolute; left: 0; right: 0; z-index: 40; background: rgba(0,0,0,.6); pointer-events: none; }
.bb-lr-top { top: 0; }
.bb-lr-bot { bottom: 0; }

/* ---------- перерыв, загрузка, завершение ---------- */
.bb-breakv {
  position: fixed; inset: 0; z-index: 800; background: #262626; color: #fff; overflow: auto;
  display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.25fr); gap: 56px; padding: 9vh 7vw;
  font-family: var(--bb-sans);
}
.bb-break-card { display: inline-block; border: 1.5px solid #fff; border-radius: 14px; padding: 24px 34px; text-align: center; }
.bb-break-lbl { font-size: 16px; margin-bottom: 8px; }
.bb-break-clock { font-weight: 700; font-size: 66px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bb-breakv .bb-btn { margin-top: 26px; display: block; }
.bb-break-r h2 { font-size: 26px; margin: 0 0 12px; }
.bb-break-r h3 { font-size: 17px; margin: 26px 0 8px; }
.bb-break-r p, .bb-break-r li { color: #e6e6e6; line-height: 1.6; }
.bb-break-r ol { padding-left: 22px; }

.bb-center {
  position: fixed; inset: 0; z-index: 800; background: #fff; color: #1b1b1b;
  display: grid; place-items: center; text-align: center; padding: 24px; font-family: var(--bb-sans);
}
.bb-center h1 { font-size: 30px; margin: 18px 0 10px; }
.bb-center p { color: #444; max-width: 520px; margin: 0 auto 22px; line-height: 1.6; }
.bb-center .bb-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.bb-spin { width: 46px; height: 46px; border: 4px solid #dedede; border-top-color: #324dc7; border-radius: 50%; margin: 0 auto; animation: bbspin .9s linear infinite; }
@keyframes bbspin { to { transform: rotate(360deg); } }
.bb-done-mark { width: 74px; height: 74px; border-radius: 50%; background: #e7f5ea; color: #1f7a33; display: grid; place-items: center; margin: 0 auto; }
.bb-done-mark svg { width: 38px; height: 38px; }

.bb-modal-bg { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; font-family: var(--bb-sans); }
.bb-modal { background: #fff; color: #1b1b1b; border-radius: 14px; padding: 24px 26px 20px; width: min(470px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.bb-modal h3 { margin: 0 0 10px; font-size: 20px; }
.bb-modal p { margin: 0 0 18px; color: #3a3a3a; line-height: 1.55; }
.bb-modal .bb-row { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.bb-modal .bb-btn, .bb-modal .bb-btn-o { font-family: var(--bb-sans); }

/* ---------- телефон и узкий планшет ---------- */
@media (max-width: 860px) {
  .bb-head { grid-template-columns: 1fr auto; padding: 8px 12px; min-height: 0; }
  .bb-head-c { grid-column: 2; grid-row: 1; }
  .bb-head-r { grid-column: 1 / -1; justify-content: flex-start; }
  .bb-tool span { display: none; }
  .bb-sec-title { font-size: 14.5px; }
  .bb-split { flex-direction: column; }
  .bb-pane--l { flex: 0 0 auto; max-height: 45%; border-bottom: 5px solid #cfcfcf; }
  .bb-divider { display: none; }
  .bb-pane-in { padding: 18px 16px 28px; }
  .bb-foot { grid-template-columns: auto 1fr; padding: 8px 12px; }
  .bb-foot-l { display: none; }
  .bb-btn { padding: 10px 18px; }
  .bb-panel, .bb-panel--ref { left: 8px; right: 8px; width: auto; }
  .bb-breakv { grid-template-columns: 1fr; gap: 28px; padding: 6vh 6vw; }
  .bb-ref { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ХАБ Digital SAT и ОТЧЁТ (внутри оболочки платформы)
   ============================================================ */
.bbh, .bbr { --bb-blue: #324dc7; --bb-blue-l: #edf0fc; --bb-ink: #1b1b1b; --bb-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif; --bb-serif: "Noto Serif", Georgia, "Times New Roman", serif; }
.bbh { max-width: 1120px; margin: 0 auto; padding: 4px 0 44px; }
.bbh-hero {
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 30px; align-items: center;
  background: #fff; color: #1b1b1b; border-radius: 20px; padding: 30px 32px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 32px rgba(24,36,80,.09);
}
.bbh-kicker { color: var(--bb-blue); font-weight: 700; font-size: 14px; }
.bbh h1 { font-family: var(--bb-sans); font-size: 30px; line-height: 1.2; margin: 6px 0 12px; color: #1b1b1b; }
.bbh-hero p { color: #3d3d3d; line-height: 1.65; margin: 0 0 14px; font-size: 15.5px; }
.bbh-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.bbh-steps span { border: 1.5px solid #d7dbe8; border-radius: 20px; padding: 4px 12px; font-size: 13px; font-weight: 600; color: #2d2d2d; background: #fafbff; }

/* миниатюра экрана теста */
.bbh-mock { border-radius: 12px; overflow: hidden; border: 1.5px solid #1b1b1b; background: #fff; font-family: var(--bb-sans); box-shadow: 8px 8px 0 #e4e8fa; }
.bbh-mock-h { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 10px; font-size: 10.5px; font-weight: 700; color: #1b1b1b; }
.bbh-mock-h b { text-align: center; font-size: 13px; }
.bbh-mock-h em { font-style: normal; text-align: right; color: #555; }
.bbh-mock-d { height: 2px; background: repeating-linear-gradient(90deg, #262626 0 8px, transparent 8px 12px); }
.bbh-mock-b { display: grid; grid-template-columns: 1fr 3px 1fr; height: 150px; }
.bbh-mock-b > div { padding: 12px 12px; }
.bbh-mock-b > i { background: #cfcfcf; }
.bbh-mock-l i, .bbh-mock-r i { display: block; height: 6px; border-radius: 3px; background: #e3e3e3; margin-bottom: 7px; }
.bbh-mock-q { display: flex; gap: 6px; align-items: center; background: #f1f1f1; margin-bottom: 8px; }
.bbh-mock-q b { background: #1b1b1b; color: #fff; font-size: 9px; padding: 3px 6px; }
.bbh-mock-q span { font-size: 8.5px; font-weight: 700; }
.bbh-mock-c { height: 14px; border: 1.2px solid #3b3b3b; border-radius: 4px; margin-bottom: 5px; }
.bbh-mock-c.on { border-color: #324dc7; box-shadow: 0 0 0 1px #324dc7; }
.bbh-mock-f { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 7px 10px; font-size: 9.5px; font-weight: 600; }
.bbh-mock-f b { background: #1b1b1b; color: #fff; padding: 3px 8px; border-radius: 4px; }
.bbh-mock-f em { text-align: right; font-style: normal; }
.bbh-mock-f em span { background: #324dc7; color: #fff; border-radius: 10px; padding: 3px 9px; margin-left: 4px; }

.bbh-resume {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 18px; background: #fff8da; border: 1.5px solid #e8c547; border-radius: 16px; padding: 16px 20px; color: #1b1b1b;
}
.bbh-resume b { font-size: 16px; }
.bbh-h2 { font-family: var(--bb-sans); font-size: 20px; margin: 30px 0 12px; color: inherit; }
.bbh-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; }
.bbh-card {
  text-align: left; background: #fff; color: #1b1b1b; border: 1.5px solid #d7dbe8; border-radius: 16px;
  padding: 18px 20px; cursor: pointer; font-family: var(--bb-sans); display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, transform .15s;
}
.bbh-card:hover { border-color: var(--bb-blue); transform: translateY(-1px); }
.bbh-card b { font-size: 18px; }
.bbh-card span { color: #4a4a4a; font-size: 14px; line-height: 1.5; }
.bbh-card small { color: #6a6a6a; font-size: 13px; font-weight: 600; margin-top: auto; padding-top: 8px; }
.bbh-card--main { background: #1b1b1b; color: #fff; border-color: #1b1b1b; }
.bbh-card--main span, .bbh-card--main small { color: #d9d9d9; }
.bbh-card--main:hover { border-color: #324dc7; }
.bbh-opt { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14.5px; color: inherit; cursor: pointer; }
.bbh-opt input { width: 18px; height: 18px; accent-color: #324dc7; }
.bbh-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bbh-tool { background: #fff; color: #1b1b1b; border-radius: 14px; padding: 14px 16px; border: 1px solid #e3e5ec; font-size: 13.5px; line-height: 1.5; }
.bbh-tool b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.bbh-table { width: 100%; border-collapse: collapse; background: #fff; color: #1b1b1b; border-radius: 14px; overflow: hidden; font-size: 14px; }
.bbh-table th, .bbh-table td { padding: 10px 12px; border-bottom: 1px solid #eceef3; text-align: left; }
.bbh-table th { background: #f6f7fb; font-weight: 700; }
.bbh-table td b { font-size: 16px; }
.bbh-link { color: #324dc7; font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; }
.bbh-foot { margin-top: 22px; font-size: 13.5px; color: #6a6a6a; }

.bbr { max-width: 1120px; margin: 0 auto; padding: 4px 0 44px; font-family: var(--bb-sans); }
.bbr-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.bbr-top h1 { margin: 0; font-size: 28px; color: inherit; }
.bbr-meta { color: #6a6a6a; font-size: 14px; margin-top: 4px; }
.bbr-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bbr-scores { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; }
.bbr-total { background: #1b1b1b; color: #fff; border-radius: 20px; padding: 24px 26px; }
.bbr-total span { font-weight: 600; font-size: 15px; color: #d9d9d9; }
.bbr-total b { display: block; font-size: 64px; line-height: 1.05; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.bbr-total small { color: #bdbdbd; font-size: 13.5px; }
.bbr-sec { background: #fff; color: #1b1b1b; border-radius: 20px; padding: 22px 24px; border: 1.5px solid #e3e5ec; }
.bbr-sec span { font-weight: 700; font-size: 15px; }
.bbr-sec b { display: block; font-size: 44px; line-height: 1.1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.bbr-sec small { color: #6a6a6a; font-size: 13.5px; display: block; }
.bbr-note { margin-top: 12px; background: #fff8da; border: 1px solid #ecd27a; color: #4d3d00; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.bbr-ks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.bbr-ks-card { background: #fff; color: #1b1b1b; border-radius: 18px; padding: 18px 22px; border: 1.5px solid #e3e5ec; }
.bbr-ks-card h3 { margin: 0 0 12px; font-size: 16px; }
.bbr-dom { display: grid; grid-template-columns: 1fr 150px 54px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid #f0f1f5; font-size: 14px; }
.bbr-dom:first-of-type { border-top: 0; }
.bbr-bar { display: flex; gap: 3px; }
.bbr-bar i { flex: 1; height: 11px; border-radius: 2px; background: #e3e5ec; }
.bbr-bar i.on { background: #324dc7; }
.bbr-dom em { font-style: normal; text-align: right; font-weight: 700; }
.bbr-mod { background: #fff; color: #1b1b1b; border-radius: 18px; padding: 16px 20px; border: 1.5px solid #e3e5ec; margin-top: 16px; }
.bbr-mod h3 { margin: 0 0 10px; font-size: 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bbr-mod h3 small { color: #6a6a6a; font-weight: 600; }
.bbr-cells { display: flex; flex-wrap: wrap; gap: 8px; }
.bbr-cell { width: 44px; height: 44px; border-radius: 8px; border: 0; cursor: pointer; font-weight: 700; font-size: 14px; position: relative; font-family: var(--bb-sans); }
.bbr-cell.ok { background: #e3f4e6; color: #1f7a33; }
.bbr-cell.bad { background: #fde6e6; color: #b3261e; }
.bbr-cell.skip { background: #f0f0f0; color: #6a6a6a; }
.bbr-cell.nokey { background: #fff; color: #6a6a6a; border: 1.5px dashed #c9c9c9; }
.bbr-cell i { position: absolute; top: -5px; right: -4px; width: 10px; height: 12px; color: #c8102e; }
.bbr-cell i svg { width: 100%; height: 100%; display: block; }
.bbr-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #555; margin-top: 10px; }
.bbr-legend span { display: inline-flex; gap: 6px; align-items: center; }
.bbr-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.bbr-rv { width: min(920px, 100%) !important; max-height: 90vh; overflow: auto; }
.bbr-rv-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.bbr-rv-h b { font-size: 17px; }
.bbr-rv-body { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.bbr-rv-body.one { grid-template-columns: 1fr; }
.bbr-rv .bb-passage, .bbr-rv .bb-stem { font-size: 15.5px; }
.bbr-rv .bb-choice { cursor: default; min-height: 44px; }
.bbr-rv .bb-choice.is-key { border-color: #1f7a33; box-shadow: 0 0 0 1.5px #1f7a33; }
.bbr-rv .bb-choice.is-key .bb-letter { background: #1f7a33; border-color: #1f7a33; color: #fff; }
.bbr-rv .bb-choice.is-wrong { border-color: #b3261e; box-shadow: 0 0 0 1.5px #b3261e; }
.bbr-rv .bb-choice.is-wrong .bb-letter { background: #b3261e; border-color: #b3261e; color: #fff; }
.bbr-rv-ans { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f6f7fb; font-size: 14.5px; line-height: 1.55; }
.bbr-rv-expl { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #f3f8f3; border: 1px solid #d5e8d8; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; }
.bbr-rv-vid video { width: 100%; border-radius: 10px; margin-top: 12px; background: #000; }

html[data-theme="dark"] .bbh-h2, html[data-theme="dark"] .bbr-top h1 { color: #f0f0f0; }

@media (max-width: 900px) {
  .bbh-hero { grid-template-columns: 1fr; padding: 22px; }
  .bbh-grid, .bbh-tools { grid-template-columns: 1fr; }
  .bbr-scores, .bbr-ks { grid-template-columns: 1fr; }
  .bbr-rv-body { grid-template-columns: 1fr; }
  .bbr-dom { grid-template-columns: 1fr 110px 48px; }
}
@media print {
  html.bbr-printing .topbar, html.bbr-printing .footer, html.bbr-printing #eduSide,
  html.bbr-printing #ksat-bottomnav, html.bbr-printing .bbr-actions { display: none !important; }
}

/* ---------- Digital SAT: пункт меню и карточка на главной (v147.1) ---------- */
.topnav a.bb-navlink { font-weight: 700; }
.bb-home {
  --bb-blue: #324dc7; --bb-blue-d: #22379f; --bb-blue-l: #edf0fc; --bb-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0 0 18px;
  padding: 18px 22px; border-radius: 18px; background: #fff; color: #1b1b1b; font-family: var(--bb-sans);
  border: 1.5px solid #d7dbe8; border-left: 6px solid #324dc7; box-shadow: 0 8px 26px rgba(24,36,80,.08);
}
.bb-home-t span { color: #324dc7; font-weight: 700; font-size: 13.5px; }
.bb-home-t b { display: block; font-size: 19px; margin: 3px 0 4px; }
.bb-home-t p { margin: 0; color: #444; font-size: 14px; line-height: 1.55; max-width: 720px; }
.bb-home-act { display: flex; gap: 10px; flex-wrap: wrap; }
