/* Slot Tailor — math building.
 *
 * Same cloth as the pattern book: its surfaces, its brass, its type. The only new thing is
 * a set of hues, because a split needs telling apart. They were chosen with the dataviz
 * validator against THIS app's card colours, in both themes, with brass held first, and
 * the order is what makes them colour-blind safe: reorder them and it has to be run again.
 *
 *   dark   worst adjacent CVD dE 11.1, normal-vision dE 16.3, all >= 3:1 on the card
 *   light  worst adjacent CVD dE 11.2, normal-vision dE 17.2, all >= 3:1 on the card
 *
 * The first eight parts of a bet take a hue each. Parts nine to twelve reuse the first four
 * with a hatch over them, rather than inventing hues nobody can tell apart.
 */

:root {
  --mb1: #ad8830; --mb1i: #14110a;
  --mb2: #1f9d8b; --mb2i: #14110a;
  --mb3: #6f8df0; --mb3i: #14110a;
  --mb4: #d9627a; --mb4i: #14110a;
  --mb5: #3a9fcc; --mb5i: #14110a;
  --mb6: #5f9f45; --mb6i: #14110a;
  --mb7: #a678e2; --mb7i: #14110a;
  --mb8: #d9713c; --mb8i: #14110a;
}
:root[data-theme="light"] {
  --mb1: #a67c1a; --mb1i: #000;
  --mb2: #008a7a; --mb2i: #000;
  --mb3: #4563d6; --mb3i: #fff;
  --mb4: #c23f5e; --mb4i: #fff;
  --mb5: #1f87b8; --mb5i: #000;
  --mb6: #4f8a2f; --mb6i: #000;
  --mb7: #8450cc; --mb7i: #fff;
  --mb8: #c85a22; --mb8i: #000;
}

.mbc-0  { --c: var(--mb1); --ci: var(--mb1i); }
.mbc-1  { --c: var(--mb2); --ci: var(--mb2i); }
.mbc-2  { --c: var(--mb3); --ci: var(--mb3i); }
.mbc-3  { --c: var(--mb4); --ci: var(--mb4i); }
.mbc-4  { --c: var(--mb5); --ci: var(--mb5i); }
.mbc-5  { --c: var(--mb6); --ci: var(--mb6i); }
.mbc-6  { --c: var(--mb7); --ci: var(--mb7i); }
.mbc-7  { --c: var(--mb8); --ci: var(--mb8i); }
.mbc-8  { --c: var(--mb1); --ci: var(--mb1i); --hatch: 1; }
.mbc-9  { --c: var(--mb2); --ci: var(--mb2i); --hatch: 1; }
.mbc-10 { --c: var(--mb3); --ci: var(--mb3i); --hatch: 1; }
.mbc-11 { --c: var(--mb4); --ci: var(--mb4i); --hatch: 1; }

/* Win sizes are ordered, so they are one hue getting stronger rather than nine identities.
   Evenly spaced in OKLCH lightness at brass's hue and passed by the ordinal validator against
   the card in each theme: every gap at least dL 0.06, the faintest step at least 2:1. Nine
   steps cannot be mixed from brass and the card (the gaps come out too small), hence the hexes. */
:root {
  --mbb0: #604b1c; --mbb1: #725c2e; --mbb2: #846e3f; --mbb3: #968051; --mbb4: #a99263;
  --mbb5: #bca575; --mbb6: #d0b888; --mbb7: #e4cc9b; --mbb8: #f8e0ae;
}
:root[data-theme="light"] {
  --mbb0: #caad71; --mbb1: #b69a5e; --mbb2: #a3874c; --mbb3: #907539; --mbb4: #7e6326;
  --mbb5: #6c5211; --mbb6: #5a4100; --mbb7: #493000; --mbb8: #382000;
}
.mbb-0 { --c: var(--mbb0); }
.mbb-1 { --c: var(--mbb1); }
.mbb-2 { --c: var(--mbb2); }
.mbb-3 { --c: var(--mbb3); }
.mbb-4 { --c: var(--mbb4); }
.mbb-5 { --c: var(--mbb5); }
.mbb-6 { --c: var(--mbb6); }
.mbb-7 { --c: var(--mbb7); }
.mbb-8 { --c: var(--mbb8); }

.mb { position: relative; display: grid; gap: 18px; container: mb / inline-size; }
/* An undeclared grid track grows to fit its content and pushes out past the card, where the
   card's overflow clips it. Every single-column grid here says it is exactly the column. */
.mb, .mb-editor, .mb-adv-body, .mb-gauge, .mb-dial, .mb-field, .mb-row-more, .mb-figure,
.mb-target, .mb-rows, .mb-bet, .mb-freqs, .mb-check-list, .mb-tile, .mb-doc-bet, .mb-doc-parts {
  grid-template-columns: minmax(0, 1fr);
}
.mb h4 { margin: 0; font: 600 16px/1.3 var(--serif); letter-spacing: -.005em; color: var(--text); }
.mb h5 {
  margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3);
}
.mb-lab {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3);
}
.mb-fine { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.mb-sub-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 4px 14px; margin-bottom: 10px;
}

/* ------------------------------------------------------------------ number boxes */

.mb-num {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 0 8px; height: 32px;
  border-radius: 8px; border: 1px solid transparent; background: var(--bg-2);
  transition: border-color .15s; line-height: 30px; min-width: 0;
}
.mb-num:hover { border-color: var(--line-2); }
.mb-num:focus-within { border-color: var(--accent); }
.mb-num input {
  width: 100%; min-width: 0; border: 0; padding: 0; background: none; outline: none; text-align: right;
  font: 600 13.5px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--text);
}
.mb-num input:disabled { color: var(--text-3); }
.mb-num i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-3); flex: none; }
.mb-num .pre + input { text-align: left; }

.mb-num.big { height: 40px; padding: 0 10px; line-height: 38px; }
.mb-num.big input { width: 86px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: normal; }
.mb-num.big i { font-size: 13px; }

/* ------------------------------------------------------------------ sliders */

