/* ===== Bits and Bobs ===== */
.ms-note { padding: 4px 0 12px; }
.ms-view { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; }

/* ---------- board ---------- */
.ms-board {
	--ms-ink: var(--text-normal);
	--ms-accent: var(--interactive-accent);
	position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%;
	outline: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ms-viewport {
	position: relative; flex: 1; min-height: 0; overflow: hidden;
	touch-action: none; background-color: var(--background-primary); cursor: crosshair;
}
.ms-board.has-frame .ms-viewport { background-color: var(--background-secondary); }
.ms-board.is-static .ms-viewport { cursor: default; background: transparent; }
.ms-viewport[data-bg="grid"], .ms-frame[data-bg="grid"] {
	background-image: linear-gradient(var(--background-modifier-border) 1px, transparent 1px), linear-gradient(90deg, var(--background-modifier-border) 1px, transparent 1px);
}
.ms-viewport[data-bg="dots"], .ms-frame[data-bg="dots"] { background-image: radial-gradient(circle, var(--text-faint) 1.2px, transparent 1.4px); }
.ms-viewport[data-bg="lines"], .ms-frame[data-bg="lines"] { background-image: linear-gradient(var(--background-modifier-border) 1px, transparent 1px); }
.ms-frame[data-bg] { background-size: 40px 40px; }
.ms-board[data-tool="select"] .ms-viewport { cursor: default; }
.ms-board[data-tool="hand"] .ms-viewport, .ms-board.is-panning .ms-viewport { cursor: grab; }
.ms-board[data-tool="text"] .ms-viewport { cursor: text; }
.ms-board[data-tool="eraser"] .ms-viewport { cursor: cell; }

.ms-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.ms-frame { position: absolute; left: 0; top: 0; background-color: var(--ms-frame-bg, var(--background-primary)); box-shadow: 0 2px 14px rgba(0,0,0,.18); border-radius: 2px; }
.ms-svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.ms-svg.is-hl { mix-blend-mode: multiply; opacity: .45; }
.theme-dark .ms-svg.is-hl { mix-blend-mode: screen; opacity: .35; }
.ms-text { position: absolute; font-family: var(--ms-font, inherit); line-height: 1.4; pointer-events: none; word-wrap: break-word; }
.ms-text > :first-child { margin-top: 0; }
.ms-text > :last-child { margin-bottom: 0; }
.ms-text h1, .ms-text h2, .ms-text h3 { color: inherit; font-family: var(--ms-head-font, var(--ms-font, inherit)); }
.ms-text mjx-container { font-size: 110%; }
.ms-image { position: absolute; pointer-events: none; }
.ms-image img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 3px; }
.ms-graph { position: absolute; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 6px; pointer-events: none; overflow: hidden; }
.ms-graph svg { display: block; }
.ms-graph-grid line { stroke: var(--background-modifier-border); stroke-width: 1; }
.ms-graph-axes line { stroke: var(--text-muted); stroke-width: 1.5; }
.ms-graph-labels text { fill: var(--text-faint); font-size: 10px; font-family: var(--font-interface); }
.ms-graph-curve { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.ms-graph-legend { position: absolute; top: 6px; right: 8px; font-size: 12px; font-family: var(--font-monospace); text-align: right; background: var(--background-primary); padding: 2px 6px; border-radius: 4px; opacity: .92; }

.ms-text-edit {
	position: absolute; z-index: 5; min-height: 1.6em; resize: none; overflow: hidden;
	font-family: var(--font-text); line-height: 1.4; padding: 2px 4px; margin: -3px -5px;
	background: var(--background-primary); border: 2px solid var(--ms-accent); border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0,0,0,.15); user-select: text; -webkit-user-select: text;
}
.ms-sel-layer { position: absolute; left: 0; top: 0; pointer-events: none; }
.ms-sel-box { position: absolute; border: calc(1.5px / var(--ms-z, 1)) solid var(--ms-accent); border-radius: calc(3px / var(--ms-z, 1)); margin: calc(-3px / var(--ms-z, 1)); padding: calc(3px / var(--ms-z, 1)); box-sizing: content-box; }
.ms-sel-handle { position: absolute; width: calc(14px / var(--ms-z, 1)); height: calc(14px / var(--ms-z, 1)); margin: calc(-7px / var(--ms-z, 1)); background: var(--background-primary); border: calc(2px / var(--ms-z, 1)) solid var(--ms-accent); border-radius: 50%; }
.ms-marquee { position: absolute; border: calc(1px / var(--ms-z, 1)) dashed var(--ms-accent); background: color-mix(in srgb, var(--ms-accent) 10%, transparent); }

/* ---------- toolbar ---------- */
.ms-toolbar {
	display: flex; gap: 6px; align-items: center; padding: 6px 8px; flex-wrap: nowrap; overflow-x: auto;
	border-bottom: 1px solid var(--background-modifier-border); background: var(--background-secondary);
	scrollbar-width: none; flex-shrink: 0;
}
.ms-toolbar::-webkit-scrollbar { display: none; }
.ms-tb-group { display: flex; gap: 2px; align-items: center; padding-right: 6px; border-right: 1px solid var(--background-modifier-border); flex-shrink: 0; }
.ms-tb-group:last-child { border-right: none; }
.ms-tb-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px; border-radius: 6px; min-width: 34px; min-height: 34px; justify-content: center; }
.ms-tb-btn.is-active { background: var(--interactive-accent) !important; color: var(--text-on-accent) !important; }
.ms-tb-btn.is-hidden { display: none; }
.ms-tb-text { font-size: var(--font-ui-small); }
.ms-swatch { width: 26px; height: 26px; min-width: 26px; padding: 0; border-radius: 50%; background: var(--sw) !important; border: 2px solid var(--background-primary); box-shadow: 0 0 0 1px var(--background-modifier-border); margin: 0 2px; }
.ms-swatch.is-active { box-shadow: 0 0 0 2px var(--ms-accent); }
.ms-size { width: 30px; height: 30px; min-width: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent !important; box-shadow: none !important; border-radius: 6px; }
.ms-size span { display: block; border-radius: 50%; background: var(--text-muted); }
.ms-size.is-active { background: var(--background-modifier-hover) !important; }
.ms-size.is-active span { background: var(--text-normal); }
.is-mobile .ms-tb-btn { min-width: 40px; min-height: 40px; }
.is-mobile .ms-swatch { width: 30px; height: 30px; }

