/* Briefing (briefing.html): a page of text, grids of boards and quizzes, on
   top of the quiz pages' header, dialogs and menus (quiz.css). Text reads in
   a column; grids of two or more boards break out wider so each board has room. */

:root {
  --bf-col: 800px;                                  /* the text column */
  --bf-wide: min(1280px, calc(100vw - 48px));       /* grids of 2+ boards */
}

.bf-body { background: #fff; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.bf-app-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 8px; background: #0f7b6c; color: #fff; }
.bf-doc-name { font-family: var(--qz-display); font-size: 18px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-view-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; background: var(--qz-accent-tint); color: var(--qz-accent); font-size: 12px; font-weight: 500; white-space: nowrap; }

.bf-format {
  display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 12px 0 16px;
  border-top: 1px solid var(--qz-line-soft); overflow-x: auto; scrollbar-width: none;
}
.bf-format::-webkit-scrollbar { display: none; }
.bf-format .bf-fmt { color: var(--qz-muted); }
.bf-format .bf-fmt.on { background: var(--qz-accent-tint); color: var(--qz-accent); }
.bf-format-off .bf-fmt, .bf-format-off .bf-style { opacity: 0.45; }
.bf-style { height: 32px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 13px; cursor: pointer; }
.bf-style:hover { background: var(--qz-hover); }
.bf-format-sep { flex: 0 0 auto; width: 1px; height: 22px; margin: 0 6px; background: var(--qz-line); }
.bf-format-gap { margin-left: auto; }
.bf-insert-label { flex: 0 0 auto; margin: 0 4px 0 2px; color: var(--qz-muted); font-size: 12px; }
.bf-ins {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; height: 32px; padding: 0 10px 0 8px;
  border: 0; border-radius: 16px; background: transparent; color: var(--qz-ink); font-size: 13px;
}
.bf-ins:hover { background: var(--qz-hover); }
.bf-ins svg { color: #0f7b6c; }

/* ── The page ────────────────────────────────────────────────────────────── */
.bf-main { padding: 36px 24px 120px; }
.bf-sheet { max-width: var(--bf-col); margin: 0 auto; }
.bf-blocks { display: flex; flex-direction: column; gap: 18px; }
.bf-nothing { color: var(--qz-muted); text-align: center; padding: 48px 0; }

.bf-block { position: relative; border-radius: 8px; }
.bf-hide-empty { display: none; }
.bf-editing .bf-block:hover, .bf-editing .bf-block:focus-within { box-shadow: 0 0 0 1px var(--qz-line-soft); }

/* Grids of 2+ boards: wider than the text. */
.bf-block-boards.bf-wide { width: var(--bf-wide); margin-left: calc((100% - var(--bf-wide)) / 2); }

/* Move / more (top right) and "+" (add above), on hover */
.bf-block-tools {
  position: absolute; top: -16px; right: 8px; z-index: 5; display: flex; gap: 2px; padding: 2px;
  border-radius: 18px; background: #fff; box-shadow: var(--qz-shadow); opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.bf-insert {
  position: absolute; top: -15px; left: 50%; z-index: 5; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-left: -13px; padding: 0; border: 1px solid var(--qz-line); border-radius: 50%;
  background: #fff; color: #0f7b6c; opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.bf-insert:hover { background: #e6f4f1; }
.bf-block:hover > .bf-block-tools, .bf-block:focus-within > .bf-block-tools,
.bf-block:hover > .bf-insert, .bf-block:focus-within > .bf-insert { opacity: 1; pointer-events: auto; }
@media (hover: none) {
  .bf-block-tools, .bf-insert { opacity: 1; pointer-events: auto; }
}

/* ── Text ────────────────────────────────────────────────────────────────── */
.bf-text {
  position: relative; min-height: 1.6em; padding: 6px 10px; border-radius: 6px; outline: none;
  font-size: 16px; line-height: 1.6; color: var(--qz-ink); overflow-wrap: anywhere;
}
.bf-text[contenteditable]:focus { background: #fafbfc; }
.bf-text.is-empty::before { content: attr(data-placeholder); position: absolute; left: 10px; top: 6px; color: var(--qz-faint); pointer-events: none; }
.bf-text > :first-child { margin-top: 0; }
.bf-text > :last-child { margin-bottom: 0; }
.bf-text h2 { margin: 18px 0 6px; font-family: var(--qz-display); font-size: 26px; font-weight: 500; line-height: 1.3; }
.bf-text h3 { margin: 14px 0 4px; font-family: var(--qz-display); font-size: 19px; font-weight: 500; line-height: 1.35; }
.bf-text p, .bf-text div { margin: 0; }
.bf-text p + p { margin-top: 8px; }
.bf-text ul, .bf-text ol { margin: 6px 0; padding-left: 26px; }
.bf-text li + li { margin-top: 2px; }
.bf-text blockquote { margin: 8px 0; padding: 4px 0 4px 14px; border-left: 3px solid #0f7b6c; color: #3c4043; }
.bf-text a { color: var(--qz-accent); }

/* ── Grids of boards ─────────────────────────────────────────────────────── */
.bf-grid-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; padding: 6px 4px 0; }
/* Room for the block's ↑ ↓ ⋮ (top right, on hover) */
.bf-editing .bf-grid-head, .bf-editing .bf-quiz-head { padding-right: 124px; }
.bf-grid-label { display: inline-flex; align-items: center; gap: 6px; color: var(--qz-muted); font-size: 13px; font-weight: 500; }
.bf-grid-label svg { color: #0f7b6c; }
.bf-cols { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding: 2px; border-radius: 18px; background: var(--qz-field); }
.bf-cols-label { padding: 0 8px 0 10px; color: var(--qz-muted); font-size: 12px; }
.bf-cols button { min-width: 32px; height: 28px; padding: 0 9px; border: 0; border-radius: 14px; background: transparent; font-size: 13px; color: var(--qz-ink); }
.bf-cols button:hover { background: rgba(60, 64, 67, 0.08); }
.bf-cols button.on { background: #fff; color: #0f7b6c; font-weight: 500; box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3); }
.bf-grid-is-empty .bf-grid-head .bf-cols { display: none; }
.bf-grid-is-empty .bf-grid-head .bf-grid-add { display: none; }
.bf-grid-is-empty .bf-grid-head { margin-bottom: 0; }

.bf-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 18px 16px; }
.bf-grid:empty { display: none; }
.bf-cell { margin: 0; min-width: 0; }
.bf-cell .qz-board { margin: 0; }
.bf-grid:not([data-cols="1"]) .qz-board-tip { display: none; }
.bf-grid:not([data-cols="1"]) .qz-board-bar { justify-content: space-between; gap: 4px; }
.bf-grid:not([data-cols="1"]) .qz-board-name { min-width: 0; overflow: hidden; }
.bf-grid:not([data-cols="1"]) .qz-board-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-grid[data-cols="4"] .qz-board-open, .bf-grid[data-cols="3"] .qz-board-open { font-size: 0; gap: 0; }
.bf-cell-foot { display: flex; align-items: center; gap: 2px; min-height: 30px; margin-top: 6px; }
.bf-caption { flex: 1 1 auto; min-width: 0; font-size: 13px; color: #3c4043; }
input.bf-caption { height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; outline: none; }
input.bf-caption:hover { border-color: var(--qz-line-soft); }
input.bf-caption:focus { border-color: var(--qz-accent); background: #fff; }
span.bf-caption { padding: 0 2px; }
.bf-cell-foot .qz-icon-btn { opacity: 0; transition: opacity 0.12s; }
.bf-cell:hover .bf-cell-foot .qz-icon-btn, .bf-cell:focus-within .bf-cell-foot .qz-icon-btn { opacity: 1; }
@media (hover: none) { .bf-cell-foot .qz-icon-btn { opacity: 1; } }
.bf-readonly .bf-cell-foot { min-height: 0; }

.bf-grid-empty, .bf-quiz-empty {
  display: none; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; text-align: center;
  border: 2px dashed var(--qz-line); border-radius: 12px; color: var(--qz-muted);
}
.bf-grid-empty > svg, .bf-quiz-empty > svg { color: #0f7b6c; }
.bf-grid-empty p, .bf-quiz-empty p { margin: 0 0 6px; max-width: 420px; }
.bf-grid-empty b, .bf-quiz-empty b { color: var(--qz-ink); font-weight: 500; }
.bf-grid-is-empty .bf-grid-empty, .bf-quiz-empty { display: flex; }
.bf-grid-empty-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ── Quizzes ─────────────────────────────────────────────────────────────── */
.bf-quiz-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; }
.bf-quiz-head > svg { color: var(--qz-accent); }
.bf-quiz-title { font-family: var(--qz-display); font-size: 16px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-quiz-open { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.bf-quiz-frame { display: block; width: 100%; height: 480px; border: 0; border-radius: 10px; background: var(--qz-bg); }
.bf-quiz-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; min-height: 120px; overflow: auto; margin: 12px 0; }
.bf-quiz-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--qz-line-soft); border-radius: 8px;
  background: #fff; text-align: left;
}
.bf-quiz-item:hover { border-color: #bdc1c6; }
.bf-quiz-item.selected { border-color: var(--qz-accent); background: var(--qz-accent-tint); }
.bf-quiz-item > svg { color: var(--qz-accent); flex: 0 0 auto; }
.bf-quiz-item-text { display: flex; flex-direction: column; min-width: 0; }
.bf-quiz-item-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.bf-divider { margin: 10px 0; border: 0; border-top: 1px solid var(--qz-line); }

/* ── Add bar (the end of the page) ───────────────────────────────────────── */
.bf-addbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 28px; padding: 10px 12px;
  border: 1px dashed var(--qz-line); border-radius: 12px;
}
.bf-addbar-label { margin-right: 4px; color: var(--qz-muted); font-size: 13px; }
.bf-addbar-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px;
  border: 1px solid var(--qz-line); border-radius: 18px; background: #fff; color: var(--qz-ink); font-size: 14px;
}
.bf-addbar-btn:hover { background: #e6f4f1; border-color: #a8d5cc; }
.bf-addbar-btn svg { color: #0f7b6c; }

/* ── Share dialog ────────────────────────────────────────────────────────── */
/* Share dialog: the quiz's (quiz.css .qz-share-box); the link's Viewer / Editor
   picker sits on the right like each person's. */
.qz-general .qz-select.bf-link-role { align-self: center; height: 36px; padding: 0 36px 0 14px; border: 1px solid var(--qz-line); font-weight: 400; background-position: right 8px center; }

/* ── Who's here (live) ───────────────────────────────────────────────────── */
.bf-people { display: inline-flex; align-items: center; margin-right: 6px; }
.bf-face {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: -6px;
  border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 500; cursor: default;
}
.bf-face:first-child { margin-left: 0; }
.bf-face.more { background: var(--qz-muted); font-size: 11px; }
/* A block someone else is in: their colour round it, their name on top. */
.bf-block.bf-remote { box-shadow: 0 0 0 2px var(--bf-who, #1a73e8) !important; }
.bf-who {
  position: absolute; top: -11px; left: 10px; z-index: 4; max-width: 60%; padding: 1px 8px; border-radius: 10px;
  background: var(--bf-who, #1a73e8); color: #fff; font-size: 11px; font-weight: 500; line-height: 18px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
}
.qz-save-status[role="button"] { cursor: pointer; border-radius: 4px; padding: 2px 4px; }
.qz-save-status[role="button"]:hover { background: var(--qz-hover); color: var(--qz-ink); }

/* ── Version history ─────────────────────────────────────────────────────── */
.bf-vh {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: 320px; display: flex; flex-direction: column;
  background: #fff; border-left: 1px solid var(--qz-line); box-shadow: -2px 0 8px rgba(60, 64, 67, 0.12);
}
body.bf-vh-open .bf-top, body.bf-vh-open .bf-main { margin-right: 320px; }
body.bf-vh-open { --bf-wide: min(1280px, calc(100vw - 368px)); }
.bf-vh-head { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 8px 0 20px; border-bottom: 1px solid var(--qz-line-soft); }
.bf-vh-head h2 { margin: 0; font-family: var(--qz-display); font-size: 18px; font-weight: 400; }
.bf-vh-list { flex: 1 1 auto; overflow-y: auto; padding: 4px 0 12px; }
.bf-vh-empty { padding: 20px; color: var(--qz-muted); }
.bf-vh-day { padding: 14px 20px 4px; color: var(--qz-muted); font-size: 12px; font-weight: 500; }
.bf-vh-item { display: flex; gap: 4px; align-items: flex-start; padding: 10px 8px 10px 16px; border-left: 4px solid transparent; cursor: pointer; outline: none; }
.bf-vh-item:hover { background: var(--qz-hover); }
.bf-vh-item:focus-visible { background: var(--qz-hover); box-shadow: inset 0 0 0 2px var(--qz-accent); }
.bf-vh-item.selected { background: #e6f4f1; border-left-color: #0f7b6c; }
.bf-vh-main { flex: 1 1 auto; min-width: 0; }
.bf-vh-title { font-size: 14px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.bf-vh-time { font-size: 12px; color: var(--qz-muted); }
.bf-vh-note { font-size: 12px; font-style: italic; color: var(--qz-muted); }
.bf-vh-editors { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.bf-vh-editor { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--qz-muted); min-width: 0; }
.bf-vh-editor span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-vh-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.bf-vh-more { opacity: 0; }
.bf-vh-item:hover .bf-vh-more, .bf-vh-item.selected .bf-vh-more, .bf-vh-item:focus-within .bf-vh-more { opacity: 1; }
.bf-vh-filter { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--qz-line-soft); font-size: 13px; cursor: pointer; }
.bf-vh-filter input { width: 16px; height: 16px; margin: 0; accent-color: #0f7b6c; }

/* Looking at a version: it replaces the briefing; the bar replaces the toolbar. */
.bf-vh-bar { display: none; align-items: center; gap: 12px; height: 52px; padding: 0 16px 0 10px; border-top: 1px solid var(--qz-line-soft); background: #e6f4f1; }
.bf-top.bf-viewing .bf-vh-bar { display: flex; }
.bf-top.bf-viewing .bf-format { display: none; }
.bf-vh-bar-text { flex: 1 1 auto; min-width: 0; }
.bf-vh-bar-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-vh-bar-sub { font-size: 12px; color: var(--qz-muted); }
.bf-viewing .bf-blocks:not(.bf-version-view), .bf-viewing .bf-addbar { display: none; }
.bf-version-view .bf-block { box-shadow: none !important; }
.bf-vtile {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 16px;
  border: 1px solid var(--qz-line); border-radius: 8px; background: #f4f1ec; color: var(--qz-ink); text-decoration: none; text-align: center;
}
.bf-vtile:hover { border-color: #bdc1c6; }
.bf-vboard { aspect-ratio: 16 / 10; }
.bf-vboard svg { color: #0f7b6c; }
.bf-vboard span { font-weight: 500; }
.bf-vquiz { flex-direction: row; justify-content: flex-start; background: var(--qz-bg); font-weight: 500; }
.bf-vquiz svg { color: var(--qz-accent); }
@media (max-width: 900px) {
  .bf-vh { width: 100%; max-width: 360px; }
  body.bf-vh-open .bf-top, body.bf-vh-open .bf-main { margin-right: 0; }
}

/* ── Can't open it ───────────────────────────────────────────────────────── */
.bf-message { max-width: 460px; margin: 15vh auto 0; padding: 32px; text-align: center; background: #fff; border-radius: 12px; box-shadow: var(--qz-shadow); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bf-message > svg { color: #0f7b6c; }
.bf-message h1 { margin: 4px 0 0; font-family: var(--qz-display); font-size: 22px; font-weight: 400; }
.bf-message p { margin: 0 0 10px; color: var(--qz-muted); }

/* ── Smaller screens: fewer columns ─────────────────────────────────────── */
@media (max-width: 960px) {
  .bf-grid[data-cols="3"], .bf-grid[data-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --bf-wide: calc(100vw - 24px); }
  .bf-main { padding: 20px 12px 96px; }
  .bf-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .bf-text { font-size: 15px; }
  .bf-doc-name { font-size: 16px; }
  .bf-view-chip span { display: none; }
  .bf-insert-label { display: none; }
  .bf-ins span { display: none; }
  .bf-cols-label { display: none; }
}

/* ── Printing (and Save as PDF) ──────────────────────────────────────────── */
@media print {
  .bf-top, .bf-vh, .bf-who, .bf-addbar, .bf-block-tools, .bf-insert, .qz-snack, .bf-grid-head, .bf-grid-empty, .bf-quiz-empty,
  .bf-cell-foot .qz-icon-btn, .qz-board-bar, .qz-board-shield, .qz-board-status, .bf-quiz-head .qz-btn-text { display: none !important; }
  .bf-main { padding: 0; }
  .bf-block { box-shadow: none !important; break-inside: avoid; }
  .bf-block-text { break-inside: auto; }
  .bf-block-boards.bf-wide { width: auto; margin-left: 0; }
  .bf-text.is-empty::before { content: none; }
  input.bf-caption { border: 0; padding: 0; }
  input.bf-caption:placeholder-shown { display: none; }
  .bf-cell { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