.mb-range {
  --tw: 18px;
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 26px; margin: 0; padding: 0; background: none; cursor: pointer;
  --mb-col: var(--c, var(--accent));
}
.mb-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 8px; }
.mb-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right,
    var(--mb-col) calc(var(--tw) / 2 + (100% - var(--tw)) * var(--f, 0)), var(--line-2) 0);
}
.mb-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line-2); }
.mb-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--mb-col); }
.mb-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: var(--tw); height: var(--tw); margin-top: -6px; border-radius: 50%;
  background: var(--mb-col); border: 0;
  box-shadow: 0 0 0 3px var(--card), 0 2px 7px rgba(0, 0, 0, .5);
  transition: transform .12s var(--ease);
}
.mb-range::-moz-range-thumb {
  width: var(--tw); height: var(--tw); border-radius: 50%; border: 0; background: var(--mb-col);
  box-shadow: 0 0 0 3px var(--card), 0 2px 7px rgba(0, 0, 0, .5);
}
.mb-range:hover::-webkit-slider-thumb { transform: scale(1.1); }
.mb-range:active::-webkit-slider-thumb { transform: scale(1.22); }
.mb-range:disabled { cursor: not-allowed; opacity: .55; }
.mb-range:disabled::-webkit-slider-thumb { transform: none; }

/* a return is a measurement, so its slider is a tape measure with a brass pointer on it */
.mb-tape { --tw: 14px; position: relative; padding-bottom: 30px; }
.mb-tape-scale {
  position: absolute; left: calc(var(--tw) / 2); right: calc(var(--tw) / 2); top: 0; bottom: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, var(--line-2) 1px, transparent 1px);
  background-size: calc(100% / 23) 7px;
  background-position: 0 25px; background-repeat: repeat-x;
}
.mb-tape-scale i {
  position: absolute; top: 25px; width: 1px; height: 11px; background: var(--text-3); font-style: normal;
}
.mb-tape-scale i b {
  position: absolute; top: 13px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.mb-tape-scale i.top { background: var(--stop); }
.mb-tape-scale i.top b { color: var(--stop); transform: translateX(-14%); }
.mb-tape-in {
  -webkit-appearance: none; appearance: none; position: relative; display: block;
  width: 100%; height: 26px; margin: 0; background: none; cursor: ew-resize;
}
.mb-tape-in:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.mb-tape-in::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(to right,
    var(--accent) calc(var(--tw) / 2 + (100% - var(--tw)) * var(--f, 0)), var(--line-2) 0);
}
.mb-tape-in::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line-2); }
.mb-tape-in::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--accent); }
.mb-tape-in::-webkit-slider-thumb {
  -webkit-appearance: none; width: var(--tw); height: 24px; margin-top: -10px; border: 0; border-radius: 4px;
  background: var(--accent);
  background-image: linear-gradient(to right, transparent 45%, rgba(0, 0, 0, .35) 45%, rgba(0, 0, 0, .35) 55%, transparent 55%);
  box-shadow: 0 0 0 2px var(--card), 0 3px 10px -2px rgba(0, 0, 0, .7);
  transition: transform .12s var(--ease);
}
.mb-tape-in::-moz-range-thumb {
  width: var(--tw); height: 24px; border: 0; border-radius: 4px; background: var(--accent);
  box-shadow: 0 0 0 2px var(--card), 0 3px 10px -2px rgba(0, 0, 0, .7);
}
.mb-tape-in:active::-webkit-slider-thumb { transform: scaleY(1.1); }

/* ------------------------------------------------------------------ the ribbon */

.mb-ribbon {
  position: relative; height: 44px; padding: 8px 0; user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
}
.mb-cloth { position: relative; height: 28px; }
.mb-seg {
  position: absolute; top: 0; bottom: 0; border-radius: 4px; overflow: hidden;
  /* the 2px gap between blocks is taken here, so the numbers stay true to the percent */
  background-clip: content-box; box-sizing: border-box; padding: 0 1px;
  background-color: var(--c);
  background-image:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, calc(var(--hatch, 0) * .28)) 0 2px, transparent 2px 6px);
  transition: left .2s var(--ease), width .2s var(--ease);
  display: flex; align-items: center;
}
.mb-seg span {
  padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--ci); white-space: nowrap;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.mb-ribbon.is-drag .mb-seg { transition: none; }
.mb-ribbon.is-drag { cursor: ew-resize; }

/* a seam: a stitched line that lifts when you reach for it */
.mb-seam {
  position: absolute; top: 2px; bottom: 2px; width: 24px; margin-left: -12px; padding: 0; border: 0;
  background: none; cursor: ew-resize; z-index: 2; touch-action: none;
  transition: left .2s var(--ease);
}
.mb-ribbon.is-drag .mb-seam { transition: none; }
.mb-seam::before {
  content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 6px; margin-left: -3px;
  border-radius: 3px; background: var(--text); border: 1.5px solid var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  transition: transform .12s var(--ease), background .12s;
}
.mb-seam:hover::before, .mb-seam:focus-visible::before { background: var(--accent-2); transform: scaleX(1.25); }
.mb-seam:focus-visible { outline: none; }
.mb-seam:focus-visible::before { box-shadow: 0 0 0 2px var(--accent); }
.mb-ribbon.is-drag .mb-seam:focus::before { background: var(--accent-2); transform: scaleX(1.25); }
.mb-seam.is-off { pointer-events: none; cursor: default; }
.mb-seam.is-off::before { opacity: 0; }

.mb-ribbon.static { height: 28px; padding: 0; }
.mb-ribbon.static .mb-seg { transition: none; }

/* a thin one, for anywhere the figures are already written down beside it */
.mb-thin { display: flex; gap: 2px; height: 8px; width: 100%; }
.mb-thin i {
  flex: 1 1 0; min-width: 1px; background: var(--c); border-radius: 2px;
  transition: flex-grow .2s var(--ease);
}
.mb-thin i:first-child { border-radius: 4px 2px 2px 4px; }
.mb-thin i:last-child { border-radius: 2px 4px 4px 2px; }
.mb-thin i:only-child { border-radius: 4px; }

