.ls-bf {
  --paper: #f6f9fb;
  --surface: #ffffff;
  --grid: #dde7ef;
  --grid-major: #b4c7d7;
  --axis: #3d4f60;
  --ink: #17232e;
  --muted: #586a7b;
  --dot: #17232e;
  --line: #1d5fc4;
  --mean: #c4610b;
  --resid: #c8364a;
  --good: #13866b;
  --chip: #eaf1f7;
  --focus: #1d5fc4;
  --f-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-math: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
.ls-bf, .ls-bf * { box-sizing: border-box; }
.ls-bf header { display: grid; gap: 4px; }
.ls-bf h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 4vw, 40px); margin: 0; letter-spacing: -0.02em; }
.ls-bf header p { margin: 0; color: var(--muted); max-width: 62ch; }
.ls-bf .main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) {
.ls-bf .main { grid-template-columns: minmax(0, 1fr); } }
.ls-bf .graph-col { display: grid; gap: 12px; min-width: 0; }
.ls-bf select, .ls-bf input, .ls-bf button, .ls-bf textarea { font: inherit; color: var(--ink); }
.ls-bf .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ls-bf .chip-btn { background: var(--chip); border: 1px solid transparent; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 14px; line-height: 1.3; }
.ls-bf .chip-btn:hover { border-color: var(--grid-major); }
.ls-bf :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ls-bf .board { position: relative; width: 100%; max-width: 640px; aspect-ratio: 1; background: var(--surface); border: 1px solid var(--grid-major); border-radius: 4px; }
.ls-bf svg#bf-g { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; user-select: none; }
.ls-bf svg#bf-g .pt { cursor: grab; }
.ls-bf .opts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); align-items: center; }
.ls-bf .opts label { display: inline-flex; gap: 6px; align-items: center; }
.ls-bf .hint { font-size: 14px; color: var(--muted); margin: 0; }
.ls-bf .data-box { display: grid; gap: 4px; }
.ls-bf .data-box label { font-size: 13px; color: var(--muted); font-weight: 700; }
.ls-bf .data-box textarea { font-family: var(--f-math); font-size: 15px; width: 100%; min-height: 9.5em; resize: vertical; background: var(--surface); border: 1px solid var(--grid-major); border-radius: 8px; padding: 8px 10px; }
.ls-bf .data-msg { font-size: 13px; color: var(--muted); }
.ls-bf .data-msg.err { color: var(--resid); }
.ls-bf .answer { display: grid; gap: 18px; min-width: 0; }
.ls-bf .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin: 0; }
.ls-bf .big { font-family: var(--f-math); font-size: clamp(24px, 4.5vw, 34px); font-weight: 600; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; line-height: 1.2; }
.ls-bf .big .word { font-family: var(--f-body); font-size: clamp(20px, 3.5vw, 26px); }
.ls-bf .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ls-bf .badge { font-family: var(--f-body); font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--ink); }
.ls-bf .badge.good { background: var(--good); color: var(--surface); }
.ls-bf .stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.ls-bf .stats b { font-family: var(--f-math); color: var(--ink); font-weight: 600; }
.ls-bf .meaning { margin: 8px 0 0; font-size: 15px; max-width: 52ch; }
.ls-bf .predict { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--grid); border-radius: 8px; padding: 12px 14px; }
.ls-bf .predict .row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 15px; }
.ls-bf .predict input { font-family: var(--f-math); width: 6em; background: var(--paper); border: 1px solid var(--grid-major); border-radius: 6px; padding: 4px 8px; }
.ls-bf .predict output { font-family: var(--f-math); font-weight: 600; }
.ls-bf .predict .note { font-size: 13px; color: var(--muted); }
.ls-bf .predict .warn { color: var(--resid); font-weight: 700; }
.ls-bf .work { font-family: var(--f-math); font-size: 15px; background: var(--surface); border: 1px solid var(--grid); border-radius: 8px; padding: 12px 14px; display: grid; gap: 8px; overflow-x: auto; }
.ls-bf .work .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; white-space: nowrap; }
.ls-bf .work .note { font-family: var(--f-body); color: var(--muted); font-size: 14px; white-space: normal; }
.ls-bf .work table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.ls-bf .work th, .ls-bf .work td { border: 1px solid var(--grid); padding: 3px 8px; text-align: right; }
.ls-bf .work th { background: var(--chip); font-weight: 600; }
.ls-bf .copy { background: var(--chip); border: 1px solid transparent; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 14px; }
.ls-bf .frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; font-size: 0.82em; margin: 0 1px; }
.ls-bf .frac > span { padding: 1px 3px; }
.ls-bf .frac > span:first-child { border-bottom: 1.5px solid currentColor; }
.ls-bf .guide { display: grid; gap: 16px; padding-top: 8px; }
.ls-bf .guide > h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(22px, 3vw, 28px); margin: 0; }
.ls-bf .guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 760px) {
.ls-bf .guide-grid { grid-template-columns: minmax(0, 1fr); } }
.ls-bf .howto { background: var(--surface); border: 1px solid var(--grid); border-radius: 8px; padding: 16px 20px; display: grid; gap: 10px; min-width: 0; }
.ls-bf .howto.wide { grid-column: 1 / -1; }
.ls-bf .howto h3 { font-family: var(--f-display); font-size: 19px; margin: 0; }
.ls-bf .howto p { margin: 0; max-width: 72ch; }
.ls-bf .howto ol, .ls-bf .howto ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; max-width: 72ch; }
.ls-bf .howto code, .ls-bf .howto .mth { font-family: var(--f-math); font-size: 0.92em; background: var(--chip); padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.ls-bf [hidden] { display: none !important; }

.ls-bf { color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; }
.ls-bf.ls-tool, .ls-bf.ls-guide { max-width: 1120px; margin-inline: auto; }
.ls-bf [hidden] { display: none !important; }
.ls-bf button { line-height: 1.3; }
