/* SAT practice test runner: a digital-SAT style test screen and the graphing calculator */
:root {
  --bb-blue: #324dc7;
  --bb-blue-dark: #2338a3;
  --bb-ink: #1e1e1e;
  --bb-muted: #5c5c5c;
  --bb-line: #c9c9c9;
  --bb-head: #f3f4f8;
  --bb-red: #c3002f;
  --bb-green: #1f7a3a;
  --bb-serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --bb-sans: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 700; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.bb { overflow-x: hidden; font-family: var(--bb-sans); color: var(--bb-ink); background: #fff; font-size: 16px; }
#app { min-height: 100%; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.95em; }
.bb-small { font-size: 0.85rem; color: var(--bb-muted); }
:focus-visible { outline: 3px solid #5b8def; outline-offset: 2px; }

/* buttons */
.bb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 24px; border-radius: 999px; border: 2px solid var(--bb-blue);
  background: var(--bb-blue); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; font-size: 0.98rem;
}
.bb-btn:hover { background: var(--bb-blue-dark); border-color: var(--bb-blue-dark); }
.bb-btn-ghost { background: #fff; color: var(--bb-blue); }
.bb-btn-ghost:hover { background: #eef1fd; color: var(--bb-blue-dark); }
.bb-link { background: none; border: 0; color: var(--bb-blue); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }

/* header */
.bb-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  min-height: 74px; padding: 6px 24px; background: var(--bb-head);
}
.bb-sec { margin: 0; font-weight: 700; font-size: 1.05rem; }
.bb-dir { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 2px 0; background: none; border: 0; cursor: pointer; font-weight: 700; font-size: 0.95rem; }
.bb-h-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bb-timer { font-size: 1.3rem; font-weight: 700; min-height: 28px; display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.bb-timer.warn { color: var(--bb-red); }
.bb-hide { background: #fff; border: 1.5px solid #6b6b6b; border-radius: 999px; padding: 1px 14px; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.bb-hide:disabled { opacity: 0.45; cursor: default; }
.bb-h-right { display: flex; justify-content: flex-end; gap: 6px; }
.bb-tool {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 70px; padding: 4px 6px;
  background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; font-size: 0.8rem; font-weight: 700;
}
.bb-tool:hover { color: var(--bb-blue); }
.bb-tool.on { color: var(--bb-blue); border-bottom-color: var(--bb-blue); }
.bb-rule {
  height: 3px; flex: none;
  background: repeating-linear-gradient(90deg, #1b2a6b 0 26px, transparent 26px 32px, #3f8f63 32px 50px, transparent 50px 56px, #e09a2c 56px 70px, transparent 70px 76px, #b8326e 76px 92px, transparent 92px 98px);
}

/* main area */
.bb-main { flex: 1; overflow: auto; position: relative; }
.q-single { max-width: 780px; margin: 26px auto 40px; padding: 0 28px; }
.q-split { display: grid; grid-template-columns: 1fr 6px 1fr; min-height: 100%; }
.q-left { padding: 26px 30px 40px; overflow: auto; }
.q-divider { background: #dedede; }
.q-right { padding: 26px 30px 40px; overflow: auto; }
.q-headbar { display: flex; align-items: center; gap: 10px; background: #f0f0f0; border-bottom: 2px dashed #9a9a9a; min-height: 38px; }
.q-num { background: #111; color: #fff; font-weight: 700; min-width: 34px; height: 38px; display: grid; place-items: center; font-size: 1.05rem; }
.q-mark { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; font-size: 0.95rem; padding: 6px 4px; }
.q-mark.on { --fill: var(--bb-red); }
.q-mark.on svg { color: var(--bb-red); }
.q-gap { flex: 1; }
.q-elim { margin-right: 8px; border: 1.5px solid #333; border-radius: 4px; background: #fff; cursor: pointer; padding: 1px 6px; font-size: 0.8rem; font-weight: 700; }
.q-elim span { text-decoration: line-through; text-decoration-thickness: 2px; }
.q-elim.on { background: var(--bb-blue); border-color: var(--bb-blue); color: #fff; }
.q-result { margin-right: 10px; font-weight: 700; font-size: 0.9rem; padding: 2px 10px; border-radius: 999px; }
.q-result.ok { background: #e2f3e7; color: var(--bb-green); }
.q-result.no { background: #fbe4ea; color: var(--bb-red); }
.q-pad { padding: 18px 2px 0; }
.q-stem { font-family: var(--bb-serif); font-size: 1.07rem; line-height: 1.65; }
.q-stem p { margin: 0 0 0.8em; }
.q-fig { display: flex; justify-content: center; margin: 4px 0 16px; }
.q-fig svg { max-width: 100%; height: auto; }
.q-fig .note { font-family: var(--bb-serif); font-size: 0.92rem; text-align: center; margin-top: 4px; }
.q-figcol { display: flex; flex-direction: column; align-items: center; }
.q-table { border-collapse: collapse; margin: 6px auto 14px; font-family: var(--bb-serif); font-size: 1rem; }
.q-table th, .q-table td { border: 1px solid #555; padding: 6px 14px; text-align: center; }
.q-table th { background: #f2f2f2; font-weight: 700; }
.katex { font-size: 1.05em; }

/* choices */
.choices { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.choice-row { display: flex; align-items: center; gap: 10px; }
.choice {
  position: relative; flex: 1; display: flex; align-items: center; gap: 14px; text-align: left;
  min-height: 50px; padding: 10px 16px; border: 1.5px solid #3d3d3d; border-radius: 9px; background: #fff;
  cursor: pointer; font-family: var(--bb-serif); font-size: 1.04rem;
}
.choice:hover { border-color: var(--bb-blue); }
.choice .letter {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #222; display: grid; place-items: center;
  font-family: var(--bb-sans); font-weight: 700; font-size: 0.85rem;
}
.choice.sel { border: 3px solid var(--bb-blue); padding: 8.5px 14.5px; }
.choice.sel .letter { background: var(--bb-blue); border-color: var(--bb-blue); color: #fff; }
.choice.out { color: #8a8a8a; border-color: #b9b9b9; }
.choice.out .letter { border-color: #b9b9b9; }
.choice.out::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: #3a3a3a; }
.choice:disabled { cursor: default; }
.choice.right { border: 3px solid var(--bb-green); padding: 8.5px 14.5px; background: #f1faf3; }
.choice.right .letter { background: var(--bb-green); border-color: var(--bb-green); color: #fff; }
.choice.wrong { border: 3px solid var(--bb-red); padding: 8.5px 14.5px; background: #fdf1f4; }
.choice.wrong .letter { background: var(--bb-red); border-color: var(--bb-red); color: #fff; }
.elim-btn { flex: none; width: 46px; background: none; border: 0; cursor: pointer; font-weight: 700; font-size: 0.85rem; color: var(--bb-blue); text-decoration: underline; }
.elim-l { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid #333; border-radius: 50%; color: #222; text-decoration: line-through; text-decoration-thickness: 2px; }

/* student-produced response */
.spr-h { font-size: 1.2rem; margin: 0 0 10px; }
.spr-list { margin: 0 0 14px; padding-left: 20px; line-height: 1.55; font-size: 0.95rem; }
.spr-list li { margin-bottom: 6px; }
.spr-ex-title { font-weight: 700; text-align: center; margin: 10px 0 6px; }
.spr-ex { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.spr-ex th, .spr-ex td { border: 1px solid #555; padding: 6px 8px; text-align: center; vertical-align: middle; }
.spr-ex th { font-weight: 700; background: #f4f4f4; }
.spr-box { margin-top: 18px; }
.spr-in {
  width: 170px; font-size: 1.3rem; padding: 10px 12px; border: 1.5px solid #444; border-bottom: 4px solid #444; border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.04em;
}
.spr-in:focus { outline: none; border-color: var(--bb-blue); }
.spr-in.right { border-color: var(--bb-green); background: #f1faf3; }
.spr-in.wrong { border-color: var(--bb-red); background: #fdf1f4; }
.spr-prev { font-weight: 700; margin: 14px 0 0; min-height: 40px; }
.spr-correct { margin-top: 8px; }

/* footer */
.bb-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; min-height: 66px; padding: 8px 24px; background: var(--bb-head); }
.bb-f-left { font-weight: 700; }
.bb-f-right { display: flex; justify-content: flex-end; gap: 10px; }
.bb-navbtn { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; background: #1e1e1e; color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 700; cursor: pointer; }
.bb-navbtn:hover { background: #000; }
.bb-review-pos { font-weight: 700; }

/* question list popup and check-your-work grid */
.bb-pop {
  position: fixed; z-index: 60; left: 50%; bottom: 82px; transform: translateX(-50%); width: min(600px, 94vw);
  background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28); padding: 18px 22px 16px;
}
.bb-pop::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -9px; border: 9px solid transparent; border-bottom: 0; border-top-color: #fff; }
.bb-pop-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 1.05rem; padding-bottom: 10px; border-bottom: 1px solid #ddd; }
.bb-pop-foot { display: flex; justify-content: center; margin-top: 16px; }
.bb-legend { display: flex; gap: 22px; justify-content: center; margin: 12px 0; font-size: 0.9rem; flex-wrap: wrap; }
.bb-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.bb-lg-box { width: 16px; height: 16px; border: 1.5px dashed #333; display: inline-block; }
.bb-lg-flag svg { color: var(--bb-red); --fill: var(--bb-red); }
.bb-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 14px 10px; padding: 8px 4px; }
.bb-qn {
  position: relative; height: 42px; border: 1.5px dashed #444; background: #fff; color: var(--bb-blue); font-weight: 700; cursor: pointer; border-radius: 3px;
}
.bb-qn.done { border: 1.5px solid var(--bb-blue); background: var(--bb-blue); color: #fff; }
.bb-qn:hover { box-shadow: 0 0 0 2px #9fb0ee; }
.bb-qn-pin { position: absolute; left: 50%; top: -15px; transform: translateX(-50%); }
.bb-qn-flag { position: absolute; right: -6px; top: -9px; }
.bb-qn-flag svg { color: var(--bb-red); --fill: var(--bb-red); }
.ck { max-width: 860px; margin: 34px auto; padding: 0 24px; text-align: center; }
.ck h1 { font-size: 1.9rem; margin: 0 0 8px; }
.ck > p { margin: 0 auto 22px; max-width: 620px; }
.ck-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14); padding: 20px 28px 26px; text-align: left; }
.ck-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid #ddd; font-weight: 700; font-size: 1.1rem; }
.ck-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); margin-top: 12px; }

/* menus, directions, modal, toast */
.bb-menu { position: fixed; z-index: 70; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); padding: 6px; display: flex; flex-direction: column; min-width: 200px; }
.bb-menu button { background: none; border: 0; text-align: left; padding: 10px 14px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.bb-menu button:hover { background: #eef1fd; color: var(--bb-blue); }
.bb-dirs { position: fixed; z-index: 65; left: 0; right: 0; top: 77px; max-height: calc(100vh - 160px); background: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22); display: flex; flex-direction: column; }
.bb-dirs-body { overflow: auto; padding: 22px max(28px, calc(50vw - 420px)); font-family: var(--bb-serif); line-height: 1.6; }
.bb-dirs-foot { display: flex; justify-content: flex-end; padding: 12px 28px; border-top: 1px solid #ddd; }
.bb-modal { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; padding: 18px; }
.bb-modal-card { background: #fff; border-radius: 12px; max-width: 520px; width: 100%; padding: 26px 28px 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }
.bb-modal-card h2 { margin: 0 0 10px; font-size: 1.35rem; }
.bb-modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.bb-help { padding-left: 18px; line-height: 1.55; }
.bb-help li { margin-bottom: 8px; }
.bb-toast { position: fixed; z-index: 80; top: 92px; left: 50%; transform: translateX(-50%); background: #1e1e1e; color: #fff; padding: 12px 14px 12px 18px; border-radius: 8px; display: flex; gap: 14px; align-items: center; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.bb-toast button { background: none; border: 0; color: #fff; cursor: pointer; display: grid; }

/* floating panels */
.bb-panel {
  position: fixed; z-index: 55; background: #fff; border-radius: 8px; box-shadow: 0 8px 34px rgba(0, 0, 0, 0.32);
  display: flex; flex-direction: column; overflow: hidden; resize: both; min-width: 300px; min-height: 260px;
}
.bb-panel[hidden] { display: none; }
.bb-panel-head { display: flex; align-items: center; gap: 4px; background: #262626; color: #fff; padding: 6px 8px 6px 14px; font-weight: 700; cursor: move; user-select: none; touch-action: none; }
.bb-panel-gap { flex: 1; }
.bb-panel-x { background: none; border: 0; color: inherit; cursor: pointer; display: grid; place-items: center; width: 30px; height: 28px; border-radius: 4px; }
.bb-panel-x:hover { background: rgba(255, 255, 255, 0.15); }
.bb-pop .bb-panel-x:hover { background: #eee; }
.bb-panel-body { flex: 1; min-height: 0; overflow: auto; }
.bb-calc { width: 660px; height: 600px; max-width: 96vw; max-height: calc(100vh - 110px); }
.bb-calc.big { width: min(1000px, 96vw); height: calc(100vh - 110px); }
.bb-calc .bb-panel-body { overflow: hidden; }
.bb-ref { width: 470px; height: 590px; max-width: 96vw; max-height: calc(100vh - 110px); }
.bb-ref.big { width: min(760px, 96vw); }

/* reference sheet */
.ref { padding: 16px 18px; font-family: var(--bb-serif); }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px 10px; }
.ref figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ref figcaption { text-align: center; font-size: 0.9rem; line-height: 1.5; }
.ref > p { margin: 10px 0 0; font-size: 0.95rem; }

/* intro */
.bb-intro { flex: 1; display: grid; place-items: center; padding: 30px 18px; background: linear-gradient(180deg, var(--bb-head), #fff 60%); }
.bb-intro-card { max-width: 720px; width: 100%; background: #fff; border-radius: 14px; box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12); padding: 32px 36px; }
.bb-kicker { margin: 0 0 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--bb-blue); }
.bb-intro-card h1, .res h1 { margin: 0 0 6px; font-size: 2rem; line-height: 1.15; }
.bb-intro-sub { margin: 0 0 18px; color: var(--bb-muted); font-weight: 700; }
.bb-facts { padding-left: 20px; line-height: 1.6; margin: 0 0 18px; }
.bb-facts li { margin-bottom: 8px; }
.bb-name { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.92rem; margin-bottom: 20px; }
.bb-name input { font: inherit; font-weight: 400; padding: 9px 12px; border: 1.5px solid #888; border-radius: 6px; max-width: 340px; }
.bb-intro-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }

/* results */
.res { flex: 1; background: #fff; }
.res-top { background: var(--bb-head); padding: 14px 24px; }
.res-back { color: var(--bb-blue); font-weight: 700; text-decoration: none; }
.res-wrap { max-width: 980px; margin: 0 auto; padding: 26px 24px 60px; }
.res h2 { font-size: 1.4rem; margin: 30px 0 10px; }
.res h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.res-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 18px 0 10px; }
.res-score, .res-raw { border-radius: 14px; padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; }
.res-score { background: var(--bb-blue); color: #fff; }
.res-raw { background: var(--bb-head); }
.res-label { font-weight: 700; font-size: 0.9rem; }
.res-big { font-size: 3.2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.res-big small { font-size: 1.4rem; }
.res-range { font-size: 0.88rem; opacity: 0.9; }
.res-domains { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.res-dom-row { display: grid; grid-template-columns: minmax(150px, 280px) 1fr 52px; align-items: center; gap: 14px; font-weight: 700; font-size: 0.95rem; }
.res-bar { height: 12px; background: #e3e6f2; border-radius: 999px; overflow: hidden; }
.res-bar span { display: block; height: 100%; background: var(--bb-blue); border-radius: 999px; }
.res-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.res-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.93rem; }
.res-table th { text-align: left; border-bottom: 2px solid #333; padding: 7px 8px; }
.res-table td { border-bottom: 1px solid #e1e1e1; padding: 7px 8px; vertical-align: middle; }
.res-dom { display: block; font-size: 0.75rem; color: var(--bb-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.res-blank { color: var(--bb-muted); font-family: var(--bb-sans); font-style: italic; }
.res-mark { font-weight: 700; font-size: 0.85rem; }
.res-mark.ok { color: var(--bb-green); }
.res-mark.no { color: var(--bb-red); }
.res-mark.skip { color: var(--bb-muted); }

/* explanations */
.exp { margin-top: 26px; border-top: 2px solid #e2e2e2; padding-top: 16px; font-family: var(--bb-serif); line-height: 1.65; }
.exp h3 { font-family: var(--bb-sans); margin: 0 0 8px; font-size: 1.1rem; }
.exp p { margin: 0 0 0.8em; }
.exp-tip { background: #eef1fd; border-left: 4px solid var(--bb-blue); padding: 10px 14px; border-radius: 4px; margin: 10px 0 14px; }
.exp-calc { margin-top: 4px; font-family: var(--bb-sans); }
.exp-calc svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ graphing calculator */
.gc { display: flex; height: 100%; font-family: var(--bb-sans); background: #fff; }
.gc-list { width: 44%; min-width: 210px; max-width: 360px; display: flex; flex-direction: column; border-right: 1px solid #d9d9d9; min-height: 0; }
.gc-narrow { flex-direction: column; }
.gc-narrow .gc-list { width: 100%; max-width: none; height: 42%; border-right: 0; border-bottom: 1px solid #d9d9d9; }
.gc-bar { display: flex; align-items: center; gap: 6px; padding: 5px 6px; background: #f2f2f2; border-bottom: 1px solid #d9d9d9; }
.gc-bar-gap { flex: 1; }
.gc-btn { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid #c4c4c4; border-radius: 5px; background: #fff; cursor: pointer; font-weight: 700; font-size: 0.85rem; }
.gc-btn:hover { background: #f0f4ff; border-color: #8aa2e8; }
.gc-add { font-size: 1.15rem; }
.gc-rows { flex: 1; overflow: auto; min-height: 0; }
.gc-row { display: grid; grid-template-columns: 38px 1fr 26px; align-items: stretch; border-bottom: 1px solid #e3e3e3; position: relative; }
.gc-row.sel { box-shadow: inset 4px 0 0 #2f72dc; background: #f6f9ff; }
.gc-sw { grid-row: 1; grid-column: 1; align-self: start; margin: 12px 0 0 9px; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--c); background: #fff; cursor: pointer; padding: 0; }
.gc-sw.on { background: var(--c); }
.gc-sw.blank { visibility: hidden; }
.gc-idx { position: absolute; left: 3px; bottom: 2px; font-size: 0.65rem; color: #999; }
.gc-cell { grid-column: 2; min-width: 0; padding: 6px 4px 6px 2px; }
.gc-in { width: 100%; border: 0; outline: none; background: transparent; font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 1.12rem; padding: 6px 2px; }
.gc-out { font-size: 0.86rem; min-height: 0; text-align: right; padding-right: 2px; }
.gc-out.val { color: #222; font-weight: 700; font-size: 1rem; }
.gc-out.err { color: #b3261e; text-align: left; font-size: 0.8rem; }
.gc-del { grid-column: 3; background: none; border: 0; color: #999; cursor: pointer; font-size: 1.2rem; opacity: 0; }
.gc-row:hover .gc-del, .gc-row.sel .gc-del { opacity: 1; }
.gc-del:hover { color: #b3261e; }
.gc-hint { margin: 0; padding: 8px 10px; font-size: 0.78rem; color: #666; border-top: 1px solid #e3e3e3; line-height: 1.45; }
.gc-graph { flex: 1; position: relative; min-width: 0; min-height: 0; }
.gc-canvas { width: 100%; height: 100%; touch-action: none; cursor: grab; }
.gc-canvas.panning { cursor: grabbing; }
.gc-zoom { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 5px; }
.gc-zoom .gc-btn { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); font-size: 1rem; }
.gc-window { position: absolute; top: 8px; right: 48px; background: #fff; border: 1px solid #c4c4c4; border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); padding: 10px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 0.82rem; width: 230px; }
.gc-window[hidden] { display: none; }
.gc-window-title { grid-column: 1 / -1; margin: 0; font-weight: 700; }
.gc-window label { display: flex; flex-direction: column; gap: 2px; }
.gc-window input { width: 100%; font: inherit; padding: 4px 6px; border: 1px solid #bbb; border-radius: 4px; }
.gc-window-row { grid-column: 1 / -1; display: flex; gap: 6px; }
.gc-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid #b5b5b5; border-radius: 4px; padding: 2px 6px; font-weight: 700; font-size: 0.82rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.gc-tip[hidden] { display: none; }
.gc-desmos { width: 100%; height: 100%; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 820px) {
  .bb-head { grid-template-columns: 1fr auto; padding: 6px 12px; }
  .bb-h-right { grid-column: 1 / -1; justify-content: center; }
  .bb-tool { min-width: 60px; }
  .q-split { grid-template-columns: 1fr; }
  .q-divider { height: 6px; }
  .q-left { order: 3; }
  .q-single { padding: 0 14px; margin-top: 16px; }
  .q-left, .q-right { padding: 16px 14px 24px; }
  .bb-foot { grid-template-columns: auto 1fr; padding: 8px 12px; }
  .bb-f-left { display: none; }
  .bb-f-mid { justify-self: start; }
  .bb-navbtn { padding: 9px 10px; }
  .bb-f-right .bb-btn { padding: 0 16px; }
  .bb-dirs { top: 0; max-height: 100vh; }
  .bb-calc, .bb-calc.big { left: 2vw !important; right: auto !important; top: 70px !important; width: 96vw; height: calc(100vh - 150px); }
  .bb-intro-card { padding: 24px 20px; }
  .res-dom-row { grid-template-columns: 1fr 52px; }
  .res-dom-row .res-bar { grid-column: 1 / -1; grid-row: 2; }
}