.mb-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mb-key { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); min-width: 0; }
.mb-key i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.mb-key b { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.mb-key em { font-style: normal; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.mb-tip {
  position: absolute; z-index: 30; pointer-events: none; display: grid; gap: 1px; max-width: 280px;
  padding: 8px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.4; color: var(--text-2);
  background: var(--card-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  font-variant-numeric: tabular-nums;
}
.mb-tip[hidden] { display: none; }
.mb-tip b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ the whole game */

.mb-hero {
  padding: 20px 22px 18px; border-radius: var(--r-lg);
  background: linear-gradient(115deg, var(--accent-soft), transparent 55%), var(--plate);
  border: 1px solid var(--line);
}
.mb-hero-top { display: grid; grid-template-columns: minmax(180px, auto) minmax(0, 1fr); gap: 32px; align-items: start; }
.mb-figure { display: grid; gap: 2px; max-width: 250px; }
.mb-fig { font: 600 52px/1.05 var(--sans); letter-spacing: -.03em; color: var(--text); }
.mb-target { min-width: 0; display: grid; gap: 4px; }
.mb-target-head, .mb-gauge-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mb-play { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.mb-play .mb-ribbon { margin: -4px 0 4px; }
.mb-why { margin-top: 10px; max-width: 74ch; }

/* ------------------------------------------------------------------ the line-up */

.mb-bets { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }
.mb-bet {
  position: relative; display: grid; gap: 6px; align-content: start; min-height: 118px; min-width: 0;
  padding: 12px 14px 13px; text-align: left; border-radius: var(--r);
  background: var(--card-2); border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .2s, background .15s, transform .15s var(--ease);
}
.mb-bet:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.mb-bet.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--glow); }
.mb-bet-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mb-bet-ic {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: var(--c, var(--accent)); color: var(--ci, var(--accent-ink));
}
.mb-bet-ic .ic { width: 14px; height: 14px; stroke-width: 1.9; }
.mb-bet-type {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb-bet-flag { margin-left: auto; }
.mb-flag {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px 0 4px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.mb-flag .ic { width: 12px; height: 12px; stroke-width: 2; }
.mb-flag.stop { background: var(--stop-soft); color: var(--stop); }
.mb-flag.warn { background: var(--warn-soft); color: var(--warn); }
.mb-bet-name {
  font: 600 16px/1.25 var(--serif); letter-spacing: -.005em; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.mb-bet-nums { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-top: auto; }
.mb-bet-nums b { font-size: 15px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.mb-bet-nums span { white-space: nowrap; }

.mb-bet-add {
  display: grid; place-items: center; align-content: center; gap: 6px; min-height: 118px; padding: 12px;
  border-radius: var(--r); background: none; border: 1.5px dashed var(--line-2); color: var(--text-2);
  font-size: 13.5px; transition: border-color .15s, color .15s, background .15s;
}
.mb-bet-add b { font-weight: 600; }
.mb-bet-add:hover, .mb-bet-add.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.mb-bet-add:disabled { opacity: .55; cursor: not-allowed; }
.mb-plus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; }
.mb-plus .ic { width: 15px; height: 15px; stroke-width: 2; }

.mb-adder {
  display: grid; gap: 8px; margin-top: 10px; padding: 8px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  animation: mb-in .22s var(--ease);
}
.mb-add-type {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 10px 12px; text-align: left;
  border-radius: 9px; border: 1px solid transparent; background: var(--card-2);
  transition: border-color .15s, transform .15s var(--ease);
}
.mb-add-type:hover { border-color: var(--accent); transform: translateY(-1px); }
.mb-add-type b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.mb-add-type em { display: block; font-style: normal; font-size: 12.5px; line-height: 1.4; color: var(--text-3); margin-top: 2px; }
@keyframes mb-in { from { opacity: 0; transform: translateY(-6px); } }

/* ------------------------------------------------------------------ one bet */

.mb-editor {
  --band: var(--c);
  position: relative; display: grid; gap: 16px; padding: 18px 20px 20px;
  border-radius: var(--r-lg); background: var(--card-2); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-1);
}
.mb-editor::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 3px;
  background: var(--band); border-radius: 0 0 3px 3px;
}
.mb-editor.is-new { animation: mb-in .3s var(--ease); }
.mb-ed-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.mb-ed-acts { display: flex; align-items: center; gap: 4px; }

.mb-types {
  display: flex; flex-wrap: wrap; gap: 3px; padding: 3px;
  border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line);
}
.mb-type {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border: 0; border-radius: 8px; background: none; color: var(--text-3);
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s;
}
.mb-type .ic { width: 15px; height: 15px; }
.mb-type:hover { color: var(--text); }
.mb-type.is-on { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }

.mb-ico {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-3);
  transition: background .15s, color .15s, border-color .15s;
}
.mb-ico .ic { width: 16px; height: 16px; }
.mb-ico:hover:not(:disabled) { background: var(--card); color: var(--text); border-color: var(--line-2); }
.mb-ico:disabled { opacity: .35; cursor: not-allowed; }
.mb-ico.is-on { color: var(--accent); background: var(--accent-soft); }
.mb-del.sure { width: auto; padding: 0 10px; color: var(--stop); border-color: var(--stop); font-size: 12.5px; font-weight: 700; }

.mb-bet-title {
  width: 100%; padding: 2px 0 6px; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  background: none; outline: none; color: var(--text);
  font: 600 26px/1.2 var(--serif); letter-spacing: -.015em; transition: border-color .15s;
}
.mb-bet-title:hover { border-bottom-color: var(--text-3); }
.mb-bet-title:focus { border-bottom-color: var(--accent); }
.mb-bet-title::placeholder { color: var(--text-3); }

.mb-gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mb-gauge {
  display: grid; gap: 4px; align-content: start; min-width: 0;
  padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line);
}
.mb-gauge .mb-num.big { background: var(--bg-2); }
.mb-gauge-foot { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; min-height: 26px; align-items: center; }
.mb-gauge-fixed { align-content: start; }
.mb-fixed { display: flex; align-items: baseline; gap: 6px; }
.mb-fixed b { font: 600 22px/40px var(--sans); color: var(--text); letter-spacing: -.01em; }
.mb-fixed span { font-size: 13px; color: var(--text-3); }

.mb-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px;
  border-radius: 999px; border: 1px solid var(--line-2); background: none; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s, border-color .15s;
}
.mb-chip .ic { width: 12px; height: 12px; stroke-width: 2; }
button.mb-chip:hover { border-color: var(--accent); color: var(--text); }
.mb-chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
span.mb-chip { cursor: default; }
.mb-chip.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.mb-chip.solid:hover { background: var(--accent-2); color: var(--accent-ink); }
.mb-chip.picked { border-color: var(--accent-line); color: var(--accent); }

.mb-field { display: grid; gap: 6px; }
.mb textarea { background: var(--bg-2); font-size: 14px; line-height: 1.55; min-height: 62px; display: block; }

