/* 智能黑板 — full-screen board. Flat UI: white cards with hairlines, a black tool dock, ink colours as the only colour. */
:root {
  --ink: #151618; --paper: #fff; --line: #dcdde1; --line-soft: #eceef0; --muted: #6b6e75; --dock: #121314; --accent: #1f5bff; --cut: #ff6a3d;
  --font: system-ui, -apple-system, "PingFang HK", "Noto Sans HK", "Microsoft JhengHei", sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(17, 18, 20, .06), 0 10px 28px rgba(17, 18, 20, .09);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fbfbf9; overscroll-behavior: none; }
body { font: 15px/1.45 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .32; cursor: default; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wb-noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; }

#wb { position: fixed; inset: 0; user-select: none; -webkit-user-select: none; touch-action: none; }
.wb-stage { position: absolute; inset: 0; overflow: hidden; cursor: crosshair; }
#wb[data-tool=select] .wb-stage { cursor: default; }
#wb[data-tool=eraser] .wb-stage { cursor: none; }
#wb[data-tool=text] .wb-stage { cursor: text; }
#wb[data-tool=laser] .wb-stage { cursor: none; }
#wb.is-pan .wb-stage { cursor: grab; }
.wb-ink, .wb-live { position: absolute; left: 0; top: 0; }
.wb-live { pointer-events: none; }
.wb-live.snap { animation: wb-snap .35s ease-out; }
@keyframes wb-snap { 0% { filter: none; } 40% { opacity: .55; } 100% { opacity: 1; } }
.wb-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; pointer-events: none; }
.wb-world > * { pointer-events: auto; }
.wb-hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.wb-hud > * { position: absolute; left: 0; top: 0; }