/* ---------- embeds (notes & Canvas) ---------- */
.ms-embed { position: relative; display: flex; flex-direction: column; height: 420px; border: 1px solid var(--background-modifier-border); border-radius: 8px; overflow: hidden; background: var(--background-primary); }
.canvas-node-content .ms-embed, .canvas-node .ms-embed { height: 100%; border: none; border-radius: 0; }
.ms-embed .ms-toolbar { padding: 4px; gap: 4px; }
.ms-embed .ms-tb-btn { min-width: 30px; min-height: 30px; padding: 4px; }
.ms-embed .ms-swatch { width: 22px; height: 22px; min-width: 22px; }
.ms-embed-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; font-size: var(--font-ui-small); color: var(--text-muted); background: var(--background-secondary); border-bottom: 1px solid var(--background-modifier-border); }
.ms-sheet-embed { height: auto; max-height: 420px; }
.ms-sheet-embed .ms-grid-wrap { overflow: auto; }
.ms-slides-embed { height: auto; }
.ms-slides-embed-box { position: relative; width: 100%; display: flex; aspect-ratio: var(--ms-aspect, 16 / 9); }
.ms-slides-embed-box .ms-board, .ms-thumb-box .ms-board { position: absolute; inset: 0; }

/* ---------- slides ---------- */
.ms-slides { flex-direction: row !important; }
.ms-slide-side { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--background-modifier-border); background: var(--background-secondary); }
.ms-slide-sidebar-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--background-modifier-border); }
.ms-slide-sidebar-bar .mod-cta { background: var(--interactive-accent); color: var(--text-on-accent); }
.ms-slide-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 10px; outline: none; }
.ms-thumb { display: flex; gap: 6px; cursor: pointer; align-items: flex-start; }
.ms-thumb-num { font-size: var(--font-ui-smaller); color: var(--text-muted); width: 16px; text-align: right; padding-top: 2px; }
.ms-thumb-box { position: relative; flex: 1; aspect-ratio: var(--ms-aspect, 16 / 9); border-radius: 4px; overflow: hidden; border: 2px solid transparent; background: var(--background-primary); }
.ms-thumb.is-active .ms-thumb-box { border-color: var(--interactive-accent); }
.ms-slide-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ms-slide-board { flex: 1; min-height: 0; display: flex; }
.ms-slide-notes { flex-shrink: 0; margin: 0; border-radius: 0; border: none; border-top: 1px solid var(--background-modifier-border); resize: vertical; min-height: 44px; padding: 8px 12px; font-size: var(--font-ui-small); background: var(--background-secondary); }
.is-phone .ms-slides { flex-direction: column-reverse !important; }
.is-phone .ms-slide-side { width: 100%; height: 130px; border-right: none; border-top: 1px solid var(--background-modifier-border); flex-direction: row; }
.is-phone .ms-slide-list { flex-direction: row; overflow-x: auto; }
.is-phone .ms-thumb { width: 140px; flex-shrink: 0; }
.is-phone .ms-slide-sidebar-bar { flex-direction: column; border-bottom: none; }