/* ------------------------------------------------------------------ where it goes */

.mb-split-head { align-items: center; margin-bottom: 2px; }
.mb-shapes { display: flex; flex-wrap: wrap; gap: 4px; }
.mb-shape {
  display: inline-flex; align-items: baseline; gap: 5px; height: 28px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  font-size: 12.5px; font-weight: 600; transition: border-color .15s, color .15s, background .15s;
}
.mb-shape em { font-style: normal; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mb-shape:hover { border-color: var(--line-2); color: var(--text); }
.mb-shape.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.mb-split .mb-ribbon { margin-bottom: 4px; }
.mb-rows { display: grid; gap: 4px; }
.mb-rows-head { display: none; }

.mb-row {
  border-radius: 10px; background: var(--card); border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .2s;
}
.mb-row:hover { border-color: var(--line-2); }
.mb-row.is-new { animation: mb-in .28s var(--ease); }
.mb-row.is-locked { background: color-mix(in srgb, var(--card) 70%, transparent); }
.mb-row.is-live { outline: 1.5px dashed var(--accent); outline-offset: 2px; }
.mb-row-main {
  display: grid; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; min-height: 50px;
  grid-template-columns: 16px minmax(100px, 1.05fr) minmax(90px, 1.25fr) 66px 84px 32px 32px;
}
.mb-swatch {
  width: 16px; height: 16px; padding: 0; border: 0; border-radius: 5px; cursor: pointer;
  background-color: var(--c);
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, calc(var(--hatch, 0) * .3)) 0 1.5px, transparent 1.5px 4px);
  transition: transform .15s var(--ease);
}
button.mb-swatch:hover { transform: scale(1.2); }
.mb-swatch.still { cursor: default; display: inline-block; flex: none; }
.mb-row-name { display: grid; min-width: 0; }
.mb-part-name {
  width: 100%; min-width: 0; padding: 2px 4px; margin-left: -4px; border: 0; border-radius: 5px; outline: none;
  background: none; color: var(--text); font-size: 14px; font-weight: 600;
  text-overflow: ellipsis; transition: background .15s;
}
.mb-part-name:hover { background: var(--bg-2); }
.mb-part-name:focus { background: var(--bg-2); box-shadow: 0 0 0 1px var(--accent); }
.mb-part-name::placeholder { color: var(--text-3); font-weight: 500; }
.mb-row-sub {
  font-size: 11.5px; line-height: 1.3; color: var(--text-3); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.mb-row-sub:empty { display: none; }
.mb-row-slider { min-width: 0; }
.mb-row .mb-num input { font-size: 13px; }
.mb-describe.has { color: var(--accent); }
.mb-row-more {
  display: grid; gap: 8px; padding: 2px 12px 12px; animation: mb-in .2s var(--ease);
}
.mb-row-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.mb-seg-switch { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.mb-seg-switch button {
  height: 24px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--text-3);
  font-size: 12px; font-weight: 600;
}
.mb-seg-switch button.is-on { background: var(--card-2); color: var(--text); box-shadow: var(--shadow-1); }
.mb-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.mb-dot {
  width: 20px; height: 20px; padding: 0; border: 2px solid transparent; border-radius: 6px; cursor: pointer;
  background-color: var(--c); background-clip: padding-box;
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, calc(var(--hatch, 0) * .3)) 0 1.5px, transparent 1.5px 4px);
  transition: transform .12s var(--ease);
}
.mb-dot:hover { transform: scale(1.15); }
.mb-dot.is-on { outline: 2px solid var(--text); outline-offset: 0; }
.mb-text-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px;
  background: none; color: var(--text-2); font-size: 12.5px; font-weight: 600; justify-self: start;
  text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px;
}
.mb-text-btn .ic { width: 14px; height: 14px; }
.mb-text-btn:hover { color: var(--text); text-decoration-color: currentColor; }
.mb-text-btn.stop { margin-left: auto; color: var(--stop); text-decoration: none; }
.mb-text-btn.stop:hover { background: var(--stop-soft); color: var(--stop); }
.mb-add-part { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }

/* ------------------------------------------------------------------ advanced */