/* ---------- top bar ---------- */
.wb-top { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: center; gap: 10px; z-index: 20; pointer-events: none; }
.wb-top > * { pointer-events: auto; }
.wb-brand, .wb-pages, .wb-actions { display: flex; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; height: 44px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.wb-brand { gap: 8px; padding: 0 16px 0 8px; text-decoration: none; color: var(--ink); white-space: nowrap; flex: none; }
.wb-brand svg { width: 18px; height: 18px; color: var(--muted); }
.wb-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.wb-brand b { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.wb-brand small { font-size: 11px; color: var(--muted); }
.wb-pages { margin: 0 auto; padding: 0 4px; gap: 2px; white-space: nowrap; flex: none; }
.wb-pageno { font-weight: 700; font-size: 13px; padding: 0 6px; min-width: 92px; text-align: center; font-variant-numeric: tabular-nums; }
.wb-pages button, .wb-actions > button { width: 36px; height: 36px; border: 0; background: none; border-radius: 999px; display: grid; place-items: center; }
.wb-pages button:hover:not(:disabled), .wb-actions > button:hover:not(:disabled) { background: #f1f2f4; }
.wb-actions { padding: 0 4px; gap: 2px; }
.wb-bgs { display: flex; gap: 4px; padding: 0 8px 0 6px; margin-right: 4px; border-right: 1px solid var(--line-soft); }
.wb-bgs button { width: 26px; height: 26px; border-radius: 999px; border: 2px solid transparent; padding: 2px; background: none; display: grid; }
.wb-bgs button.on { border-color: var(--ink); }
.wb-bgs i { border-radius: 999px; border: 1px solid #cfd1d5; display: block; }
.bg-plain { background: #fbfbf9; }
.bg-grid { background: #fff linear-gradient(#dfe1e5 1px, transparent 1px) 0 0 / 5px 5px, #fff; background-image: linear-gradient(#dfe1e5 1px, transparent 1px), linear-gradient(90deg, #dfe1e5 1px, transparent 1px); background-size: 5px 5px; }
.bg-dots { background: #fff radial-gradient(#9da1a8 1px, transparent 1.2px) 0 0 / 5px 5px; }
.bg-dark { background: #1d1f22; border-color: #1d1f22 !important; }
.bg-green { background: #21412f; border-color: #21412f !important; }
.wb-status { font-size: 12px; font-weight: 700; padding: 4px 10px; margin: 0 6px; border-radius: 999px; background: #f1f2f4; color: var(--muted); white-space: nowrap; }
.wb-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 99px; margin-right: 6px; background: #c2c5cb; vertical-align: 1px; }
.wb-status[data-s=loading]::before { background: #f08c00; animation: wb-blink 1s infinite; }
.wb-status[data-s=ready]::before { background: #12a150; }
.wb-status[data-s=error]::before { background: #e5484d; }
@keyframes wb-blink { 50% { opacity: .25; } }

/* ---------- dock ---------- */
.wb-dock { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; background: var(--dock); color: #fff; border-radius: 999px; z-index: 20; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
.wb-dock::-webkit-scrollbar { display: none; }
.wb-tools { display: flex; gap: 2px; }
.wb-tools button { height: 48px; min-width: 52px; padding: 0 8px; border: 0; background: none; color: #d9dadd; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: background .15s, color .15s; }
.wb-tools button span { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; }
.wb-tools button:hover { background: #26282b; color: #fff; }
.wb-tools button.on { background: #fff; color: var(--ink); }
.wb-tools .wb-toggle.on { background: none; color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
.wb-sep { width: 1px; height: 30px; background: #33363a; flex: none; }
.wb-ink-opts { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.wb-dock.no-ink .wb-ink-opts { opacity: .45; }
.wb-colors, .wb-widths { display: flex; gap: 2px; }
.wb-colors button, .wb-widths button { width: 30px; height: 30px; border: 0; background: none; border-radius: 999px; display: grid; place-items: center; }
.wb-colors i { width: 18px; height: 18px; border-radius: 99px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
#wb .wb-colors [data-color=ink] i { background: #151618; box-shadow: inset 0 0 0 1.5px #8a8d93; }
#wb[data-bg=dark] .wb-colors [data-color=ink] i, #wb[data-bg=green] .wb-colors [data-color=ink] i { background: #f4f3ee; }
.wb-colors button.on { box-shadow: inset 0 0 0 2px #fff; }
.wb-color-add { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; color: #d9dadd; position: relative; box-shadow: inset 0 0 0 1.5px #4a4d52; }
.wb-color-add:hover { color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
.wb-color-add svg { width: 16px; height: 16px; }
.wb-color-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.wb-widths i { width: 20px; height: var(--w); max-height: 10px; min-height: 2px; border-radius: 9px; background: #d9dadd; }
.wb-widths button.on { background: #2b2d31; }
.wb-widths button.on i { background: #fff; }

.wb-zoom { position: absolute; right: 12px; bottom: 16px; display: flex; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; height: 40px; padding: 0 3px; z-index: 20; }
.wb-zoom button { height: 34px; min-width: 34px; border: 0; background: none; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.wb-zoom button:hover { background: #f1f2f4; }
.wb-zoom svg { width: 18px; height: 18px; }

/* dark boards: chrome stays light, only the canvas changes */
#wb[data-bg=dark] .wb-zoom, #wb[data-bg=green] .wb-zoom { border-color: transparent; }

/* ---------- toasts ---------- */
.wb-toasts { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 30; pointer-events: none; }
.wb-toast { background: var(--dock); color: #fff; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.wb-toast.in { opacity: 1; transform: none; }

/* ---------- suggestion frame and action bar ---------- */
.wb-suggest { position: absolute; pointer-events: none !important; border-radius: 10px; }
.wb-suggest::before { content: ""; position: absolute; inset: 0; border: 2px dashed var(--accent); border-radius: 10px; animation: wb-frame-in .35s ease-out both; }
.wb-suggest::after { content: ""; position: absolute; inset: 0; background: rgba(31, 91, 255, .05); border-radius: 10px; }
@keyframes wb-frame-in { from { transform: scale(1.06); opacity: 0; } to { transform: none; opacity: 1; } }
.wb-bar { pointer-events: auto; display: flex; align-items: center; gap: 4px; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; animation: wb-pop-in .22s ease-out both; }
@keyframes wb-pop-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.wb-bar-tex { padding: 2px 12px; font-size: 17px; max-width: 360px; overflow: hidden; }
.wb-bar-note { padding: 0 10px; font-size: 13px; color: var(--muted); }
.wb-bar-note b { color: var(--ink); margin-left: 3px; }
.wb-bar-btn { height: 34px; border: 0; background: #f1f2f4; border-radius: 999px; padding: 0 12px 0 9px; display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px; }
.wb-bar-btn:first-of-type { background: var(--ink); color: #fff; }
.wb-bar-btn:hover { filter: brightness(.95); }
.wb-bar-btn svg { width: 17px; height: 17px; }
.wb-bar-x { padding: 0; width: 34px; justify-content: center; background: none !important; color: var(--muted) !important; }
.wb-bar-more { display: flex; gap: 3px; padding: 0 2px; }
.wb-selbar .wb-bar-btn:first-of-type { background: #f1f2f4; color: var(--ink); }
.wb-sel { border: 1.5px dashed var(--ink); border-radius: 6px; pointer-events: none; }
#wb[data-bg=dark] .wb-sel, #wb[data-bg=green] .wb-sel { border-color: #fff; }
.wb-eraser { width: 24px; height: 24px; border-radius: 99px; border: 1.5px solid #8a8d93; background: rgba(255, 255, 255, .6); pointer-events: none; }

/* recognised maths frames on the board */
.wb-mframe { position: absolute; pointer-events: none !important; border: 1.5px solid rgba(31, 91, 255, .55); border-radius: 10px; }
.wb-mframe.is-new { animation: wb-frame-in .35s ease-out both; }
.wb-mtag { pointer-events: auto; position: absolute; left: -1px; bottom: calc(100% + 4px); max-width: 420px; overflow: hidden; border: 0; background: var(--accent); color: #fff; border-radius: 8px 8px 8px 2px; padding: 2px 9px; font-size: 13px; line-height: 1.6; white-space: nowrap; }
.wb-mtag .katex { font-size: 1em; }

/* ---------- cards ---------- */
.wb-card { position: absolute; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); user-select: text; -webkit-user-select: text; touch-action: auto; overflow: hidden; }
.wb-card.is-new { animation: wb-card-in .5s cubic-bezier(.2, .9, .25, 1.15) both; }
@keyframes wb-card-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.wb-card.is-drag { box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 22px 44px rgba(0, 0, 0, .16); }
.wb-card-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line-soft); cursor: grab; user-select: none; flex: none; touch-action: none; }
.wb-card-tag { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.wb-card-title { font-weight: 800; font-size: 14px; margin-right: auto; }
.wb-card-btns { display: flex; gap: 4px; }
.wb-x { width: 30px; height: 30px; border: 0; background: none; border-radius: 99px; display: grid; place-items: center; color: var(--muted); }
.wb-x:hover { background: #f1f2f4; color: var(--ink); }
.wb-x svg { width: 16px; height: 16px; }
.wb-card-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.wb-grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 55%, #c4c7cc 55%, #c4c7cc 62%, transparent 62%, transparent 72%, #c4c7cc 72%, #c4c7cc 79%, transparent 79%); }
.wb-chip { height: 30px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 0 11px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.wb-chip:hover { background: #f5f6f7; }
.wb-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.wb-chip svg { width: 15px; height: 15px; }
.wb-pill { height: 38px; border: 0; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 18px; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.wb-pill small { font-weight: 600; opacity: .6; font-variant-numeric: tabular-nums; }
.wb-pill:hover:not(:disabled) { background: #000; }
.wb-err { color: #c62f33; padding: 14px 16px; margin: 0; font-size: 14px; }
.wb-loading { display: grid; place-items: center; height: 100%; color: var(--muted); font-weight: 700; }

/* steps */
.wb-card-steps .wb-card-body { padding: 4px 0 0; overflow: visible; }
.wb-card-steps { overflow: visible; }
.wb-card-steps .wb-card-head { border-radius: var(--r) var(--r) 0 0; }
.wb-eq { padding: 6px 18px 10px; font-size: 19px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.wb-eq .katex-display { margin: .4em 0; text-align: left; }
.wb-eq .katex-display > .katex { text-align: left; }
.wb-steplist { list-style: none; counter-reset: s; margin: 0; padding: 8px 18px 4px 18px; }
.wb-steplist li { counter-increment: s; position: relative; padding: 9px 0 9px 34px; border-bottom: 1px dashed var(--line-soft); }
.wb-steplist li::before { content: counter(s); position: absolute; left: 0; top: 10px; width: 22px; height: 22px; border-radius: 99px; background: #f1f2f4; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; color: var(--muted); }
.wb-steplist li.is-in { animation: wb-step-in .4s ease-out both; }
@keyframes wb-step-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.wb-step-tex { font-size: 17px; overflow-x: auto; overflow-y: hidden; padding: 1px 0; }
.wb-steplist small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.wb-steps-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; }
.wb-answer { display: flex; align-items: center; gap: 12px; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 14px; font-size: 18px; animation: wb-step-in .4s ease-out both; }
.wb-answer small { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }

/* graph */
.wb-card-graph .wb-card-body { display: flex; overflow: hidden; }
.wb-graph { flex: 1; position: relative; min-width: 0; cursor: grab; touch-action: none; }
.wb-graph-canvas { position: absolute; inset: 0; display: block; }
.wb-graph-tip { position: absolute; transform: translate(10px, -130%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; pointer-events: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wb-graph-side { width: 260px; flex: none; border-left: 1px solid var(--line-soft); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.wb-explain { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.wb-explain .wb-seg button { flex: 1; }
.wb-explain-src { font-size: 16px; overflow-x: auto; overflow-y: hidden; }
.wb-explain p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.wb-explain p .katex { color: var(--ink); font-size: 1.05em; }
.wb-explain-ans { align-self: flex-start; border: 2px solid var(--ink); border-radius: 10px; padding: 3px 12px; font-size: 16px; }
.wb-fn { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 10px; border-left: 4px solid var(--c); background: #f7f8f9; border-radius: 4px 8px 8px 4px; }
.wb-fn-tex { flex: 1; font-size: 15px; overflow-x: auto; overflow-y: hidden; }
.wb-sliders { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.wb-slider { display: grid; grid-template-columns: 16px 1fr 34px; align-items: center; gap: 8px; font-size: 13px; }
.wb-slider i { font-family: "Times New Roman", serif; font-size: 17px; font-weight: 600; }
.wb-slider output { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.wb-seqtab { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; width: 100%; }
.wb-seqtab th, .wb-seqtab td { border-bottom: 1px solid var(--line-soft); padding: 3px 6px; text-align: right; }
.wb-seqtab th { font-size: 11px; color: var(--muted); }
.wb-keypts { display: flex; flex-wrap: wrap; gap: 5px; }
.wb-keypts small { width: 100%; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.wb-keypts > span { font-size: 13px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }
.wb-keypts > span.v { border-color: var(--ink); }
input[type=range] { accent-color: var(--ink); width: 100%; min-width: 0; }

/* solid */
.wb-solid-body { overflow: hidden; }
.wb-solid { display: flex; height: 100%; }
.wb-solid-view { flex: 1; position: relative; min-width: 0; background: #f4f5f7; touch-action: none; }
.wb-solid-view canvas { display: block; cursor: grab; }
.wb-solid-labels { position: absolute; inset: 0; pointer-events: none; }
.wb-dim { font: 700 13px/1 var(--font); background: var(--paper); border: 1px solid #c9ccd2; padding: 4px 7px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wb-solid-vbar { position: absolute; left: 10px; top: 10px; display: flex; gap: 5px; z-index: 2; }
.wb-solid-side { width: 300px; flex: none; border-left: 1px solid var(--line-soft); padding: 12px 14px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.wb-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }
.wb-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.wb-seg button { height: 28px; padding: 0 10px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.wb-seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.wb-dims { display: flex; flex-direction: column; gap: 6px; }
.wb-dimrow { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.wb-dimrow input[type=number], .wb-unit { height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: 700 13px var(--font); width: 100%; background: var(--paper); color: var(--ink); font-variant-numeric: tabular-nums; }
.wb-unitrow { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.wb-unitrow span { width: 64px; }
.wb-unitrow .wb-unit { width: auto; }
.wb-cutctl { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.wb-cutctl > label { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; }
.wb-cutctl [hidden] { display: none; }
.wb-switch { display: flex !important; gap: 8px; align-items: center; }
.wb-switch input { accent-color: var(--ink); width: 16px; height: 16px; }
.wb-results { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.wb-res { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; display: flex; flex-direction: column; gap: 1px; }
.wb-res small { font-size: 11px; font-weight: 700; color: var(--muted); }
.wb-res b { font-size: 16px; font-weight: 400; }
.wb-res.cut { grid-column: 1 / -1; border-color: var(--cut); background: #fff5f1; }
.wb-steps summary { font-size: 12px; font-weight: 800; color: var(--muted); cursor: pointer; padding: 4px 0; letter-spacing: .04em; }
.wb-steps ol { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.wb-steps li > div { overflow-x: auto; overflow-y: hidden; }
.wb-step-r { color: var(--ink); font-weight: 600; }

/* solids on the board: no window, just the model, a slim info card and handles when active */
.wb-bsolid-wrap { position: absolute; pointer-events: none !important; }
.wb-bsolid-wrap.is-new { animation: wb-card-in .5s cubic-bezier(.2, .9, .25, 1.15) both; }
.wb-bsolid-wrap.is-active::before { content: ""; position: absolute; inset: -6px; border: 1.5px dashed #9aa3b5; border-radius: 14px; pointer-events: none; }
.wb-bsolid-host { position: absolute; inset: 0; }
.wb-bsolid { position: relative; height: 100%; }
.wb-bview { position: absolute; inset: 0; }
.wb-bview canvas { display: block; }
.wb-bsolid[data-mode=cut] .wb-bview { cursor: crosshair; }
.wb-sinfo { pointer-events: auto; width: 228px; flex: none; align-self: center; max-height: 100%; overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; user-select: text; -webkit-user-select: text; touch-action: auto; color: var(--ink); }
.wb-bsolid.no-info .wb-sinfo { display: none; }
.wb-shead { display: flex; gap: 6px; }
.wb-shead .wb-unit { height: 32px; font-weight: 800; }
.wb-shead .wb-kindsel { flex: 1 1 auto; min-width: 0; width: auto; }
.wb-shead .wb-unitsel { flex: none; width: 74px; }
.wb-sdims { display: flex; flex-direction: column; gap: 5px; }
.wb-sdim { display: grid; grid-template-columns: 1fr 30px 58px 30px; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.wb-sdim input { height: 30px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font: 700 14px var(--font); width: 100%; background: var(--paper); color: var(--ink); font-variant-numeric: tabular-nums; }
.wb-step { height: 30px; border: 1px solid var(--line); background: #f5f6f7; border-radius: 8px; font-weight: 800; font-size: 16px; line-height: 1; }
.wb-step:active { background: #e8e9ec; }
.wb-sres { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.wb-res.water { border-color: #2f7cf6; background: #f0f6ff; }
.wb-sinfo .wb-steps ol { font-size: 12px; }
.wb-smove, .wb-bsolid-wrap > .wb-grip { display: none; pointer-events: auto; }
.wb-bsolid-wrap.is-active .wb-smove { display: flex; position: absolute; left: -6px; top: -40px; height: 30px; align-items: center; gap: 5px; padding: 0 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; cursor: grab; touch-action: none; user-select: none; }
.wb-smove svg { width: 15px; height: 15px; }
.wb-bsolid-wrap.is-active > .wb-grip { display: block; right: -6px; bottom: -6px; }
.wb-knife { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; opacity: 0; }
.wb-knife.on { opacity: 1; }
.wb-knife line { stroke: #e5484d; stroke-width: 3; stroke-dasharray: 10 6; stroke-linecap: round; animation: wb-knife 0.6s linear infinite; }
@keyframes wb-knife { to { stroke-dashoffset: -32; } }
.wb-piece-tag { font-size: 12px; }
.wb-piece-tag b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 11px; margin-right: 3px; }

.wb-kpt { font: 800 13px/1 var(--font); color: var(--ink); background: rgba(255, 255, 255, .92); border: 1.5px solid var(--ink); border-radius: 99px; min-width: 22px; height: 22px; padding: 0 5px; display: grid; place-items: center; transform: translateY(-14px); pointer-events: none; }
.wb-kpt-m { min-width: 10px; width: 10px; height: 10px; padding: 0; border-width: 1.5px; transform: none; background: #fff; }
.wb-kpt-m:not(:empty) { width: auto; min-width: 22px; height: 22px; padding: 0 5px; transform: translateY(-14px); }
.wb-kpt.on { background: #e5484d; border-color: #e5484d; color: #fff; }
.wb-kpt-c { border-style: dashed; }
.wb-angle-tag { border-color: #e5484d; color: #c62f33; font-size: 14px; }
.wb-res.angle { grid-column: 1 / -1; border-color: #e5484d; background: #fff4f4; }
.wb-sbar-ans { font-size: 16px; padding: 0 6px; color: #c62f33; }
.wb-sinv { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.wb-sinv input { accent-color: var(--ink); width: 16px; height: 16px; }
.wb-sbar-hint { max-width: 520px; }

/* the working written on the board beside a solid (ink colour, no card) */
.wb-writeup { position: absolute; left: calc(100% + 26px); top: 6px; width: 520px; pointer-events: none; color: #151618; font-size: 19px; line-height: 1.35; animation: wb-write-in .35s ease-out both; }
.wb-writeup[hidden] { display: none; }
@keyframes wb-write-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.wb-whead { font: 800 14px/1.2 var(--font); letter-spacing: .06em; color: #6b6e75; margin: 14px 0 4px; padding-bottom: 4px; border-bottom: 1.5px solid currentColor; display: inline-block; }
.wb-whead:first-child { margin-top: 0; }
.wb-wline { margin: 3px 0; white-space: normal; overflow-wrap: anywhere; }
.wb-wline.key { font-weight: 700; }
.wb-wline.key .katex { border-bottom: 2.5px solid #e5484d; padding-bottom: 1px; }
.wb-wline.is-in { animation: wb-step-in .35s ease-out both; }
.wb-wsec { margin-bottom: 4px; }
.wb-wctl { pointer-events: auto; display: flex; gap: 6px; margin: 4px 0 6px; }
.wb-wall { margin: 0 0 6px; }
.wb-wbtn { height: 26px; padding: 0 11px; border-radius: 999px; border: 1.5px solid currentColor; background: transparent; color: inherit; font: 700 12px var(--font); opacity: .75; cursor: pointer; }
.wb-wbtn:hover { opacity: 1; }
#wb[data-bg=dark] .wb-writeup, #wb[data-bg=green] .wb-writeup { color: #f4f3ee; }
#wb[data-bg=dark] .wb-whead, #wb[data-bg=green] .wb-whead { color: #b8bcc4; }
.wb-sbar-dims { display: flex; align-items: center; gap: 8px; padding: 6px 6px 2px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.wb-sbar-dims .wb-unit { height: 32px; width: auto; font-weight: 800; }
.wb-sbar-dims .wb-sdim { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; }
.wb-sbar-dims .wb-sdim > span { margin-right: 2px; color: var(--muted); }
.wb-sbar-dims .wb-sdim input { width: 54px; height: 30px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font: 700 14px var(--font); }
.wb-sbar-dims .wb-step { width: 28px; }

/* hand-drawn diagrams turned into live ones: no card, the size of the sketch */
.wb-blab-wrap { position: absolute; pointer-events: none !important; }
.wb-blab-wrap.is-new { animation: wb-snapin .45s ease-out both; }
@keyframes wb-snapin { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
.wb-blab-host { position: absolute; inset: 0; }
.wb-lab.is-board { height: 100%; position: relative; }
.wb-lab.is-board .wb-lab-view { position: absolute; inset: 0; }
.wb-blab-wrap.is-active::before { content: ""; position: absolute; inset: -6px; border: 1.5px dashed #9aa3b5; border-radius: 12px; pointer-events: none; }
.wb-blab-wrap.is-active .wb-smove { display: flex; position: absolute; left: -6px; top: -40px; height: 30px; align-items: center; gap: 5px; padding: 0 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; cursor: grab; touch-action: none; user-select: none; }
.wb-blab-wrap.is-active > .wb-grip { display: block; right: -6px; bottom: -6px; }
.wb-blab-wrap > .wb-grip { display: none; pointer-events: auto; }
.wb-blab-wrap > .wb-writeup { top: 0; }
#wb[data-bg=dark] .wb-blab-host canvas, #wb[data-bg=green] .wb-blab-host canvas { filter: invert(1) hue-rotate(180deg); }
.wb-labbar-title { font-size: 14px; font-weight: 800; padding: 0 10px 0 6px; white-space: nowrap; }
.wb-labbar .wb-sbar-hint { margin: 0 6px; }
.wb-labbar-panel { border-top: 1px solid var(--line-soft); padding: 6px 4px 2px; }
.wb-labbar .wb-lab-side { display: flex; flex-wrap: wrap; gap: 8px 16px; width: auto; max-width: 660px; border: 0; padding: 4px; overflow: visible; }
.wb-labbar .wb-lab-row { width: 200px; }
.wb-labbar .wb-lab-sum { display: none; }
.wb-toast-act { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.wb-toast-act button { border: 0; background: #fff; color: var(--ink); border-radius: 999px; height: 26px; padding: 0 12px; font-weight: 800; font-size: 12px; }
.wb-toasts { pointer-events: none; }
.wb-toasts .wb-toast-act { pointer-events: auto; }

/* the toolbar above an active solid */
.wb-sbar { flex-direction: column; align-items: stretch; border-radius: 18px; padding: 6px; gap: 4px; }
.wb-sbar[hidden] { display: none; }
.wb-sbar-row { display: flex; align-items: center; gap: 2px; }
.wb-sbtn { min-width: 54px; height: 50px; border: 0; background: none; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--ink); padding: 0 6px; }
.wb-sbtn:hover:not(:disabled) { background: #f1f2f4; }
.wb-sbtn.on { background: var(--ink); color: #fff; }
.wb-sbtn svg { width: 21px; height: 21px; }
.wb-sbar-sep { width: 1px; height: 30px; background: var(--line); margin: 0 4px; }
.wb-sbar-sub { display: flex; align-items: center; gap: 6px; padding: 6px 6px 2px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.wb-sbar-hint { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-right: auto; }
output.wb-sbar-hint { margin-right: 0; min-width: 36px; font-variant-numeric: tabular-nums; color: var(--ink); }
.wb-water-range { width: 140px; accent-color: #2f7cf6; }

/* radial menu: a dark ring of slices, same family as the dock */
.wb-radial { position: absolute; z-index: 60; pointer-events: none; animation: wb-radial-in .16s ease-out both; }
.wb-radial.out { animation: wb-radial-out .14s ease-in both; }
@keyframes wb-radial-in { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes wb-radial-out { to { opacity: 0; transform: scale(.9); } }
.wb-radial-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: none; }
.wb-radial-bg { fill: var(--dock); filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .28)); }
.wb-radial-slice { fill: #202226; pointer-events: auto; cursor: pointer; transition: fill .1s; }
.wb-radial-slice.is-hot { fill: #fff; }
.wb-radial-slice.is-off { fill: #1a1b1e; cursor: default; }
.wb-radial-label { position: absolute; width: 70px; margin: -27px 0 0 -35px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #e9eaec; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; pointer-events: auto; cursor: pointer; animation: wb-radial-label .2s ease-out both; }
@keyframes wb-radial-label { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.wb-radial-label svg { width: 22px; height: 22px; }
.wb-radial-label.is-hot { color: var(--ink); }
.wb-radial-label.is-off { opacity: .3; cursor: default; }
.wb-radial-more { position: absolute; right: 8px; top: 8px; width: 5px; height: 5px; border-radius: 9px; background: currentColor; opacity: .6; }
.wb-radial-sw { width: 22px; height: 22px; border-radius: 99px; background: var(--c); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); }
.wb-radial-center { pointer-events: auto; position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; border: 0; background: var(--dock); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 800; }
.wb-radial-center svg { width: 18px; height: 18px; }
.wb-radial-center:hover { background: #2a2c30; }

/* text on the board */
.wb-textcard { background: none; border: 0; box-shadow: none; border-radius: 4px; overflow: visible; padding: 0; }
.wb-text { min-width: 40px; padding: 4px 8px; outline: none; font-weight: 600; line-height: 1.3; white-space: pre-wrap; border: 1.5px dashed transparent; border-radius: 6px; }
.wb-text:focus { border-color: var(--accent); }
.wb-text-grab { position: absolute; left: -14px; top: 6px; width: 10px; height: 22px; border-radius: 4px; cursor: grab; opacity: 0; background: radial-gradient(#9da1a8 1.2px, transparent 1.4px) 0 0 / 5px 5px; transition: opacity .15s; }
.wb-textcard:hover .wb-text-grab { opacity: 1; }

/* subject switcher and tool cards */
.wb-subject { height: 44px; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-weight: 800; font-size: 14px; white-space: nowrap; flex: none; }
.wb-subject svg { width: 16px; height: 16px; color: var(--muted); }
.wb-subjects, .wb-kitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.wb-subjectbtn, .wb-kitbtn { text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .15s; }
.wb-subjectbtn:hover, .wb-kitbtn:hover { border-color: var(--ink); transform: translateY(-1px); }
.wb-subjectbtn.on { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.wb-subjectbtn b, .wb-kitbtn b { font-size: 15px; font-weight: 800; }
.wb-subjectbtn small, .wb-kitbtn small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.wb-kitbtn small { font-family: ui-monospace, Menlo, monospace; }
.wb-kitpop .wb-kitbtn small { font-family: inherit; }
.wb-lab-wrap { position: absolute; pointer-events: none !important; }
.wb-lab-wrap.is-new { animation: wb-card-in .5s cubic-bezier(.2, .9, .25, 1.15) both; }
.wb-card-lab { position: absolute; inset: 0; pointer-events: auto; }
.wb-lab-wrap > .wb-writeup { top: 0; }
.wb-lab { display: flex; height: 100%; }
.wb-lab-view { flex: 1; min-width: 0; position: relative; }
.wb-lab-view canvas { position: absolute; inset: 0; display: block; }
.wb-lab-side { width: 260px; flex: none; border-left: 1px solid var(--line-soft); padding: 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.wb-lab-row { display: flex; flex-direction: column; gap: 4px; }
.wb-lab-row[hidden] { display: none; }
.wb-lab-row > label { font-size: 12px; font-weight: 800; color: var(--muted); }
.wb-lab-num { display: grid; grid-template-columns: 1fr 62px auto; gap: 6px; align-items: center; }
.wb-lab-num input[type=number] { height: 28px; border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; font: 700 13px var(--font); width: 100%; }
.wb-lab-unit { font-size: 11.5px; color: var(--muted); min-width: 16px; }
.wb-lab-text { height: 34px; border: 1.5px solid var(--ink); border-radius: 9px; padding: 0 10px; font: 600 14px ui-monospace, Menlo, monospace; width: 100%; }
.wb-lab-ex { display: flex; flex-wrap: wrap; gap: 4px; }
.wb-lab-ex .wb-chip { height: 24px; font-size: 11px; padding: 0 8px; font-family: ui-monospace, Menlo, monospace; }
.wb-lab-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.wb-lab-side .wb-seg button { height: 26px; font-size: 11.5px; padding: 0 8px; }

/* ---------- popovers ---------- */
.wb-pop { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 40; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 170px); overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 6px rgba(0, 0, 0, .06), 0 24px 60px rgba(0, 0, 0, .18); padding: 18px 20px 18px; animation: wb-pop-in .22s ease-out both; user-select: text; touch-action: auto; }
.wb-pop h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.wb-pop > p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.wb-pop code { background: #f1f2f4; padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.wb-input { width: 100%; height: 48px; border: 1.5px solid var(--ink); border-radius: 12px; padding: 0 14px; font: 600 18px ui-monospace, "SF Mono", Menlo, monospace; outline: none; }
.wb-keys { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.wb-key { min-width: 42px; height: 36px; border: 1px solid var(--line); background: #f7f8f9; border-radius: 9px; font-weight: 700; padding: 0 10px; }
.wb-key:hover { background: #eceef0; }
.wb-preview { min-height: 56px; font-size: 20px; overflow-x: auto; padding: 4px 0; }
.wb-preview .katex-display { margin: .3em 0; text-align: left; }
.wb-preview .katex-display > .katex { text-align: left; }
.wb-preview-info { display: block; color: var(--muted); font-size: 12.5px; min-height: 18px; }
.wb-pop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.wb-pop-actions .wb-chip { height: 38px; padding: 0 16px; }
.wb-solidgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-bottom: 14px; }
.wb-solidbtn { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; transition: transform .15s, border-color .15s; }
.wb-solidbtn:hover { border-color: var(--ink); transform: translateY(-2px); }
.wb-solidbtn svg { width: 64px; height: 56px; stroke-width: 2; }
.wb-help ul { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.wb-help li { display: flex; gap: 12px; align-items: flex-start; }
.wb-help li > svg { width: 36px; height: 36px; padding: 8px; border-radius: 99px; background: #f1f2f4; flex: none; }
.wb-help li b { display: block; font-size: 14px; font-weight: 800; }
.wb-help li span { font-size: 13px; color: var(--muted); }
.wb-help-keys { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.wb-credits { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.wb-credits summary { cursor: pointer; font-weight: 700; }
.wb-credits p { margin: 6px 0 0; line-height: 1.6; }
.wb-help-note { font-size: 12px; color: var(--muted); margin: 0 0 14px; padding: 8px 10px; background: #f7f8f9; border-radius: 8px; }

@media (max-width: 1100px) { .wb-brand small { display: none; } .wb-pageno { min-width: 0; } }
@media (max-width: 760px) {
  .wb-top { flex-wrap: wrap; }
  .wb-brand b, .wb-bgs, .wb-status, .wb-actions [data-act=export], .wb-actions [data-act=help] { display: none; }
  .wb-brand { padding: 0 4px; }
  .wb-pages { margin: 0; }
  .wb-actions { margin-left: auto; }
  .wb-pageno { min-width: 0; }
  .wb-tools button { min-width: 44px; padding: 0 4px; }
  .wb-tools button span { display: none; }
  .wb-tools button { height: 42px; }
  .wb-zoom { display: none; }
  .wb-solid { flex-direction: column; }
  .wb-solid-side { width: auto; border-left: 0; border-top: 1px solid var(--line-soft); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media print { .wb-top, .wb-dock, .wb-zoom, .wb-hud { display: none; } }