.ms-present { position: fixed; inset: 0; z-index: var(--layer-modal, 50); background: #000; display: flex; align-items: center; justify-content: center; }
.ms-present-stage { position: absolute; inset: 0; display: flex; }
.ms-present-stage .ms-board, .ms-present-stage .ms-viewport { background: #000 !important; }
.ms-present-stage .ms-frame { box-shadow: none; }
.ms-present-bar { position: absolute; bottom: 14px; right: 14px; display: flex; gap: 6px; align-items: center; padding: 4px 8px; border-radius: 20px; background: rgba(40,40,40,.75); color: #fff; opacity: .25; transition: opacity .2s; z-index: 2; }
.ms-present-bar:hover { opacity: 1; }
.is-mobile .ms-present-bar { opacity: .8; }
.ms-present-bar button { color: #fff; }
.ms-present-count { font-size: 13px; min-width: 50px; text-align: center; }

/* ---------- spreadsheet ---------- */
.ms-sheet-toolbar { display: flex; gap: 2px; padding: 6px 8px; overflow-x: auto; flex-shrink: 0; background: var(--background-secondary); border-bottom: 1px solid var(--background-modifier-border); }
.ms-formula-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-bottom: 1px solid var(--background-modifier-border); flex-shrink: 0; }
.ms-ref-label { min-width: 64px; font-family: var(--font-monospace); font-size: var(--font-ui-small); color: var(--text-muted); }
.ms-fx { font-style: italic; color: var(--text-faint); font-family: serif; }
.ms-fbar { flex: 1; font-family: var(--font-monospace); }
.ms-grid-wrap { flex: 1; overflow: auto; outline: none; min-height: 0; -webkit-overflow-scrolling: touch; }
.ms-grid { border-collapse: separate; border-spacing: 0; font-size: var(--font-ui-small); table-layout: fixed; margin: 0; }
.ms-grid th, .ms-grid td { border-right: 1px solid var(--background-modifier-border); border-bottom: 1px solid var(--background-modifier-border); height: var(--rh, 28px); padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-grid td { position: relative; cursor: cell; background: var(--background-primary); }
.ms-grid th { background: var(--background-secondary); color: var(--text-muted); font-weight: 500; text-align: center; position: sticky; z-index: 1; user-select: none; }
.ms-grid thead th { top: 0; z-index: 2; }
.ms-grid tbody th { left: 0; min-width: 44px; }
.ms-grid thead th.ms-corner { left: 0; z-index: 3; }
.ms-grid th.is-hl { background: var(--background-modifier-hover); color: var(--text-normal); }
.ms-grid td.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.ms-grid td.is-err { color: var(--text-error); }
.ms-grid td.is-selected { box-shadow: inset 0 0 0 100px color-mix(in srgb, var(--interactive-accent) 14%, transparent); }
.ms-grid td.is-cursor { box-shadow: inset 0 0 0 2px var(--interactive-accent), inset 0 0 0 100px color-mix(in srgb, var(--interactive-accent) 8%, transparent); }
.ms-grid td.is-fill-preview { box-shadow: inset 0 0 0 1px var(--interactive-accent), inset 0 0 0 100px color-mix(in srgb, var(--interactive-accent) 10%, transparent); }
.ms-cell-edit { position: absolute; inset: 0; width: 100%; height: 100%; border: none !important; border-radius: 0 !important; box-shadow: inset 0 0 0 2px var(--interactive-accent) !important; padding: 0 6px; font-size: inherit; font-family: var(--font-monospace); background: var(--background-primary); z-index: 1; }
.ms-sheet-tabs { display: flex; gap: 2px; padding: 4px 8px; border-top: 1px solid var(--background-modifier-border); background: var(--background-secondary); overflow-x: auto; flex-shrink: 0; }
.ms-sheet-tab { padding: 4px 12px; font-size: var(--font-ui-small); background: transparent; box-shadow: none; border-radius: 4px; }
.ms-sheet-tab.is-active { background: var(--background-primary); box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 600; }
.ms-sheet-error { padding: 2em; color: var(--text-muted); }
.ms-fn-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.ms-fn-row { display: flex; gap: 12px; justify-content: flex-start; text-align: left; height: auto; padding: 6px 10px; background: transparent; box-shadow: none; }
.ms-fn-row:hover { background: var(--background-modifier-hover); }
.ms-fn-name { font-family: var(--font-monospace); font-weight: 600; min-width: 90px; }
.ms-fn-help { color: var(--text-muted); }

/* ---------- maths palette & suggest ---------- */
.ms-palette-modal { width: min(720px, 94vw); }
.ms-palette-search { width: 100%; margin-bottom: 8px; }
.ms-palette-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.ms-palette-tabs.is-hidden { display: none; }
.ms-palette-tab { display: inline-flex; gap: 4px; align-items: center; font-size: var(--font-ui-small); padding: 4px 10px; }
.ms-palette-tab.is-active { background: var(--interactive-accent); color: var(--text-on-accent); }
.ms-palette-tab svg { width: 14px; height: 14px; }
.ms-palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 55vh; overflow-y: auto; padding: 2px; }
.ms-palette-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 72px; padding: 4px; overflow: hidden; }
.ms-palette-btn.is-first { box-shadow: 0 0 0 2px var(--interactive-accent); }
.ms-palette-tex { font-size: 1.1em; max-width: 100%; overflow: hidden; }
.ms-palette-tex mjx-container { margin: 0 !important; }
.ms-palette-name { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ms-palette-tips { margin-top: 8px; font-size: var(--font-ui-smaller); color: var(--text-faint); }
.ms-suggest { display: flex; align-items: center; gap: 12px; }
.ms-suggest-tex { min-width: 60px; text-align: center; }
.ms-suggest-tex mjx-container { margin: 0 !important; }
.ms-suggest-name { color: var(--text-muted); font-size: var(--font-ui-small); }

/* graph editor */
.ms-graph-input { width: 100%; font-family: var(--font-monospace); margin: 8px 0 4px; }
.ms-graph-status { color: var(--text-error); font-size: var(--font-ui-small); min-height: 1.2em; }
.ms-graph-quick { display: flex; gap: 4px; flex-wrap: wrap; }
.ms-graph-quick button { padding: 4px 10px; }
.ms-graph-modal .ms-num { width: 64px; }

/* status bar (bottom row on Mac) */
.ms-statusbar { display: inline-flex; gap: 2px; padding: 0 !important; }
.ms-sb-btn { display: inline-flex; align-items: center; padding: 2px 4px; border-radius: 4px; cursor: pointer; color: var(--text-muted); }
.ms-sb-btn:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.ms-sb-btn svg { width: 14px; height: 14px; }

/* settings */
.ms-keys table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.ms-keys td { padding: 4px 6px; border-bottom: 1px solid var(--background-modifier-border); font-size: var(--font-ui-small); }
.ms-keys td:last-child { text-align: right; }

/* Canvas: let the Pencil draw straight onto a drawing card (drag the card by its title) */
body.bb-canvas-draw .canvas-node:has(.ms-embed) .canvas-node-content-blocker { display: none; }

/* slide layout picker */
.ms-layout-modal { width: min(900px, 94vw); }
.ms-layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; max-height: 70vh; overflow-y: auto; padding: 2px; }
.ms-layout-card { display: flex; flex-direction: column; gap: 6px; height: auto; padding: 8px; align-items: stretch; }
.ms-layout-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: var(--background-primary); border: 1px solid var(--background-modifier-border); pointer-events: none; }
.ms-layout-preview .ms-board { position: absolute; inset: 0; }
.ms-layout-name { font-size: var(--font-ui-small); text-align: center; }

/* row / column resizing */
.ms-col-resize { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 4; touch-action: none; }
.ms-row-resize { position: absolute; left: 0; bottom: -4px; height: 9px; width: 100%; cursor: row-resize; z-index: 4; touch-action: none; }
.ms-col-resize:hover, .ms-row-resize:hover, .ms-resizing-col .ms-col-resize:active, .ms-resizing-row .ms-row-resize:active { background: color-mix(in srgb, var(--interactive-accent) 60%, transparent); }
.is-mobile .ms-col-resize { width: 16px; right: -8px; }
.is-mobile .ms-row-resize { height: 16px; bottom: -8px; }
body.ms-resizing-col, body.ms-resizing-col * { cursor: col-resize !important; }
body.ms-resizing-row, body.ms-resizing-row * { cursor: row-resize !important; }
.ms-sheet { position: relative; }

/* formula suggestions */
.ms-fn-suggest { position: absolute; z-index: 20; min-width: 260px; max-width: 420px; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 8px; box-shadow: var(--shadow-l); padding: 4px; }
.ms-fn-suggest-row { display: flex; gap: 10px; padding: 5px 8px; border-radius: 5px; cursor: pointer; font-size: var(--font-ui-small); }
.ms-fn-suggest-row.is-selected, .ms-fn-suggest-row:hover { background: var(--background-modifier-hover); }
.ms-fn-suggest-row .ms-fn-name { min-width: 80px; }

/* lasso, snap and trace */
.ms-board[data-tool="lasso"] .ms-viewport, .ms-board[data-tool="trace"] .ms-viewport { cursor: crosshair; }
.ms-lasso-line { fill: color-mix(in srgb, var(--ms-accent) 10%, transparent); stroke: var(--ms-accent); stroke-width: 1.6; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ms-sel-group { position: absolute; border: calc(1.5px / var(--ms-z, 1)) dashed var(--ms-accent); border-radius: calc(4px / var(--ms-z, 1)); margin: calc(-6px / var(--ms-z, 1)); padding: calc(6px / var(--ms-z, 1)); box-sizing: content-box; background: color-mix(in srgb, var(--ms-accent) 5%, transparent); }
.ms-board.is-snapped .ms-viewport { animation: ms-snap .22s ease-out; }
@keyframes ms-snap { 0% { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--interactive-accent) 70%, transparent); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.ms-trace { position: absolute; pointer-events: none; }
.ms-trace svg { position: absolute; left: 0; top: 0; overflow: visible; }
.ms-trace-line { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.ms-trace-dot { stroke: var(--background-primary); stroke-width: 2; }
.ms-trace-read { position: absolute; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 6px; padding: 4px 8px; font-size: 12px; font-family: var(--font-monospace); white-space: nowrap; box-shadow: var(--shadow-s); }
.ms-trace-x { color: var(--text-muted); }
.ms-graph-shade { fill-opacity: .16; stroke: none; }
.ms-graph-point { stroke: var(--background-primary); stroke-width: 2; }
.ms-graph-point-label { font-size: 11px; font-family: var(--font-interface); font-weight: 600; paint-order: stroke; stroke: var(--background-primary); stroke-width: 3px; }

/* drawing while presenting */
.ms-present-ink { position: absolute; inset: 0; z-index: 1; pointer-events: none; touch-action: none; }
.ms-present-ink.is-active { pointer-events: auto; }
.ms-present-ink[data-tool="pen"], .ms-present-ink[data-tool="highlighter"] { cursor: crosshair; }
.ms-present-ink[data-tool="laser"] { cursor: none; }
.ms-present-ink-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ms-present-ink-svg path.is-hl { mix-blend-mode: screen; opacity: .55; }
.ms-laser-trail { fill: none; stroke: #ff3b30; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .55; filter: blur(1px); }
.ms-laser { display: none; position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: radial-gradient(circle, #fff 0 18%, #ff3b30 30%, rgba(255,59,48,.45) 62%, transparent 72%); pointer-events: none; }
.ms-present.is-inking .ms-present-bar { opacity: .95; }
.ms-present-bar button.is-active { background: var(--interactive-accent); color: var(--text-on-accent); }
.ms-present-sep { width: 1px; height: 18px; background: rgba(255,255,255,.3); margin: 0 4px; }
.ms-present-swatches { display: inline-flex; gap: 4px; align-items: center; }
.ms-present-swatch { width: 20px; height: 20px; min-width: 20px; padding: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); box-shadow: none; }
.ms-present-swatch.is-active { border-color: #fff; }

/* spreadsheet: formatting, fill, charts */
.ms-tb-sep { width: 1px; align-self: stretch; margin: 4px 6px; background: var(--background-modifier-border); flex-shrink: 0; }
.ms-sheet-main { display: flex; flex: 1; min-height: 0; }
.ms-grid-wrap { position: relative; }
.ms-colour-pop { position: absolute; z-index: 30; display: flex; gap: 6px; padding: 8px; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 8px; box-shadow: var(--shadow-l); }
.ms-colour-sw { width: 26px; height: 26px; min-width: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--background-primary); box-shadow: 0 0 0 1px var(--background-modifier-border); }
.ms-colour-sw.is-none { background: linear-gradient(to top right, transparent 45%, var(--text-error) 45% 55%, transparent 55%), var(--background-primary); }
.is-mobile .ms-colour-sw { width: 34px; height: 34px; }
.ms-fill-handle { position: absolute; z-index: 5; width: 11px; height: 11px; background: var(--interactive-accent); border: 2px solid var(--background-primary); border-radius: 2px; cursor: crosshair; touch-action: none; }
.ms-fill-handle.is-hidden { display: none; }
.is-mobile .ms-fill-handle { width: 20px; height: 20px; margin: -5px 0 0 -5px; border-radius: 50%; }
.ms-charts { display: none; width: 440px; flex: none; overflow-y: auto; padding: 10px; flex-direction: column; gap: 12px; border-left: 1px solid var(--background-modifier-border); background: var(--background-secondary); }
.ms-charts.is-open { display: flex; }
.ms-charts-empty { color: var(--text-muted); padding: 16px 4px; font-size: var(--font-ui-small); }
.ms-chart-card { background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.ms-chart-head, .ms-chart-row { display: flex; gap: 6px; align-items: center; }
.ms-chart-title { flex: 1; min-width: 0; font-weight: 600; }
.ms-chart-range { width: 90px; font-family: var(--font-monospace); }
.ms-chart-row > span { color: var(--text-muted); font-size: var(--font-ui-small); }
.ms-chart-btn { font-size: var(--font-ui-smaller); padding: 2px 8px; height: auto; }
.ms-chart-svg svg { width: 100%; height: auto; display: block; border-radius: 6px; }
@media (max-width: 900px) {
	.ms-sheet-main { flex-direction: column; }
	.ms-charts { width: auto; max-height: 58%; border-left: none; border-top: 1px solid var(--background-modifier-border); }
}

/* symbols menu in the left sidebar */
.bb-symbols { padding: 8px !important; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.bb-symbols-search { width: 100%; }
.bb-symbols-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.bb-symbols-tabs.is-hidden { display: none; }
.bb-symbols-tab { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; height: auto; font-size: var(--font-ui-smaller); }
.bb-symbols-tab.is-active { background: var(--interactive-accent); color: var(--text-on-accent); }
.bb-symbols-tab svg { width: 13px; height: 13px; }
.bb-symbols-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.bb-symbol { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 62px; padding: 3px; overflow: hidden; }
.bb-symbol-tex { max-width: 100%; overflow: hidden; }
.bb-symbol-tex mjx-container { margin: 0 !important; }
.bb-symbol-name { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bb-symbols-tip, .bb-symbols-empty { font-size: var(--font-ui-smaller); color: var(--text-faint); }
.is-mobile .bb-symbol { height: 72px; }

/* fraction box */
.bb-frac-modal { width: min(360px, 94vw); }
.bb-frac { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; }
.bb-frac-input { width: 70%; text-align: center; font-size: 1.15em; }
.bb-frac-bar { width: 70%; height: 3px; border-radius: 2px; background: var(--text-muted); }
.bb-frac-preview { text-align: center; min-height: 2.4em; margin: 6px 0; }
.bb-frac-actions { display: flex; justify-content: center; }
.bb-frac-tip { text-align: center; margin-top: 8px; }

/* chart you type the numbers into */
.ms-chartel { position: absolute; pointer-events: none; }
.ms-chartel svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bb-chart-modal { width: min(560px, 96vw); }
.bb-chart-modal .modal-content { display: flex; flex-direction: column; gap: 10px; }
.bb-chart-title { width: 100%; font-weight: 600; }
.bb-chart-kinds { display: flex; gap: 6px; }
.bb-chart-kind { flex: 1; }
.bb-chart-kind.is-active { background: var(--interactive-accent); color: var(--text-on-accent); }
.bb-chart-count { display: flex; align-items: center; gap: 8px; }
.bb-chart-count-label { flex: 1; font-weight: 600; }
.bb-chart-step { width: 34px; height: 34px; padding: 0; font-size: 1.3em; line-height: 1; }
.bb-chart-count-input { width: 64px; text-align: center; }
.bb-chart-table { display: flex; flex-direction: column; gap: 4px; max-height: 30vh; overflow-y: auto; padding: 2px; }
.bb-chart-row { display: flex; gap: 6px; align-items: center; }
.bb-chart-row.is-head { color: var(--text-muted); font-size: var(--font-ui-smaller); position: sticky; top: 0; background: var(--modal-background, var(--background-primary)); z-index: 1; }
.bb-chart-num { width: 22px; text-align: right; color: var(--text-faint); font-size: var(--font-ui-smaller); flex-shrink: 0; }
.bb-chart-cell { flex: 1; min-width: 0; }
.bb-chart-row input.bb-chart-cell { width: 100%; }
.bb-chart-serhead { display: flex; gap: 4px; align-items: center; }
.bb-chart-sername { width: 100%; font-size: var(--font-ui-smaller); }
.bb-chart-x { padding: 0 6px; height: 24px; background: transparent; box-shadow: none; color: var(--text-muted); }
.bb-chart-addset { align-self: flex-start; margin-top: 4px; font-size: var(--font-ui-small); }
.bb-chart-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 10px; border-radius: 8px; background: var(--background-secondary); }
.bb-chart-side.is-hidden, .bb-chart-labels.is-hidden { display: none; }
.bb-chart-side-title { font-weight: 600; width: 100%; }
.bb-chart-side-item { display: flex; align-items: center; gap: 6px; }
.bb-chart-side-item input { width: 90px; }
.bb-chart-side-tip { width: 100%; }
.bb-chart-labels { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-chart-label-item { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 140px; }
.bb-chart-label-item span { font-size: var(--font-ui-smaller); color: var(--text-muted); }
.bb-chart-preview { border: 1px solid var(--background-modifier-border); border-radius: 8px; overflow: hidden; background: var(--background-primary); }
.bb-chart-preview svg { width: 100%; height: auto; display: block; }
.bb-chart-error { color: var(--text-error); font-size: var(--font-ui-small); min-height: 1.2em; }
.bb-chart-actions { display: flex; justify-content: flex-end; gap: 8px; }
.is-mobile .bb-chart-table input, .is-mobile .bb-chart-side input { font-size: 16px; }


/* ---- layers ---- */
.ms-layers { position: absolute; top: 52px; right: 10px; z-index: 20; width: 280px; max-width: calc(100% - 20px); background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 10px; box-shadow: var(--shadow-l); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.ms-layers-head { display: flex; align-items: center; gap: 4px; font-weight: 600; padding: 2px 4px; }
.ms-layers-head > span { flex: 1; }
.ms-layer-row { display: flex; align-items: center; gap: 2px; padding: 2px 4px; border-radius: 6px; border: 1px solid transparent; }
.ms-layer-row.is-active { background: var(--background-modifier-hover); border-color: var(--interactive-accent); }
.ms-layer-row.is-off .ms-layer-name { opacity: .5; }
.ms-layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; padding: 6px 4px; }
.ms-layer-rename { flex: 1; min-width: 0; }
.ms-layer-count { color: var(--text-faint); font-size: var(--font-ui-smaller); min-width: 18px; text-align: right; }
.ms-layer-btn { width: 26px; height: 26px; padding: 0; }
.ms-layer-btn svg { width: 16px; height: 16px; }
.ms-layer-btn:disabled { opacity: .3; }
.ms-layers-foot { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ms-layers-foot button { font-size: var(--font-ui-smaller); }
.ms-layers-tip { color: var(--text-faint); font-size: var(--font-ui-smaller); padding: 2px 4px; }

/* ---- ruler and protractor ---- */
.ms-guide { position: absolute; z-index: 6; pointer-events: none; user-select: none; touch-action: none; }
.ms-guide-svg svg { display: block; overflow: visible; }
.ms-guide-body { fill: color-mix(in srgb, var(--interactive-accent) 10%, transparent); stroke: var(--interactive-accent); stroke-width: 1.5; pointer-events: all; cursor: grab; }
.ms-guide .tick { stroke: var(--text-muted); stroke-width: 1; }
.ms-guide text { fill: var(--text-muted); font-size: 11px; font-family: var(--font-interface); pointer-events: none; }
.ms-guide text.inner { fill: var(--text-faint); }
.ms-guide-handle { position: absolute; width: calc(30px / var(--ms-z, 1)); height: calc(30px / var(--ms-z, 1)); margin: calc(-15px / var(--ms-z, 1)) 0 0 calc(-15px / var(--ms-z, 1)); border-radius: 50%; background: var(--interactive-accent); border: calc(3px / var(--ms-z, 1)) solid var(--background-primary); box-sizing: border-box; pointer-events: auto; cursor: grab; touch-action: none; }
.ms-guide-close { position: absolute; width: calc(24px / var(--ms-z, 1)); height: calc(24px / var(--ms-z, 1)); margin: 0 0 0 calc(-12px / var(--ms-z, 1)); padding: 0; border-radius: 50%; pointer-events: auto; display: flex; align-items: center; justify-content: center; background: var(--background-primary); border: 1px solid var(--background-modifier-border); box-shadow: none; }
.ms-guide.is-ruler .ms-guide-close { margin-left: 0; }
.ms-guide-close svg { width: 60%; height: 60%; }
.ms-guide-label { position: absolute; transform: translateX(-50%); font-size: calc(12px / var(--ms-z, 1)); color: var(--text-muted); white-space: nowrap; pointer-events: none; }

/* ---- slide transitions and showing things one click at a time ---- */
@keyframes ms-tr-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ms-tr-in-right { from { opacity: 0; transform: translateX(8%); } to { opacity: 1; transform: none; } }
@keyframes ms-tr-in-left { from { opacity: 0; transform: translateX(-8%); } to { opacity: 1; transform: none; } }
@keyframes ms-tr-zoom { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
@keyframes ms-tr-rise { from { opacity: 0; transform: translateY(8%); } to { opacity: 1; transform: none; } }
.ms-board.ms-tr-fade { animation: ms-tr-fade .45s ease both; }
.ms-board.ms-tr-slide.is-fwd { animation: ms-tr-in-right .4s ease both; }
.ms-board.ms-tr-slide.is-back { animation: ms-tr-in-left .4s ease both; }
.ms-board.ms-tr-zoom { animation: ms-tr-zoom .4s ease both; }
.ms-board.ms-tr-rise { animation: ms-tr-rise .4s ease both; }
.ms-step-hidden { visibility: hidden !important; }
.ms-step-in { animation: ms-tr-fade .35s ease both; }
@media (prefers-reduced-motion: reduce) { .ms-board[class*="ms-tr-"], .ms-step-in { animation: none; } }

/* ---- faded answer suggestion ---- */
.bb-ghost { opacity: .45; pointer-events: none; }
.bb-ghost::after { content: "Tab"; margin-left: 6px; padding: 0 4px; font-size: .7em; border: 1px solid currentColor; border-radius: 4px; vertical-align: middle; }

/* ---- classes used instead of setting styles in code ---- */
.ms-world > .is-layer-hidden { display: none; }
.ms-world > .is-being-edited { visibility: hidden; }
.ms-guide.is-ruler .ms-guide-close { left: 6px; top: 6px; }
.ms-laser.is-on { display: block; }
col.ms-rowhead-col { width: 44px; }
.ms-svg .is-filled { fill-opacity: .15; }

/* ---- pictures in notes: wrap text around them, drag to move ---- */
.internal-embed.image-embed[alt~="left"], .internal-embed.image-embed[alt^="left|"], .internal-embed.image-embed[alt$="|left"], .internal-embed.image-embed[alt*="|left|"], .markdown-rendered img[alt~="left"], .markdown-rendered img[alt^="left|"], .markdown-rendered img[alt$="|left"], .markdown-rendered img[alt*="|left|"] { float: left; margin: 4px 18px 8px 0; max-width: 55%; }
.internal-embed.image-embed[alt~="right"], .internal-embed.image-embed[alt^="right|"], .internal-embed.image-embed[alt$="|right"], .internal-embed.image-embed[alt*="|right|"], .markdown-rendered img[alt~="right"], .markdown-rendered img[alt^="right|"], .markdown-rendered img[alt$="|right"], .markdown-rendered img[alt*="|right|"] { float: right; margin: 4px 0 8px 18px; max-width: 55%; }
.internal-embed.image-embed[alt~="center"], .internal-embed.image-embed[alt^="center|"], .internal-embed.image-embed[alt$="|center"], .internal-embed.image-embed[alt*="|center|"], .markdown-rendered img[alt~="center"], .markdown-rendered img[alt^="center|"], .markdown-rendered img[alt$="|center"], .markdown-rendered img[alt*="|center|"] { display: block; margin-left: auto; margin-right: auto; text-align: center; }
.markdown-rendered h1, .markdown-rendered h2, .markdown-rendered h3, .markdown-rendered hr { clear: both; }
.markdown-source-view.is-live-preview .internal-embed.image-embed { cursor: grab; }
.bb-img-dragging { opacity: .45; }
.bb-img-drop { position: fixed; height: 3px; border-radius: 2px; background: var(--interactive-accent); z-index: var(--layer-popover); pointer-events: none; }
.bb-img-bar { position: fixed; z-index: var(--layer-popover); display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 8px; box-shadow: var(--shadow-s); }
.bb-img-bar .is-active { background: var(--interactive-accent); color: var(--text-on-accent); }
.bb-img-tip { color: var(--text-faint); font-size: var(--font-ui-smaller); padding: 0 6px; white-space: nowrap; }

/* ---- citations tab ---- */
.bb-cite { padding: 16px 20px; }
.bb-cite-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bb-cite-top h2 { margin: 0; flex: 1; }
.bb-cite-body { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px; align-items: start; }
.is-mobile .bb-cite-body, .bb-cite-body:has(> :only-child) { grid-template-columns: 1fr; }
@media (max-width: 760px) { .bb-cite-body { grid-template-columns: 1fr; } }
.bb-cite-form { display: flex; flex-wrap: wrap; gap: 10px 12px; padding: 14px; border: 1px solid var(--background-modifier-border); border-radius: 10px; background: var(--background-secondary); }
.bb-cite-kinds { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.bb-cite-kinds button { font-size: var(--font-ui-small); }
.bb-cite-kinds button.is-active { background: var(--interactive-accent); color: var(--text-on-accent); }
.bb-cite-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; min-width: 0; }
.bb-cite-field.is-wide { flex-basis: 100%; }
.bb-cite-field label, .bb-cite-label { font-size: var(--font-ui-smaller); color: var(--text-muted); }
.bb-cite-field input, .bb-cite-field textarea, .bb-cite-field select { width: 100%; }
.bb-cite-field .bb-cite-check { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: var(--font-ui-small); color: var(--text-normal); }
.bb-cite-field .bb-cite-check input { width: var(--checkbox-size, 16px); height: var(--checkbox-size, 16px); flex: none; margin: 0; }
.bb-cite-urlrow { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
.bb-cite-urlrow button { flex-shrink: 0; }
.bb-cite-date { display: flex; gap: 6px; }
.bb-cite-date input { width: 80px; }
.bb-cite-label { width: 100%; margin-top: 4px; }
.bb-cite-preview { width: 100%; padding: 10px 12px; border-radius: 8px; background: var(--background-primary); border: 1px solid var(--background-modifier-border); line-height: 1.5; user-select: text; }
.bb-cite-actions { display: flex; gap: 8px; width: 100%; }
.bb-cite-listbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.bb-cite-listbar button { display: inline-flex; align-items: center; gap: 6px; }
.bb-cite-btn-icon { display: inline-flex; }
.bb-cite-btn-icon svg { width: 16px; height: 16px; }
.bb-cite-count { flex: 1; color: var(--text-muted); font-size: var(--font-ui-small); min-width: 140px; }
.bb-cite-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--background-modifier-border); }
.bb-cite-ref { padding-left: 2em; text-indent: -2em; line-height: 1.5; user-select: text; overflow-wrap: anywhere; }
.bb-cite-intext { grid-column: 1; color: var(--text-muted); font-size: var(--font-ui-smaller); margin-top: 4px; }
.bb-cite-tools { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 2px; align-items: flex-start; }
.bb-cite-empty, .bb-cite-faint { color: var(--text-faint); }

/* cloud sync: chosen folders and files sit under their heading */
.bb-sync-path { padding-left: var(--size-4-6); border-top: none; }
.bb-sync-path .setting-item-name { font-family: var(--font-monospace); font-size: var(--font-ui-small); }

/* citations: Source list picker and sync status */
.bb-cite-top { flex-wrap: wrap; }
.bb-cite-picker { display: flex; align-items: center; gap: 4px; }
.bb-cite-picker:empty { display: none; }
.bb-cite-pick { max-width: 220px; }
.bb-cite-sync { font-size: var(--font-ui-smaller); color: var(--text-muted); margin-left: 4px; }
.bb-cite-sync.is-offline { color: var(--text-error); }

/* shared spreadsheet links */
.bb-share-row .setting-item-name { word-break: break-all; font-size: var(--font-ui-small); }

/* sharing: boards and slides are drawn off screen to copy them for a share link */
.bb-share-capture { position: fixed; left: -30000px; top: 0; width: 1600px; height: 1200px; pointer-events: none; }
.bb-share-capture .ms-world.bb-capture-flat { transform: none !important; }

/* OneDrive connect errors */
.bb-od-error { color: var(--text-error); padding: 0 0 12px; }

/* cropped pictures: the picture sits in a frame and only the kept part shows (!important beats Obsidian's own picture styles) */
.internal-embed.image-embed.bb-cropped { display: inline-block !important; position: relative !important; overflow: hidden !important; width: var(--bb-w) !important; max-width: 100% !important; vertical-align: top; }
.internal-embed.image-embed.bb-cropped img { position: absolute !important; max-width: none !important; margin: 0 !important; width: calc(100% / var(--bb-cw)) !important; height: calc(100% / var(--bb-ch)) !important; left: calc(-100% * var(--bb-cl) / var(--bb-cw)) !important; top: calc(-100% * var(--bb-ct) / var(--bb-ch)) !important; }
/* crop on the page */
.bb-crop-live { position: fixed; z-index: var(--layer-popover); touch-action: none; user-select: none; }
.bb-crop-live > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.bb-crop-box { position: absolute; border: 2px solid var(--interactive-accent); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); cursor: move; box-sizing: border-box; }
.bb-crop-h { position: absolute; width: 20px; height: 20px; margin: -10px; background: var(--interactive-accent); border-radius: 50%; border: 2px solid var(--background-primary); box-sizing: border-box; }
.bb-crop-nw { left: 0; top: 0; cursor: nwse-resize; } .bb-crop-n { left: 50%; top: 0; cursor: ns-resize; } .bb-crop-ne { left: 100%; top: 0; cursor: nesw-resize; }
.bb-crop-e { left: 100%; top: 50%; cursor: ew-resize; } .bb-crop-se { left: 100%; top: 100%; cursor: nwse-resize; } .bb-crop-s { left: 50%; top: 100%; cursor: ns-resize; }
.bb-crop-sw { left: 0; top: 100%; cursor: nesw-resize; } .bb-crop-w { left: 0; top: 50%; cursor: ew-resize; }
.bb-crop-tools { position: absolute; top: calc(100% + 12px); right: 0; display: flex; gap: 6px; padding: 4px; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: 8px; box-shadow: var(--shadow-s); z-index: 2; }

/* Editor tab */
.bb-editor { padding: 12px 14px 32px; display: flex; flex-direction: column; gap: 14px; }
.bb-ed-file { font-weight: var(--font-semibold); font-size: var(--font-ui-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-ed-empty { color: var(--text-muted); padding: 24px 4px; }
.bb-ed-hero { display: flex; align-items: baseline; gap: 8px; }
.bb-ed-big { font-size: 44px; line-height: 1; font-weight: var(--font-bold); color: var(--text-normal); font-variant-numeric: tabular-nums; }
.bb-ed-bigl { color: var(--text-muted); font-size: var(--font-ui-medium); }
.bb-ed-goal { display: flex; flex-direction: column; gap: 6px; }
.bb-ed-goal-in { width: 100%; }
.bb-ed-goal-text, .bb-ed-muted { color: var(--text-muted); font-size: var(--font-ui-smaller); }
.bb-ed-bar, .bb-ed-meter { height: 8px; border-radius: 99px; background: var(--background-modifier-border); overflow: hidden; }
.bb-ed-bar-fill, .bb-ed-meter-fill { height: 100%; border-radius: 99px; background: var(--interactive-accent); transition: width .25s; }
.bb-ed-bar-fill.is-done, .bb-ed-meter-fill.is-good { background: var(--color-green); }
.bb-ed-meter-fill.is-ok { background: var(--color-orange); }
.bb-ed-meter-fill.is-hard { background: var(--color-red); }
.bb-ed-sel { display: none; padding: 8px 10px; border-radius: var(--radius-m); background: var(--background-modifier-hover); font-size: var(--font-ui-small); }
.bb-ed-sel.is-on { display: block; }
.bb-ed-sel-n { font-weight: var(--font-bold); color: var(--interactive-accent); }
.bb-ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bb-ed-card { padding: 10px; border-radius: var(--radius-m); background: var(--background-secondary-alt, var(--background-secondary)); border: 1px solid var(--background-modifier-border); }
.bb-ed-val { font-size: var(--font-ui-large); font-weight: var(--font-semibold); font-variant-numeric: tabular-nums; }
.bb-ed-lbl { color: var(--text-muted); font-size: var(--font-ui-smaller); }
.bb-ed-section { display: flex; flex-direction: column; gap: 8px; }
.bb-ed-title { font-size: var(--font-ui-smaller); text-transform: uppercase; letter-spacing: .06em; font-weight: var(--font-semibold); color: var(--text-muted); }
.bb-ed-ease-label { font-weight: var(--font-semibold); }
.bb-ed-ease-label.is-good { color: var(--color-green); } .bb-ed-ease-label.is-ok { color: var(--color-orange); } .bb-ed-ease-label.is-hard { color: var(--color-red); }
.bb-ed-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-ed-chip { padding: 2px 10px; border-radius: 99px; background: var(--background-modifier-hover); font-size: var(--font-ui-smaller); }
.bb-ed-spell-head { display: flex; align-items: center; gap: 8px; }
.bb-ed-spell-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bb-ed-spell-tools select { max-width: 150px; }
.bb-ed-badge { min-width: 22px; padding: 0 7px; text-align: center; border-radius: 99px; font-size: var(--font-ui-smaller); font-weight: var(--font-bold); color: var(--text-on-accent); }
.bb-ed-badge.is-warn { background: var(--color-red); } .bb-ed-badge.is-ok { background: var(--color-green); }
.bb-ed-good { color: var(--color-green); }
.bb-ed-error { color: var(--text-error); }
.bb-ed-miss { padding: 8px 10px; border-radius: var(--radius-m); border: 1px solid var(--background-modifier-border); display: flex; flex-direction: column; gap: 6px; }
.bb-ed-miss-top { display: flex; align-items: center; gap: 6px; }
.bb-ed-word { all: unset; cursor: pointer; font-weight: var(--font-semibold); color: var(--text-error); text-decoration: underline wavy; text-underline-offset: 3px; }
.bb-ed-count { color: var(--text-muted); font-size: var(--font-ui-smaller); }
.bb-ed-acts { margin-left: auto; display: flex; }
.bb-ed-sugs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bb-ed-sug { height: auto; padding: 2px 10px; border-radius: 99px; font-size: var(--font-ui-small); background: var(--interactive-accent); color: var(--text-on-accent); box-shadow: none; }
.bb-ed-sug:hover { filter: brightness(1.1); }
.bb-ed-all { margin-left: 2px; }
.bb-ed-link { all: unset; cursor: pointer; color: var(--text-muted); font-size: var(--font-ui-smaller); text-decoration: underline; }

/* File history */
.bb-hist { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.bb-hist-head { display: flex; align-items: center; gap: 10px; }
.bb-hist-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bb-hist-file { font-weight: var(--font-semibold); font-size: var(--font-ui-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-hist-path { color: var(--text-faint); font-size: var(--font-ui-smaller); }
.bb-hist-empty { color: var(--text-muted); padding: 28px 8px; max-width: 520px; }
.bb-hist-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; }
@media (max-width: 700px) { .bb-hist-body { grid-template-columns: 1fr; } }
.bb-hist-left, .bb-hist-detail { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.bb-hist-zoom { display: flex; flex-wrap: wrap; gap: 4px; }
.bb-hist-zoom button, .bb-hist-tabs button { height: auto; padding: 3px 10px; font-size: var(--font-ui-small); }
.bb-hist-zoom .is-active, .bb-hist-tabs .is-active { background: var(--interactive-accent); color: var(--text-on-accent); }
.bb-hist-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--text-muted); font-size: var(--font-ui-smaller); }
.bb-hist-crumb { all: unset; cursor: pointer; text-decoration: underline; }
.bb-hist-sum { color: var(--text-muted); font-size: var(--font-ui-smaller); }
.bb-hist-list { display: flex; flex-direction: column; gap: 4px; }
.bb-hist-row { position: relative; padding: 8px 36px 10px 10px; border-radius: var(--radius-m); border: 1px solid var(--background-modifier-border); cursor: pointer; }
.bb-hist-row:hover { background: var(--background-modifier-hover); }
.bb-hist-row.is-sel { border-color: var(--interactive-accent); background: var(--background-modifier-hover); }
.bb-hist-label { font-weight: var(--font-semibold); }
.bb-hist-sub { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--font-ui-smaller); color: var(--text-muted); }
.bb-hist-add { color: var(--color-green); } .bb-hist-del { color: var(--color-red); }
.bb-hist-bar { position: absolute; left: 10px; right: 36px; bottom: 4px; height: 3px; border-radius: 99px; background: var(--background-modifier-border); }
.bb-hist-bar-fill { height: 100%; border-radius: 99px; background: var(--interactive-accent); }
.bb-hist-dive { position: absolute; right: 4px; top: 6px; }
.bb-hist-dtitle { font-size: var(--font-ui-large); font-weight: var(--font-semibold); }
.bb-hist-stats { display: flex; flex-wrap: wrap; gap: 10px; font-size: var(--font-ui-small); color: var(--text-muted); }
.bb-hist-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-hist-tabs { display: flex; gap: 4px; }
.bb-hist-diff { border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); padding: 6px 0; overflow: auto; font-family: var(--font-monospace); font-size: var(--font-ui-small); }
.bb-hist-line { display: flex; gap: 8px; padding: 1px 10px; white-space: pre-wrap; word-break: break-word; }
.bb-hist-line.is-add { background: rgba(var(--color-green-rgb, 8, 185, 78), .15); }
.bb-hist-line.is-del { background: rgba(var(--color-red-rgb, 233, 49, 71), .15); }
.bb-hist-sign { flex: none; width: 1ch; color: var(--text-muted); }
.bb-hist-hl { background: rgba(var(--color-yellow-rgb, 224, 172, 0), .4); border-radius: 2px; }
.bb-hist-skip { padding: 2px 10px; color: var(--text-faint); font-size: var(--font-ui-smaller); }
.bb-hist-pre { margin: 0; padding: 6px 10px; white-space: pre-wrap; word-break: break-word; font-family: var(--font-monospace); }