.mb-adv { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.mb-adv > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--r); transition: background .15s;
}
.mb-adv > summary::-webkit-details-marker { display: none; }
.mb-adv > summary:hover { background: var(--bg-2); }
.mb-adv-ic {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
.mb-adv-t { min-width: 0; display: grid; }
.mb-adv-t b { font: 600 16px/1.3 var(--serif); color: var(--text); }
.mb-adv-t em { font-style: normal; font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.mb-adv-n {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap;
}
.mb-adv-chev { color: var(--text-3); transition: transform .25s var(--ease); flex: none; }
.mb-adv-n:empty + .mb-adv-chev { margin-left: auto; }
.mb-adv[open] .mb-adv-chev { transform: rotate(180deg); }
.mb-adv-body { display: grid; gap: 18px; padding: 2px 14px 16px; animation: mb-in .22s var(--ease); }

.mb-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mb-tile { display: grid; gap: 1px; align-content: start; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); min-width: 0; }
.mb-tile .mb-lab { font-size: 10px; letter-spacing: .07em; }
.mb-tile b { font-size: 21px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-tile em { font-style: normal; font-size: 11.5px; line-height: 1.35; color: var(--text-3); }

.mb-dials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mb-dial {
  display: grid; gap: 3px; align-content: start; min-width: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
.mb-dial.is-set { border-color: var(--accent-line); background: var(--accent-soft); }
.mb-dial:not(.is-set) .mb-range { --mb-col: var(--text-3); }
.mb-dial-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; }
.mb-dial-clear {
  width: 20px; height: 20px; padding: 0; display: none; place-items: center; border: 0; border-radius: 50%;
  background: none; color: var(--text-3);
}
.mb-dial-clear .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.mb-dial-clear:hover { color: var(--text); background: var(--bg-2); }
.mb-dial.is-set .mb-dial-clear { display: grid; }
.mb-dial-val { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--text-3); min-width: 0; }
.mb-dial-val input {
  flex: 0 1 auto; width: 8ch; min-width: 2.5ch; max-width: 100%; padding: 0; border: 0; background: none; outline: none;
  font: 600 21px/1.3 var(--sans); letter-spacing: -.01em; color: var(--text); border-bottom: 1px solid transparent;
}
/* the unit sits right beside the figure rather than across a gap */
@supports (field-sizing: content) { .mb-dial-val input { field-sizing: content; width: auto; } }
.mb-dial-val input:focus { border-bottom-color: var(--accent); }
.mb-dial-val input::placeholder { color: var(--text-3); font-weight: 500; }
.mb-dial-val em { font-style: normal; white-space: nowrap; font-size: 12px; }

.mb-freqs { display: grid; gap: 6px; }
.mb-freq {
  display: grid; align-items: center; gap: 4px 10px;
  grid-template-columns: 16px minmax(90px, 1fr) minmax(90px, 1.3fr) 104px;
  padding: 6px 10px; border-radius: 9px; background: var(--card-2);
}
.mb-freq:not(.is-set) .mb-range { --mb-col: var(--text-3); }
.mb-freq-name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mb-freq-out { grid-column: 2 / -1; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mb-freq-out:empty { display: none; }

.mb-insight p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; color: var(--text-2); max-width: 70ch; }
.mb-boost { display: grid; grid-template-columns: auto minmax(90px, 1fr) 84px; gap: 10px; align-items: center; margin-bottom: 6px; }
.mb-boost:not(.is-set) .mb-range { --mb-col: var(--text-3); }
.mb-boost .mb-lab { letter-spacing: .06em; }
.mb-buys { display: grid; grid-template-columns: auto minmax(0, 260px); gap: 10px; align-items: center; margin-bottom: 8px; }
.mb .select select { height: 36px; font-size: 14px; }

.mb-builds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mb-build { display: grid; gap: 4px; }
.mb-build input {
  width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: 500 13.5px/1 var(--mono); outline: none;
}
.mb-build input:focus { border-color: var(--accent); }
.mb-build input::placeholder { color: var(--text-3); }

/* ------------------------------------------------------------------ the win distribution */

.mb-dist-box { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.mb-dist-box > .mb-sub-head { margin-bottom: 0; }
.mb-dist-top {
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  padding: 10px 12px; border-radius: 10px; background: var(--bg-2);
}
.mb-dist-read { display: grid; gap: 1px; min-width: 0; flex: 1 1 280px; }
.mb-dist-read b { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.015em; color: var(--text); }
.mb-dist-read em { font-style: normal; font-size: 12.5px; line-height: 1.45; color: var(--text-3); }
.mb-dist-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.mb-dist-bar { display: grid; gap: 5px; padding: 2px 0 4px; cursor: default; }
.mb-dist-bar .mb-thin i { flex: 0 0 0; min-width: 2px; }
.mb-dist-bar .mb-lab { font-size: 10px; letter-spacing: .08em; }

.mb-dist { display: grid; gap: 2px; grid-template-columns: minmax(0, 1fr); }
.mb-band {
  display: grid; align-items: center; gap: 8px; min-height: 40px; padding: 3px 4px 3px 8px;
  grid-template-columns: 14px 104px minmax(70px, 1fr) 102px 62px 44px 30px;
  border-radius: 8px; transition: background .15s;
}
.mb-band:not(.mb-band-head):not(.mb-band-axis):hover { background: var(--card-2); }
.mb-band .mb-swatch { width: 12px; height: 12px; border-radius: 3px; }
.mb-band.none .mb-swatch { background-color: var(--line-2); }
.mb-band-name {
  font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; min-width: 0;
}
.mb-band-name em { font-style: normal; font-weight: 500; color: var(--text-3); }
.mb-band-slider { min-width: 0; }
.mb-band .mb-range { --mb-col: var(--accent); }
.mb-band.none .mb-range { --mb-col: var(--text-3); }
.mb-band .mb-num { height: 30px; line-height: 28px; }
.mb-band .mb-num input { text-align: left; font-size: 13px; }
.mb-band .mb-num input::placeholder { color: var(--text-3); font-weight: 500; }
.mb-band-fig {
  font-size: 12px; text-align: right; color: var(--text-2); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mb-band-fig.rtp { color: var(--text-3); }
.mb-band .mb-ico { width: 28px; height: 28px; }
.mb-band .mb-ico .ic { width: 14px; height: 14px; }
.mb-band.is-off { opacity: .45; }
.mb-band.is-off .mb-band-name { text-decoration: line-through; text-decoration-color: var(--text-3); }
.mb-band.is-off .mb-band-fig.pct { font-size: 11px; color: var(--text-3); }
.mb-band.is-locked .mb-range { opacity: .75; }

.mb-band-head { min-height: 22px; }
.mb-band-head > span {
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); white-space: nowrap;
}
.mb-band-head > span:nth-child(5), .mb-band-head > span:nth-child(6) { text-align: right; }
.mb-band-axis { min-height: 16px; padding-top: 0; padding-bottom: 0; }
.mb-axis { position: relative; display: block; height: 14px; border-bottom: 1px solid var(--line); margin: 0 0 2px; }
.mb-axis i {
  position: absolute; bottom: 0; left: calc(9px + (100% - 18px) * var(--at)); width: 1px; height: 4px;
  background: var(--line-2); font-style: normal;
}
.mb-axis b {
  position: absolute; bottom: 4px; right: -1px; font-size: 10px; font-weight: 600; line-height: 1.1;
  color: var(--text-3); white-space: nowrap;
}

/* the hit rate's own clear button would only un-sync it from the bands it now follows */
.mb-dial.is-linked .mb-dial-clear { display: none; }

.mb-doc-dist { display: grid; gap: 6px; margin-top: 4px; }
.mb-doc-bands { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 18px; }
.mb-doc-band {
  display: grid; grid-template-columns: 11px minmax(0, 1fr) auto 62px; align-items: center; gap: 8px;
  padding: 3px 0; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-2);
}
.mb-doc-band .mb-swatch { width: 11px; height: 11px; border-radius: 3px; }
.mb-doc-band.none .mb-swatch { background-color: var(--line-2); }
.mb-doc-band b { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-doc-band em { font-style: normal; text-align: right; color: var(--text-3); font-size: 12px; }

/* ------------------------------------------------------------------ reality check */

.mb-checks { border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.mb-check-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px;
}
.mb-check-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; color: var(--warn); }
.mb-check-title .ic { width: 16px; height: 16px; flex: none; }
.mb-checks.is-clear .mb-check-title { color: var(--accent); }
.mb-check-title b { font: 600 15px/1.3 var(--serif); color: var(--text); }
.mb-check-title em { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.mb-switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.mb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mb-switch i {
  position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--line-2); transition: background .15s;
}
.mb-switch i::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); transition: transform .18s var(--ease);
}
.mb-switch input:checked + i { background: var(--accent); }
.mb-switch input:checked + i::after { transform: translateX(12px); background: var(--accent-ink); }
.mb-switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.mb-check-list { display: grid; gap: 1px; padding: 0 8px 8px; }
.mb-check {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 9px 10px; border-radius: 9px;
}
.mb-check + .mb-check { margin-top: 4px; }
.mb-check.stop { background: var(--stop-soft); }
.mb-check.warn { background: var(--warn-soft); }
.mb-check-ic .ic { width: 17px; height: 17px; margin-top: 1px; }
.mb-check.stop .mb-check-ic { color: var(--stop); }
.mb-check.warn .mb-check-ic { color: var(--warn); }
.mb-check b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.mb-check p { margin: 1px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.mb-chip.fix { margin-top: 6px; border-color: currentColor; color: var(--text); }

/* ------------------------------------------------------------------ the reading panel */

.mb-about { display: grid; gap: 12px; margin: 0 0 12px; }
.mb-about-bet { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid transparent; }
.mb-about-bet.is-on { border-color: var(--accent-line); }
.mb-about-top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.mb-about-top > i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.mb-about-top b { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-about-top span { margin-left: auto; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mb-about-parts { display: grid; gap: 2px; }
.mb-about-parts span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.mb-about-parts i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.mb-about-parts em { margin-left: auto; font-style: normal; color: var(--text-3); font-variant-numeric: tabular-nums; }
.about .mb-about-adv { margin: 0; font-size: 12px; color: var(--text-3); }

/* ------------------------------------------------------------------ the brief */

.mb-doc-note { margin: 0 0 10px; font-size: 13.5px; color: var(--warn); }
.mb-doc-bet { display: grid; gap: 8px; padding: 14px 0; }
.mb-doc-bet + .mb-doc-bet { border-top: 1px solid var(--line); }
.mb-doc-bet:last-child { padding-bottom: 0; }
.mb-doc-bet:first-of-type { padding-top: 0; }
.mb-doc-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.mb-doc-top > b { font: 600 17px/1.3 var(--serif); }
.mb-doc-type { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.mb-doc-nums { margin-left: auto; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mb-doc-nums b { color: var(--text); font-weight: 650; }
.mb-doc-desc { margin: 0; padding-left: 12px; border-left: 2px solid var(--accent); font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.mb-doc-parts { display: grid; }
.mb-doc-part {
  display: grid; align-items: baseline; gap: 2px 10px; padding: 6px 0;
  grid-template-columns: 16px minmax(0, 1fr) 54px 80px;
}
.mb-doc-part + .mb-doc-part { border-top: 1px solid var(--line); }
.mb-doc-part .mb-swatch { width: 11px; height: 11px; border-radius: 3px; align-self: center; }
.mb-doc-name { min-width: 0; display: grid; font-size: 14px; }
.mb-doc-name b { font-weight: 600; }
.mb-doc-name em { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.mb-doc-name q { quotes: none; font-size: 13px; color: var(--text-2); white-space: pre-wrap; }
.mb-doc-share, .mb-doc-pts { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.mb-doc-pts { color: var(--text-3); }
.mb-doc-targets { margin: 2px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; }
.mb-doc-targets > div { display: grid; }
.mb-doc-targets dt { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.mb-doc-targets dd { margin: 0; font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ narrow */

@container mb (max-width: 720px) {
  .mb-row-main { grid-template-columns: 16px minmax(0, 1fr) 62px 82px 30px 30px; }
  .mb-row-name { grid-column: 2 / 3; grid-row: 1; }
  .mb-row-main > .mb-num:not(.mb-pts) { grid-column: 3; grid-row: 1; }
  .mb-pts { grid-column: 4; grid-row: 1; }
  .mb-row-main > [data-act="lock"] { grid-column: 5; grid-row: 1; }
  .mb-row-main > .mb-describe { grid-column: 6; grid-row: 1; }
  .mb-row-slider { grid-column: 1 / -1; grid-row: 2; padding: 0 4px 2px; }
  .mb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container mb (max-width: 560px) {
  .mb-hero { padding: 16px; }
  .mb-hero-top { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .mb-figure { max-width: none; }
  .mb-fig { font-size: 48px; }
  .mb-editor { padding: 16px 14px; }
  .mb-gauges, .mb-dials, .mb-builds { grid-template-columns: minmax(0, 1fr); }
  .mb-bet-title { font-size: 22px; }
  .mb-bets { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding: 2px 2px 6px; margin: 0 -2px; }
  .mb-bets::-webkit-scrollbar { display: none; }
  .mb-bet, .mb-bet-add { flex: 0 0 168px; scroll-snap-align: start; }
  .mb-bet-add { flex-basis: 120px; }
  .mb-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .mb-type { justify-content: center; }
  .mb-ed-acts { width: 100%; justify-content: flex-end; }
  /* the name gets the whole first line, then the slider, then its two figures side by side */
  .mb-row-main { grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1fr) 30px 30px; }
  .mb-row-name { grid-column: 2 / 4; grid-row: 1; }
  .mb-row-main > [data-act="lock"] { grid-column: 4; grid-row: 1; }
  .mb-row-main > .mb-describe { grid-column: 5; grid-row: 1; }
  .mb-row-slider { grid-column: 1 / -1; grid-row: 2; }
  .mb-row-main > .mb-num:not(.mb-pts) { grid-column: 1 / 3; grid-row: 3; }
  .mb-pts { grid-column: 3 / -1; grid-row: 3; }
  /* A band: the size of win gets the whole first line, because it is what the row is about.
     Then the slider, then the odds and what they return. How many rounds that is would only
     repeat the odds, so it drops out here, except where it is the row's only figure. */
  .mb-adv-body { padding-left: 8px; padding-right: 8px; }
  .mb-band { grid-template-columns: 14px minmax(0, 1fr) auto 28px; gap: 2px 8px; padding: 6px 2px; }
  .mb-band + .mb-band { border-top: 1px solid var(--line); border-radius: 0; }
  .mb-band-head, .mb-band-axis { display: none; }
  .mb-band-name { grid-column: 2 / 4; grid-row: 1; }
  .mb-band > .mb-ico { grid-column: 4; grid-row: 1; }
  .mb-band > span:last-child:empty { display: none; }
  .mb-band-slider { grid-column: 1 / -1; grid-row: 2; }
  .mb-band .mb-num { grid-column: 1 / 3; grid-row: 3; justify-self: start; width: 100%; max-width: 132px; }
  .mb-band-fig { grid-column: 3 / -1; grid-row: 3; }
  .mb-band-fig.pct { display: none; }
  .mb-band.none .mb-band-fig.pct, .mb-band.is-off .mb-band-fig.pct { display: block; }
  .mb-band.none .mb-band-fig.pct::after { content: " of rounds"; }
  .mb-band.none .mb-band-fig.rtp, .mb-band.is-off .mb-band-fig.rtp { display: none; }
  .mb-band-fig.rtp:not(:empty)::after { content: " RTP"; }
  .mb-doc-band { grid-template-columns: 11px minmax(0, 1fr) auto 56px; }
  .mb-freq { grid-template-columns: 16px minmax(0, 1fr) 96px; }
  .mb-freq .mb-range { grid-column: 1 / -1; grid-row: 2; }
  .mb-freq-out { grid-column: 1 / -1; }
  .mb-boost { grid-template-columns: minmax(0, 1fr) 84px; }
  .mb-boost .mb-range { grid-column: 1 / -1; grid-row: 2; }
  .mb-buys { grid-template-columns: minmax(0, 1fr); }
  .mb-doc-part { grid-template-columns: 16px minmax(0, 1fr) 48px; }
  .mb-doc-pts { display: none; }
}

/* ------------------------------------------------------------------ V2: the board
   Bets are the big boxes on top, features the boxes below, and a wire per part of a bet's
   return, coloured by its bet and as thick as its slice. Each feature's link chips stack just
   above it, one per bet, so many bets can reach one feature without their labels colliding. */

.mb-viewbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.mb-viewbar .mb-fine { flex: 1 1 260px; }
.mb-views { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); flex: none; }
.mb-views button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px;
  background: none; color: var(--text-3); font: 600 12.5px/1 var(--sans); cursor: pointer;
}
.mb-views button .ic { width: 15px; height: 15px; }
.mb-views button em { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.mb-views button:hover { color: var(--text); }
.mb-views button.is-on { background: var(--card-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }

.mbb {
  position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; background: var(--card);
}
.mbb-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.mbb-bar .grow { flex: 1; }
.mbb-bar .mb-chip .ic { width: 14px; height: 14px; }
.mbb-menu { position: relative; }
.mbb-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 310px; display: grid; gap: 2px; padding: 6px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
}
.mbb-pop button {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); cursor: pointer; font: inherit;
}
.mbb-pop button:hover, .mbb-pop button:focus-visible { background: var(--card-2); }
.mbb-pop b { display: block; font-size: 13.5px; font-weight: 600; }
.mbb-pop em { font-style: normal; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.mbb-zoom { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); }
.mbb-zoom b { min-width: 42px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mbb-zoom .mb-ico { width: 28px; height: 28px; }

.mbb-body { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.mbb-stage {
  position: relative; height: 620px; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background-color: var(--plate); background-image: radial-gradient(circle, var(--line-2) 1.1px, transparent 1.6px);
  background-size: 22px 22px;
}
.mbb-stage.is-panning { cursor: grabbing; }
.mbb-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.mbb-links { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.mbb-wire { fill: none; stroke: var(--c); stroke-linecap: round; opacity: .78; transition: opacity .15s; }
.mbb.has-sel .mbb-wire { opacity: .28; }
.mbb.has-sel .mbb-wire.is-hot { opacity: .95; }
.mbb-wire.is-ghost { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 7 7; opacity: 1; }
.mbb .mbb-wire.is-ghost { opacity: 1; }
.mbb-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; cursor: pointer; }

.mbb-node {
  position: absolute; background: var(--card); border: 1.5px solid var(--line-2); border-radius: 13px; cursor: default;
  box-shadow: 0 22px 44px -24px rgba(0, 0, 0, .9);
}
.mbb-bet { width: 290px; border-color: color-mix(in srgb, var(--c) 70%, var(--line-2)); }
.mbb-bet::before {
  content: ""; position: absolute; left: 12px; right: 12px; top: -1.5px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c);
}
.mbb-feat { width: 250px; }
.mbb-feat.is-loose { border-style: dashed; }
.mbb-node.is-sel { box-shadow: 0 0 0 2px var(--accent), 0 0 0 7px var(--accent-soft), 0 22px 44px -24px rgba(0, 0, 0, .9); }
.mbb-node.is-drop { box-shadow: 0 0 0 2px var(--accent), 0 0 0 10px var(--accent-soft); }
.mbb-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 2px 12px; cursor: grab; }
.mbb-stage.is-panning .mbb-head { cursor: grabbing; }
.mbb-ic { width: 25px; height: 25px; flex: none; border-radius: 7px; display: grid; place-items: center; background: var(--c); color: var(--ci); }
.mbb-ic .ic { width: 14px; height: 14px; stroke-width: 2.1; }
.mbb-kind {
  flex: 1; min-width: 0; font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mbb-x {
  height: 24px; min-width: 24px; padding: 0 4px; display: grid; place-items: center; border: 0; border-radius: 6px;
  background: none; color: var(--text-3); cursor: pointer; font: 600 11.5px/1 var(--sans);
}
.mbb-x .ic { width: 14px; height: 14px; }
.mbb-x:hover:not(:disabled) { color: var(--stop); background: var(--stop-soft); }
.mbb-x.sure { color: var(--stop); background: var(--stop-soft); padding: 0 8px; }
.mbb-x:disabled { opacity: .3; cursor: default; }
.mbb-title {
  display: block; width: calc(100% - 24px); margin: 2px 12px 8px; padding: 0 0 2px; border: 0; border-bottom: 1px dashed transparent;
  border-radius: 0; background: none; outline: none; color: var(--text); font: 600 19px/1.25 var(--serif); letter-spacing: -.01em;
}
.mbb-title:hover { border-bottom-color: var(--line-2); }
.mbb-title:focus { border-bottom-color: var(--accent); }
.mbb-title::placeholder { color: var(--text-3); }
.mbb-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 12px 10px; }
.mbb-cell {
  display: grid; gap: 1px; min-width: 0; padding: 6px 9px; border-radius: 8px; background: var(--bg-2);
  border: 1px solid var(--line); cursor: text; transition: border-color .15s;
}
.mbb-cell:hover { border-color: var(--line-2); }
.mbb-cell:focus-within { border-color: var(--accent); }
.mbb-cell.fixed { cursor: default; }
.mbb-cell > small, .mbb-ef small {
  font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--text-3); white-space: nowrap;
}
.mbb-in { display: flex; align-items: baseline; gap: 3px; min-width: 0; }
.mbb-in input, .mbb-in > b {
  width: 100%; min-width: 0; padding: 0; border: 0; background: none; outline: none; color: var(--text);
  font: 600 15.5px/1.3 var(--sans); font-variant-numeric: tabular-nums;
}
.mbb-in > b { width: auto; }
.mbb-in input:disabled { color: var(--text-2); }
.mbb-in input::placeholder { color: var(--text-3); font-weight: 500; }
.mbb-in i { font-style: normal; font-size: 11px; color: var(--text-3); flex: none; white-space: nowrap; }
.mbb-foot { display: flex; align-items: center; gap: 10px; padding: 0 12px 14px; }
.mbb-foot .mb-thin { flex: 1; }
.mbb-more {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line-2);
  background: none; color: var(--text-2); font: 600 11.5px/1 var(--sans); cursor: pointer; white-space: nowrap;
}
.mbb-more .ic { width: 13px; height: 13px; }
.mbb-more:hover { color: var(--text); border-color: var(--text-3); }
.mbb-port {
  position: absolute; left: 50%; width: 18px; height: 18px; padding: 0; transform: translateX(-50%); border-radius: 50%;
  background: var(--card); border: 3px solid var(--c); transition: transform .12s var(--ease), background .12s;
}
.mbb-port.out { bottom: -10px; cursor: crosshair; z-index: 1; }
.mbb-port.out:hover, .mbb-port.out:focus-visible { transform: translateX(-50%) scale(1.3); background: var(--c); outline: none; }
.mbb-port.in { top: -8px; width: 13px; height: 13px; border-width: 2.5px; pointer-events: none; }
.mbb-from { display: flex; align-items: center; gap: 5px; padding: 0 12px 4px; font-size: 12px; color: var(--text-2); min-width: 0; }
.mbb-from i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.mbb-from span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbb-desc {
  margin: 0; padding: 2px 12px 13px; font-size: 12px; line-height: 1.45; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mbb-desc.empty { font-style: italic; opacity: .8; }

.mbb-edge {
  position: absolute; z-index: 2; transform: translate(-50%, -50%); display: flex; align-items: stretch; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer;
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .9);
}
.mbb-edge:hover { border-color: var(--text-3); }
.mbb-edge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mbb-edge.is-sel { z-index: 3; cursor: default; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 12px 26px -14px rgba(0, 0, 0, .9); }
.mbb-stripe { width: 4px; flex: none; background: var(--c); border-radius: 7px 0 0 7px; }
.mbb-edge.is-locked .mbb-stripe { background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .45) 0 2px, transparent 2px 4px); }
.mbb-ef { display: grid; align-content: center; padding: 4px 9px; min-width: 0; }
.mbb-ef + .mbb-ef { border-left: 1px solid var(--line); }
.mbb-ef b { font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.mbb-edge.is-sel .mbb-ef { width: 96px; }
.mbb-edge.is-sel .mbb-in input { font-size: 13px; }
.mbb.has-sel .mbb-edge:not(.is-sel) { opacity: .82; }

.mbb-hint {
  position: absolute; left: 14px; right: 14px; bottom: 10px; margin: 0; font-size: 12px; color: var(--text-3);
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.mbb-side {
  container: mb / inline-size;   /* the editor inside reads ITS width, so a narrow panel gets the narrow layout */
  min-width: 0; padding: 18px; border-top: 1px solid var(--line); background: var(--card);
  display: grid; gap: 14px; align-content: start; grid-template-columns: minmax(0, 1fr);
}
.mbb-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: -6px; }
.mbb-side .mb-editor { padding: 0; border: 0; background: none; box-shadow: none; }
.mbb-side .mb-editor::before { display: none; }
.mbb-panel { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.mbb-styles { display: flex; flex-wrap: wrap; gap: 6px; }
.mbb-styles .ic { width: 14px; height: 14px; }
.mbb-linkset { display: grid; gap: 8px; }
.mbb-linkset h5 { margin-bottom: 0; }
.mbb-link { display: grid; gap: 8px; padding: 10px 11px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--card-2); }
.mbb-link.is-sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mbb-link-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mbb-link-top > i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.mbb-link-top b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbb-link-top span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.mbb-link-top .mb-ico { width: 28px; height: 28px; }
.mbb-link-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mbb-link-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.mbb-help ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; display: grid; gap: 6px; }
.mbb-help h4 { margin-top: 4px; }

/* full screen: the board takes the window, settings dock on the right */
.mb.is-full { container-type: normal; }
.mbb.is-full { position: fixed; inset: 0; z-index: 1000; border: 0; border-radius: 0; }
.mbb.is-full .mbb-body { grid-template-columns: minmax(0, 1fr) 460px; }
.mbb.is-full .mbb-stage { height: auto; }
.mbb.is-full .mbb-side { border-top: 0; border-left: 1px solid var(--line); overflow: auto; }
html.mbb-locked, html.mbb-locked body { overflow: hidden; }
@media (max-width: 820px) {
  .mbb.is-full .mbb-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .mbb.is-full .mbb-side { max-height: 46vh; border-left: 0; border-top: 1px solid var(--line); }
}

@container mb (min-width: 1100px) {
  .mbb-body { grid-template-columns: minmax(0, 1fr) 420px; }
  .mbb-stage { height: 680px; }
  .mbb-side { border-top: 0; border-left: 1px solid var(--line); max-height: 680px; overflow: auto; }
}
@container mb (max-width: 560px) {
  .mbb-stage { height: 470px; }
  .mbb-hint { display: none; }
  .mbb-bar .mb-chip[data-act="b-tidy"], .mbb-bar .mb-chip[data-act="b-fit"] { padding-inline: 8px; }
}

@media print {
  .mb-seg, .mb-swatch { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .mb-doc-bet { break-inside: avoid; }
}
