.hc{position:relative;border-radius:2px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;cursor:pointer;min-height:0;transition:filter .1s, box-shadow .15s;}
  .hc.pair { background: var(--hc-pair-bg); color: var(--hc-pair-fg); }
  .hc.suit { background: var(--hc-suit-bg); color: var(--hc-suit-fg); }
  .hc.off  { background: var(--hc-off-bg);  color: var(--hc-off-fg);  }
  .hc:hover { filter: brightness(1.35); }
  .hc.on-a { filter: brightness(1.1); }
  .hc.pair.on-a {
    background: var(--hc-sel-a-pair-bg) !important;
    color: var(--hc-sel-a-pair-fg) !important;
  }
  .hc.suit.on-a {
    background: var(--hc-sel-a-suit-bg) !important;
    color: var(--hc-sel-a-suit-fg) !important;
  }
  .hc.off.on-a {
    background: var(--hc-sel-a-off-bg) !important;
    color: var(--hc-sel-a-off-fg) !important;
  }
  .hc.on-b { filter: brightness(1.1); }
  .hc.pair.on-b {
    background: var(--hc-sel-b-pair-bg) !important;
    color: var(--hc-sel-b-pair-fg) !important;
  }
  .hc.suit.on-b {
    background: var(--hc-sel-b-suit-bg) !important;
    color: var(--hc-sel-b-suit-fg) !important;
  }
  .hc.off.on-b {
    background: var(--hc-sel-b-off-bg) !important;
    color: var(--hc-sel-b-off-fg) !important;
  }
  .hc.mw-range.mw-range {
    background: var(--mw-color) !important;
    color: var(--mw-fg) !important;
  }
  .hc::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: var(--hc-veil);
    opacity: 0;
    z-index: 6;
    pointer-events: none;
    transition: opacity .12s;
  }
  .hgrid.hl-on .hc.hov-hl::after { opacity: 0; }
  .hgrid.hl-on .hc:not(.hov-hl) {
    filter: brightness(.5) saturate(.65);
  }
  [data-theme="light"] .hgrid.hl-on .hc:not(.hov-hl) {
    filter: opacity(.4) saturate(.45);
  }
  .hgrid.hl-on .hc:not(.hov-hl) .hc-wb,
  .hgrid.hl-on .hc:not(.hov-hl) .hc-sb { display: none; }
  .hgrid .hc.ag-lit {
    box-shadow: var(--ag-fill, inset 0 0 0 0 transparent),
                0 0 0 1.5px var(--hc-ring);
    z-index: 7;
  }
  .hgrid .hc.ag-lit .hc-wb { display: none; }
  .hgrid.hl-on .hc.hov-hl {
    box-shadow: 0 0 0 1.5px var(--hc-ring);
    z-index: 7;
  }
  .hgrid.hl-on .hc.hov-hl:not(.hl-fill) {
    box-shadow: 0 0 0 1.5px var(--hc-ring);
    padding-bottom: clamp(6px, calc(21.7cqw / var(--grid-n, 13)), calc(156px / var(--grid-n, 13)));
    outline: none !important;
  }
  .hgrid.hl-on .hc.hov-hl.hl-fill {
    box-shadow: var(--hc-fill), 0 0 0 1.5px var(--hc-ring);
    color: var(--hc-tile-ink) !important;
    outline: none !important;
  }
  .grid-container{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:8px 10px;position:relative;}
  .grid-panel{position:absolute;inset:8px;display:flex;flex-direction:column;gap:2px;transition:opacity .15s;}
  .grid-panel.hidden{opacity:0;pointer-events:none;}  .pct-label{font-size:10px;font-weight:700;}
  .pct-label.a{color:var(--range-a);}
  .pct-label.b{color:var(--range-b);}
  .combo-readout{
    display:flex;align-items:center;gap:4px;
    flex-shrink:0;white-space:nowrap;
    padding:3px 8px;border-radius:var(--rad-sm);
    background:var(--bg2);border:1px solid var(--bd);
    font-size:10px;font-weight:600;color:var(--t3);
    line-height:1;
  }
  .combo-readout[hidden]{display:none;}
  .combo-side{
    font-size:14px;font-weight:800;
    letter-spacing:0.4px;text-transform:uppercase;
    color:var(--co-color,var(--t1));
    line-height:1;
    padding-right:7px;
    border-right:1px solid var(--bd);
  }
  .combo-side:empty{display:none;}
  .combo-readout b{
    font-size:11px;font-weight:700;
    color:var(--co-color,var(--t1));
    font-variant-numeric:tabular-nums;
  }
  .inp{background:var(--bg2);border:1px solid var(--bd);border-radius:var(--rad-sm);color:var(--t1);padding:3px 7px;font-size:11px;font-weight:600;width:52px;transition:border-color .15s;}
  .inp.active-a{border-color:var(--range-a);}
  .inp.active-b{border-color:var(--range-b);}
  .stat-row{display:flex;gap:12px;align-items:center;}
  .stat{display:flex;flex-direction:column;}
  .sv{font-size:13px;font-weight:700;color:var(--range-a);}
  .sv.b{color:var(--range-b);}
  .sl{font-size:9px;color:var(--t3);}
  .rtabs{display:flex;gap:3px;padding:8px 10px 0;flex-shrink:0;}
  .rtab{padding:3px 10px;border-radius:var(--rad-sm);font-size:10px;font-weight:600;color:var(--t3);background:var(--bg2);border:1px solid var(--bd);cursor:pointer;}
  .rtab.active{color:var(--acc);background:var(--acc-dim);border-color:var(--acc2);}
  .rtab-content{display:none;flex:1;min-height:0;overflow-y:auto;padding:8px 10px;flex-direction:column;gap:6px;}
  .rtab-content.active{display:flex;}
  .street-pills{padding:0;gap:3px;margin-bottom:2px;flex-shrink:0;}
  .street-pane{display:none;flex-direction:column;gap:6px;}
  .street-pane.active{display:flex;flex:1;min-height:0;}
  .blk-btn{padding:2px 9px;border-radius:20px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.3px;color:var(--t2);background:var(--bg2);border:1px solid var(--bd);cursor:pointer;flex-shrink:0;transition:color .12s,background .12s,border-color .12s;}
  .blk-btn:hover{color:var(--t1);}
  .blk-btn.on{color:var(--acc);background:var(--acc-dim);border-color:var(--acc2);}
  .blk-readout{display:flex;flex-direction:column;gap:3px;padding:6px 0 2px;}
  .blk-readout-top{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
  .blk-vs{font-size:9px;color:var(--t3);text-transform:uppercase;letter-spacing:0.4px;}
  .blk-line{display:flex;align-items:baseline;gap:4px;flex-wrap:wrap;font-size:11px;color:var(--t2);min-height:16px;}
  .blk-line .blk-combo{font-size:13px;font-weight:600;color:var(--t1);margin-right:2px;}
  .blk-line .blk-v{font-size:13px;font-weight:700;color:var(--t1);font-variant-numeric:tabular-nums;}
  .blk-line .blk-txt{color:var(--t2);}
  .blk-line .blk-dot{color:var(--t3);margin:0 2px;}
  .blk-line .blk-dim{font-size:10px;color:var(--t3);}
  .blk-suit.sh{color:var(--sh);}
  .blk-suit.sd{color:var(--sd);}
  .blk-suit.ss{color:var(--ss);}
  .blk-suit.sc{color:var(--sc);}
  .fld-btn{flex-shrink:0;margin-left:6px;padding:1px 4px;border-radius:3px;border:1px solid var(--bd);background:transparent;color:var(--t3);font-size:8px;font-weight:700;letter-spacing:0.4px;line-height:1.4;cursor:pointer;user-select:none;opacity:0.35;transition:opacity .12s,color .12s,border-color .12s,background .12s;}
  .ph-row:hover .fld-btn,
  .accord-hdr:hover .fld-btn,
  .accord-row:hover .fld-btn{opacity:1;}
  .fld-btn:hover{color:var(--t1);border-color:var(--bd2);background:var(--bg2);}
  .fld-btn.on{opacity:1;color:var(--red);border-color:var(--red2);background:var(--red-dim);}
  .fld-btn.part{opacity:1;color:var(--t2);border-color:var(--bd2);background:var(--bg2);}
  .ph-row.fld-off,
  .accord-hdr.fld-off,
  .accord-row.fld-off{opacity:0.4;}
  .ph-row.fld-off .ph-row-name,
  .accord-hdr.fld-off .accord-hdr-title,
  .accord-row.fld-off .accord-row-name{text-decoration:line-through;}
  .blk-pin{font-size:9px;font-weight:600;color:var(--acc);background:var(--acc-dim);border:1px solid var(--acc2);border-radius:3px;padding:1px 5px;cursor:pointer;}
  .blk-pin:hover{color:var(--red);border-color:var(--red2);background:var(--red-dim);}
  .blk-pop{position:absolute;z-index:40;background:var(--bg1);border:1px solid var(--bd2);border-radius:var(--rad);box-shadow:var(--shadow);padding:3px;width:max-content;user-select:none;}
  .blk-pop-grid{display:grid;grid-template-columns:repeat(4,42px);gap:2px;}
  .blk-mc{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border-radius:3px;padding:4px 2px;background:var(--bg2);font-variant-numeric:tabular-nums;cursor:pointer;transition:filter .1s;}
  .blk-mc-c{font-size:11px;font-weight:600;color:var(--t1);line-height:1;letter-spacing:-0.2px;}
  .blk-mc-v{font-size:9px;color:var(--t2);line-height:1;}
  .blk-mc:hover{filter:brightness(1.35);}
  .blk-mc.sel{box-shadow:inset 0 0 0 1.5px var(--hc-ring);}
  .radio-grp{display:flex;gap:6px;margin-bottom:8px;}
  .radio-opt{display:flex;align-items:center;padding:3px 10px;border-radius:var(--rad-sm);font-size:10px;font-weight:600;color:var(--t2);background:var(--bg2);border:1px solid var(--bd);cursor:pointer;}
  .radio-opt input{display:none;}
  .radio-opt.active{color:var(--acc);background:var(--acc-dim);border-color:var(--acc2);}
  .radio-opt.folded{color:var(--t3);background:var(--bg2);border-color:var(--bd);opacity:0.45;text-decoration:line-through;}
  .board-filter{display:flex;flex-direction:column;gap:4px;}
  .bf-selects{display:flex;flex-wrap:wrap;gap:5px;}
  .bf-select{width:auto;min-width:0;flex-shrink:0;}
  .bf-select option:disabled{color:var(--t3);}
  .bf-tags{display:flex;flex-wrap:wrap;align-items:center;gap:3px;}
  .bf-tag{display:flex;align-items:center;gap:3px;padding:1px 3px 1px 6px;border-radius:3px;font-size:9px;line-height:1.5;font-weight:600;color:var(--acc);background:var(--acc-dim);border:1px solid var(--acc2);white-space:nowrap;}
  .bf-tag-x{display:flex;align-items:center;justify-content:center;width:11px;height:11px;padding:0;border:none;border-radius:50%;background:transparent;color:var(--acc);font-size:10px;line-height:1;cursor:pointer;flex-shrink:0;}
  .bf-tag-x:hover{background:var(--acc2);color:var(--bg1);}
  .rank-bar{display:flex;align-items:center;gap:6px;padding:4px 0 2px;}
    .rank-rare{display:flex;align-items:center;gap:3px;font-size:9px;color:var(--t3);cursor:pointer;user-select:none;}
  .rank-rare input{margin:0;cursor:pointer;}
  .rank-rare[hidden]{display:none;}
  .rank-list{
    flex:1;min-height:220px;overflow-y:auto;
    border:1px solid var(--bd);border-radius:3px;
    scrollbar-width:none;
    background:
      linear-gradient(var(--bg1) 30%, rgba(0,0,0,0)) top    / 100% 16px no-repeat local,
      linear-gradient(rgba(0,0,0,0), var(--bg1) 70%) bottom / 100% 16px no-repeat local,
      radial-gradient(farthest-side at 50% 0,    rgba(0,0,0,.20), rgba(0,0,0,0)) top    / 100% 7px no-repeat scroll,
      radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.20), rgba(0,0,0,0)) bottom / 100% 7px no-repeat scroll,
      var(--bg1);
  }
  .rank-list::-webkit-scrollbar{display:none;}
  .rank-head,.rank-row{display:grid;grid-template-columns:minmax(0,1fr) 62px 54px 48px 48px 66px;align-items:center;gap:8px;padding:3px 8px;font-size:12.5px;line-height:1.5;}
  .rank-list.has-gap .rank-head,.rank-list.has-gap .rank-row{grid-template-columns:minmax(0,1fr) 62px 54px 48px 48px 66px 56px;}
  .rank-head{position:sticky;top:0;z-index:1;background:var(--bg2);color:var(--t3);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--bd);}
  .rank-sortable{cursor:pointer;user-select:none;white-space:nowrap;}
  .rank-sortable:hover{color:var(--t1);}
  .rank-sortable.is-sorted{color:var(--acc);}
  .rank-row{cursor:pointer;border-bottom:1px solid var(--bd);}
  .rank-row:last-child{border-bottom:none;}
  .rank-row:hover{background:var(--acc-dim);}
  .rank-tex{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--t1);}
  .rank-col{text-align:right;font-variant-numeric:tabular-nums;}
  .rank-num{color:var(--t1);font-weight:600;}
  .rank-dim{color:var(--t3);font-weight:400;}
  .rank-pos{color:var(--grn);}
  .rank-neg{color:var(--red);}
  .rank-msg{padding:6px;font-size:11px;color:var(--t3);}
  .vs-toggle-wrap{display:flex;align-items:center;gap:8px;margin-top:6px;}
  /* The Short Deck switch in the top bar (drawn by setupGameToggle). */
  .game-tog{display:flex;align-items:center;gap:7px;cursor:pointer;user-select:none;flex-shrink:0;}
  .game-tog .vs-toggle-label{white-space:nowrap;}
  .game-tog.fixed{cursor:default;}
  .game-tog-tag{font-size:10px;font-weight:700;letter-spacing:.4px;color:var(--acc);border:1px solid var(--acc);background:var(--acc-dim);border-radius:9px;padding:2px 8px;white-space:nowrap;}
  .rtab.rtab-off{opacity:.38;cursor:not-allowed;}
  .vs-toggle-label{font-size:10px;font-weight:600;color:var(--t2);cursor:pointer;user-select:none;}
  .vs-toggle-switch{position:relative;width:32px;height:18px;background:var(--bg3);border:1px solid var(--bd);border-radius:9px;cursor:pointer;transition:background .2s, border-color .2s;flex-shrink:0;}
  .vs-toggle-switch.on{background:var(--acc-dim);border-color:var(--acc);}
  .vs-toggle-knob{position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:var(--t3);transition:transform .2s, background .2s;}
  .vs-toggle-switch.on .vs-toggle-knob{transform:translateX(14px);background:var(--acc);}
  :root {
    --bar-track:    #0e1014;
    --bar-track-bd: #343b46;
  }
  [data-theme="light"] {
    --bar-track:    #dde1e7;
    --bar-track-bd: #bfc6d0;
  }
  .ph-row{display:flex;align-items:center;padding:5px 6px;border-radius:var(--rad-sm);background:var(--bg2);border:1px solid var(--bd);margin-bottom:2px;gap:8px;}
  .ph-row-name{font-size:10px;font-weight:700;color:var(--t2);text-transform:uppercase;letter-spacing:.5px;white-space:nowrap;min-width:90px;}
  .ph-row-bar{flex:1;height:7px;background:var(--bar-track);border:1px solid var(--bar-track-bd);border-radius:4px;overflow:hidden;}
  .ph-row-fill{height:100%;border-radius:3px;background:var(--acc);transition:width .4s;}
  .ph-row-pct{font-size:10px;font-weight:700;color:var(--t1);min-width:40px;text-align:right;}
  [id$="-draws"] .ph-row-name{
    width:132px;
    min-width:132px;
    flex-shrink:0;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  [id$="-made"] .ph-row-name,
  [id$="-made"] .accord-hdr-title{
    width:108px;
    min-width:108px;
    flex-shrink:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .accord-arrow-gap{width:16px;flex-shrink:0;}
  #tbl-made .ph-row-name,
  #tbl-made .accord-hdr-title,
  #tbl-made .accord-row-name,
  #tbl-draws .ph-row-name {
    cursor: pointer;
    text-decoration: none;
    transition: color .12s;
  }
  #tbl-made .ph-row-name:hover,
  #tbl-made .accord-hdr-title:hover,
  #tbl-made .accord-row-name:hover,
  #tbl-draws .ph-row-name:hover {
    color: var(--acc);
  }
  .ph-row-name.cat-lit,
  .accord-hdr-title.cat-lit,
  .accord-row-name.cat-lit {
    color: var(--org-lt);
    text-decoration: underline solid var(--org);
    text-underline-offset: 3px;
  }
  .cat-lock-mark {
    font-size: 8px;
    margin-left: 4px;
    opacity: .85;
    vertical-align: middle;
    pointer-events: none;
  }
  .lock-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    padding: 3px 7px;
    border-radius: var(--rad-sm);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    color: var(--org-lt);
    background: var(--org-dim);
    border: 1px solid var(--org);
  }
  .lock-btn:hover { background: color-mix(in srgb, var(--org) 22%, transparent); }
  .lock-btn.hidden { display: none; }
  .lock-btn-icon  { font-size: 9px; }
  .lock-btn-count { font-variant-numeric: tabular-nums; }
  .radio-opt.locked,
  .chart-range-btn.locked,
  .chart-pos-pill.locked {
    border-color: var(--org);
    color: var(--org-lt);
  }
  .radio-opt.locked.active,
  .chart-range-btn.locked.active,
  .chart-pos-pill.locked.active {
    border-color: var(--org);
    color: var(--acc);
  }
  .eq-lbl.eq-locked,
  .mw-eq-lbl.eq-locked { text-shadow: 0 0 6px color-mix(in srgb, var(--org) 45%, transparent); }
  .eq-lock-mark { font-size: 8px; margin-right: 3px; opacity: .85; }
  .lock-note {
    font-size: 10px;
    font-weight: 600;
    color: var(--org-lt);
    background: var(--org-dim);
    border: 1px solid var(--org);
    border-radius: var(--rad-sm);
    padding: 4px 7px;
    margin: 4px 0 0;
  }
  .lock-note.hidden { display: none; }
  #eq-wrap-hu.cat-filtered .eq-bar {
    box-shadow: 0 0 0 1px var(--org);
  }
  #eq-wrap-hu.cat-pending .eq-bar { opacity: .35; }
  #eq-wrap-mw.cat-pending .mw-eq-labels { opacity: .45; }
  .row-apart{display:flex;align-items:center;justify-content:space-between;}  .pos-pills {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: 6px;
  }
  .pos-pill {
    padding: 3px 8px;
    border-radius: var(--rad-sm);
    font-size: 10px;
    font-weight: 700;
    background: var(--bg2);
    color: var(--t2);
    border: 1px solid var(--bd);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
  }
  .pos-pill:hover { border-color: var(--bd2); color: var(--t1); }
  .pos-pill.hero { background: var(--acc-dim); color: var(--acc); border-color: var(--acc); }
  .pos-pill.folded { background: var(--bg2); color: var(--t3); border-color: var(--bd); opacity: 0.4; text-decoration: line-through; }
  .range-membership-badge {
    display: none;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: var(--rad-sm);
    border: 1px solid;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    width: fit-content;
  }.range-status {
    font-size: 9px;
    color: var(--t3);
    margin-top: 3px;
  }
  .range-status.ok  { color: var(--grn); }
  .range-status.err { color: var(--red, #e05); }
  .accord-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 6px;
    cursor: pointer;
    border-radius: var(--rad-sm);
    user-select: none;
    background: var(--bg2);
    border: 1px solid var(--bd);
    margin-bottom: 2px;
  }
  .accord-hdr:hover { border-color: var(--bd2); }
  .accord-hdr.open { border-color: var(--acc2); background: var(--acc-dim); }  .accord-hdr-title { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--t2); }
  .accord-hdr.open .accord-hdr-title { color: var(--acc); }
  .accord-hdr-pct { font-size: 10px; font-weight: 700; color: var(--t1); min-width: 40px; text-align: right; }
  .accord-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    color: var(--t2);
    background: var(--bg3);
    border: 1px solid var(--bd2);
    border-radius: var(--rad-sm);
    cursor: pointer;
    transition: transform .2s, background .12s, color .12s, border-color .12s;
  }
  .accord-arrow:hover {
    color: var(--acc);
    background: var(--acc-dim);
    border-color: var(--acc2);
  }
  .accord-hdr.open .accord-arrow {
    transform: rotate(180deg);
    color: var(--acc);
    border-color: var(--acc2);
  }
  .accord-hdr { cursor: default; }
  .accord-body { display: none; margin-bottom: 4px; border: 1px solid var(--bd); border-radius: var(--rad-sm); overflow: hidden; }
  .accord-body.open { display: block; }
  .accord-row { display: flex; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--bg3); }
  .accord-row:last-child { border-bottom: none; }
  .accord-row:hover { background: var(--bg3); }
  .accord-row-name { flex: 1; font-size: 10px; color: var(--t2); }
  .accord-row-pct { width: 44px; text-align: right; font-size: 10px; font-weight: 600; color: var(--t1); }
  .accord-row-combos { width: 44px; text-align: right; font-size: 10px; color: var(--t3); }  .suit-filter-row {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 5px 10px; border-top: 1px solid var(--bd); background: var(--bg1);
    flex-shrink: 0; min-height: 26px;
  }  .suit-filter-row .sel { font-size: 10px; padding: 3px 6px; }
  .sf-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
  .sf-tag {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px;
    font-size: 12px; font-weight: 700; line-height: 1; border-radius: 10px;
    border: 1.5px solid; background: var(--bg2); cursor: pointer;
    user-select: none; transition: opacity .15s;
  }
  .sf-tag:hover { opacity: .65; }
  .sf-tag-x { opacity: .55; font-size: 11px; font-weight: 400; }
  .sf-mode {
    padding: 2px 8px; font-size: 9px; font-weight: 700; letter-spacing: .4px;
    text-transform: uppercase; background: transparent; color: var(--t2);
    border: 1px solid var(--bd); border-radius: 10px; cursor: pointer;
    transition: color .15s, border-color .15s;
  }
  .sf-mode:hover { border-color: var(--bd2); }
  .sf-mode.only { color: var(--org); border-color: var(--org); }
  .tbl-dd { position: relative; flex-shrink: 0; }
  .tbl-dd-btn {
    display: inline-flex; align-items: center; gap: 5px;
    height: 22px; padding: 0 7px;
    font-size: 10px; font-weight: 600; line-height: 1; white-space: nowrap;
    background: var(--bg2); color: var(--t2);
    border: 1px solid var(--bd); border-radius: var(--rad-sm);
    cursor: pointer; user-select: none; transition: border-color .15s, color .15s;
  }
  .tbl-dd-btn:hover { border-color: var(--bd2); color: var(--t1); }
  .tbl-dd-btn.open  { border-color: var(--acc); color: var(--t1); }
  .tbl-dd-caret { font-size: 8px; opacity: .6; }
  .tbl-dd-menu {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
    display: flex; flex-direction: column; min-width: 92px; padding: 3px;
    background: var(--bg2); border: 1px solid var(--bd2);
    border-radius: var(--rad-sm); box-shadow: 0 4px 14px rgba(0,0,0,.35);
  }
  .tbl-dd-item {
    position: relative;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 5px 7px; border-radius: var(--rad-sm);
    font-size: 10px; font-weight: 600; color: var(--t2);
    cursor: default; user-select: none; white-space: nowrap;
  }
  .tbl-dd-item:hover, .tbl-dd-item.open { background: var(--bg1); color: var(--t1); }
  .tbl-dd-arrow { font-size: 11px; opacity: .55; }
  .tbl-dd-sub {
    display: none;
    position: absolute; top: -3px; left: calc(100% + 3px);
    flex-wrap: wrap; gap: 3px; width: 78px; padding: 3px;
    background: var(--bg2); border: 1px solid var(--bd2);
    border-radius: var(--rad-sm); box-shadow: 0 4px 14px rgba(0,0,0,.35);
  }
  .tbl-dd-item.open .tbl-dd-sub { display: flex; }
  .tbl-dd-opt {
    width: 22px; height: 22px; padding: 0;
    font-size: 10px; font-weight: 700; line-height: 1;
    background: var(--bg3); color: var(--t2);
    border: 1px solid var(--bd); border-radius: var(--rad-sm);
    cursor: pointer; transition: color .12s, border-color .12s, background .12s;
  }
  .tbl-dd-opt:hover  { color: var(--t1); border-color: var(--bd2); }
  .tbl-dd-opt.active { color: var(--acc); border-color: var(--acc); background: var(--acc-dim); }
  .suit-dd { position: relative; flex-shrink: 0; }
  .suit-dd-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 22px; padding: 0 6px;
    font-size: 14px; font-weight: 700; line-height: 1;
    background: var(--bg2); color: var(--t2);
    border: 1px solid var(--bd); border-radius: var(--rad-sm);
    cursor: pointer; user-select: none; transition: border-color .15s, color .15s;
  }
  .suit-dd-btn:hover { border-color: var(--bd2); color: var(--t1); }
  .suit-dd-btn.open { border-color: var(--bd2); }
  .suit-dd-menu {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 40;
    display: flex; gap: 2px; padding: 4px;
    background: var(--bg2); border: 1px solid var(--bd2);
    border-radius: var(--rad-sm); box-shadow: 0 6px 20px rgba(0,0,0,.35);
  }
  .suit-dd-opt {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; font-size: 20px; line-height: 1;
    background: transparent; border: 1px solid transparent; border-radius: var(--rad-sm);
    cursor: pointer; transition: background .12s, border-color .12s;
  }
  .suit-dd-opt:hover { background: var(--bg1); border-color: currentColor; }
  .suit-dd-opt.sh { color: var(--sh); }
  .suit-dd-opt.sd { color: var(--sd); }
  .suit-dd-opt.ss { color: var(--ss); }
  .suit-dd-opt.sc { color: var(--sc); }
  .sf-paint-wrap {
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
    font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .4px;
    cursor: pointer; user-select: none;
  }
  .sf-paint-wrap input { accent-color: var(--org); cursor: pointer; margin: 0; }
  .suit-filter-row.paint-on .sf-paint-wrap,
  .suit-filter.paint-on .sf-paint-wrap { color: var(--org); }  .suit-groups-strip {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 5px 10px; border-top: 1px solid var(--bd); background: var(--bg1);
    flex-shrink: 0; min-height: 26px;
  }
  .sg-pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
    font-size: 13px; font-weight: 700; line-height: 1; border-radius: 10px;
    border: 1.5px solid; background: var(--bg2); cursor: pointer;
    user-select: none; transition: opacity .15s;
  }
  .sg-pill:hover { opacity: .6; }
  .sg-pill .sg-only { font-size: 8px; color: var(--org); text-transform: uppercase; letter-spacing: .3px; }
  .sg-pill .sg-cnt  { font-size: 9px; color: var(--t3); font-weight: 600; }
  .hgrid.sf-on .hc:not(.sf-lit):not(.sf-keep) { filter: brightness(.5) saturate(.65); }
  [data-theme="light"] .hgrid.sf-on .hc:not(.sf-lit):not(.sf-keep) { filter: opacity(.4) saturate(.45); }
  .hgrid .hc.sf-lit { padding-bottom: clamp(6px, calc(21.7cqw / var(--grid-n, 13)), calc(156px / var(--grid-n, 13))); }
  .hgrid .hc.sf-lit .hc-sfm { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
  .hgrid .hc.hov-hl .hc-sfm,
  .hgrid .hc.tc-lit .hc-sfm { display: none; }
  .hgrid .hc.sf-lit:has(.hc-wb) .hc-tc-pips { padding-bottom: clamp(4px, calc(13.65cqw / var(--grid-n, 13)), calc(104px / var(--grid-n, 13))); }
  .hc-wb {
    position: absolute; z-index: 3;
    left: 2px; right: 2px; bottom: 2px;
    height: 3px; border-radius: 2px;
    background: rgba(10,12,18,.5);
    overflow: hidden;
    pointer-events: none;
  }
  .hc-wb > i {
    display: block; height: 100%;
    width: calc(var(--wt-pct) * 1%);
    background: var(--wt-colour);
    border-radius: 2px;
  }
  .hgrid .hc-wb {
    left: clamp(1px, .45cqw, 3px); right: clamp(1px, .45cqw, 3px);
    bottom: clamp(1px, .3cqw, 2px);
    height: clamp(2px, .6cqw, 4px);
  }
  [data-theme="light"] .hc-wb { background: rgba(0,0,0,.2); }
  .hc.tc-lit .hc-wb,
  .hc.hov-hl .hc-wb { display: none; }
  .hgrid.tc-dim .hc.tc-lit::after { opacity: 0; }
  .hgrid.tc-dim .hc:not(.tc-lit) {
    filter: brightness(.5) saturate(.65);
  }
  [data-theme="light"] .hgrid.tc-dim .hc:not(.tc-lit) {
    filter: opacity(.4) saturate(.45);
  }
  .hgrid.tc-dim .hc.tc-lit {
    box-shadow: 0 0 0 1.5px var(--hc-ring);
    z-index: 7;
    padding-bottom: clamp(6px, calc(21.7cqw / var(--grid-n, 13)), calc(156px / var(--grid-n, 13)));
    outline: none !important;
  }
  .hgrid .hc.tc-lit .hc-tc,
  .hgrid .hc.hov-hl .hc-tc {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
  }
  .hgrid .hc.tc-lit .hc-tc-frac,
  .hgrid .hc.hov-hl .hc-tc-frac,
  .hgrid .hc.sf-lit .hc-tc-frac {
    position: absolute;
    top: clamp(0px, .15cqw, 1px); right: clamp(1px, .45cqw, 3px);
    font-size: clamp(6px, calc(17.68cqw / var(--grid-n, 13)), calc(130px / var(--grid-n, 13)));
    font-weight: 800;
    line-height: 1;
    color: inherit;
  }
  /* Suit pips: a dark strip along the bottom of the cell keeps the four
     suit colours readable on suited, offsuit and pair cells alike. Active
     suits are solid; excluded suits are drawn as a grey outline of the
     same glyph so they read by shape as well as colour. */
  .hgrid .hc.tc-lit .hc-tc-pips,
  .hgrid .hc.hov-hl .hc-tc-pips,
  .hgrid .hc.sf-lit .hc-tc-pips {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex; justify-content: center; align-items: center;
    gap: clamp(1px, calc(3.9cqw / var(--grid-n, 13)), calc(26px / var(--grid-n, 13)));
    padding: clamp(1px, calc(3.9cqw / var(--grid-n, 13)), calc(26px / var(--grid-n, 13))) 0;
    background: var(--pip-strip);
    border-radius: 0 0 2px 2px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: clamp(9px, calc(29.25cqw / var(--grid-n, 13)), calc(221px / var(--grid-n, 13)));
    font-weight: 400;
    line-height: 1;
  }
  .hgrid .hc.tc-lit .hc-tc-pip:nth-child(1),
  .hgrid .hc.sf-lit .hc-tc-pip:nth-child(1),
  .hgrid .hc.hov-hl .hc-tc-pip:nth-child(1) { color: var(--pip-h) !important; }
  .hgrid .hc.tc-lit .hc-tc-pip:nth-child(2),
  .hgrid .hc.sf-lit .hc-tc-pip:nth-child(2),
  .hgrid .hc.hov-hl .hc-tc-pip:nth-child(2) { color: var(--pip-d) !important; }
  .hgrid .hc.tc-lit .hc-tc-pip:nth-child(3),
  .hgrid .hc.sf-lit .hc-tc-pip:nth-child(3),
  .hgrid .hc.hov-hl .hc-tc-pip:nth-child(3) { color: var(--pip-s) !important; }
  .hgrid .hc.tc-lit .hc-tc-pip:nth-child(4),
  .hgrid .hc.sf-lit .hc-tc-pip:nth-child(4),
  .hgrid .hc.hov-hl .hc-tc-pip:nth-child(4) { color: var(--pip-c) !important; }
  .hgrid .hc.tc-lit .hc-tc-pip.off,
  .hgrid .hc.sf-lit .hc-tc-pip.off,
  .hgrid .hc.hov-hl .hc-tc-pip.off {
    color: transparent !important;
    -webkit-text-stroke: max(.7px, .07em) var(--pip-off);
    opacity: 1;
  }
  .hc-sb {
    position: absolute; top: 1px; right: 1px; z-index: 3;
    display: flex; align-items: center; gap: 1px;
    background: rgba(10,12,18,.78); border-radius: 3px; padding: 0 2px;
    font-size: 8px; line-height: 11px; font-weight: 700;
    pointer-events: none;
  }
  .hgrid .hc-sb {
    font-size: clamp(5px, 1.21cqw, 9px);
    line-height: clamp(7px, 1.67cqw, 11px);
    padding: 0 clamp(1px, .3cqw, 2px);
    border-radius: clamp(2px, .45cqw, 3px);
  }
  [data-theme="light"] .hc-sb { background: rgba(255,255,255,.85); }
  .hc-sb.only { outline: 1px solid var(--t2); }
  body.suit-paint-on .hgrid .hc { cursor: crosshair; }
  .suit-dd-btn.suits-btn {
    min-width: 0; gap: 4px; padding: 0 8px;
    font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  }
  .suit-dd-btn.suits-btn .sfb-plus { color: var(--acc); font-size: 13px; font-weight: 800; line-height: 1; }
  .suit-filter-row .sf-paint-wrap { margin-left: auto; }
  .cols    { grid-template-columns: minmax(380px, 1.65fr) minmax(185px, 0.85fr) 2fr; }
  .cols-hvr { grid-template-columns: minmax(190px, 1fr) minmax(210px, 1fr) 2fr; }
  body:has(#mw-toggle) .cols{
    grid-template-columns: minmax(380px, 1.9fr) minmax(210px, 0.68fr) 1.94fr;
  }
  /* Boards tab: the board and card picker is not used there (the tab works
     from its own filters), so the middle column goes and the right panel
     takes its room -- unless the saved-ranges library is open in it. The
     tab's content is drawn 15% larger in the extra space, and "+ Ranges"
     moves up beside the range controls. */
  body:has(#tab-boards.active) .cols > .col-mid:not(.lib-open){ display: none; }
  body:has(#mw-toggle):has(#tab-boards.active) .cols:not(:has(> .col-mid.lib-open)){
    grid-template-columns: minmax(380px, 1.9fr) 2.62fr;
  }
  #tab-boards { zoom: 1.15; }
  .boards-only { display: none; flex-shrink: 0; }
  body:has(#tab-boards.active) .boards-only { display: inline-block; }
  body:has(#mw-toggle) .cols > .col > .sec{
    height: 40px; padding: 0 10px;
    display: flex; align-items: center; gap: 6px;
    flex-wrap: nowrap; overflow: hidden;
  }
  body:has(#mw-toggle) .cols > .col > .sec > :first-child{ flex: none; }
  body:has(#mw-toggle) #ranking{ min-width: 84px; flex-shrink: 1; }
  body:has(#mw-toggle) #mw-controls{
    margin-top: 0 !important;
    flex: 1 1 auto; min-width: 0;
    overflow-x: auto; scrollbar-width: none;
  }
  body:has(#mw-toggle) #mw-controls::-webkit-scrollbar{ display: none; }
  body:has(#mw-toggle) #mw-controls.hidden{ display: none; }
  body:has(#mw-toggle) #mw-pos-pills{ flex-wrap: nowrap !important; }
  body:has(#mw-toggle) #mw-pos-pills > *{ flex-shrink: 0; }
  body:has(#mw-toggle) .cols > .col > .suit-filter-row{ height: 33px; flex-wrap: nowrap; }
  body:has(#mw-toggle) .cols > .col > .weight-row{ height: 36px; padding-top: 0; padding-bottom: 0; }
  body:has(#mw-toggle) .board-panel > .row-apart{ height: 20px; }
  body:has(#mw-toggle:checked) .cols > .col > .sec{
    height: auto; padding: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    overflow: visible;
    position: relative; z-index: 20;
  }
  body:has(#mw-toggle:checked) .cols > .col > .sec > :first-child{
    height: 40px; padding: 0 10px;
  }
  body:has(#mw-toggle:checked) #mw-controls{
    flex: none;
    padding: 6px 10px;
    border-top: 1px solid var(--bd);
    overflow: visible;
  }
  body:has(#mw-toggle:checked) #mw-pos-pills{ flex-wrap: wrap !important; gap: 4px; }
  .sec     { padding: 8px 10px; }
  .sec-hdr { margin-top: 8px; }
  .mw-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--t2);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: var(--rad-sm);
    background: var(--bg2);
    border: 1px solid var(--bd);
  }
  .mw-toggle-wrap:has(input:checked) {
    background: var(--acc-dim);
    color: var(--acc);
    border-color: var(--acc2);
  }
  .mw-toggle-wrap input[type="checkbox"] {
    accent-color: var(--acc);
    width: 13px;
    height: 13px;
    cursor: pointer;
    margin: 0;
  }
  .hidden { display: none !important; }
  .mw-eq-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 11px;
    font-weight: 600;
  }
  .analysis-top-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 4px 10px 2px;
    gap: 6px;
    flex-shrink: 0;
    min-height: 0;
  }  .turn-cards-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
  .tc-tip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: var(--bg1);
    border: 1px solid var(--org);
    border-radius: 6px;
    padding: 8px 13px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .2px;
    color: var(--org);
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  }.chart-tab-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 8px 10px;
    box-sizing: border-box;
    gap: 8px;
  }
  .chart-range-sel { display: flex; gap: 0; flex-shrink: 0; }
  .chart-range-btn {
    flex: 1;
    padding: 5px 0;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--bd);
    background: var(--bg2);
    color: var(--t2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .chart-range-btn:first-child { border-radius: 4px 0 0 4px; }
  .chart-range-btn:last-child  { border-radius: 0 4px 4px 0; border-left: none; }
  .chart-range-btn.active-a { background: var(--range-a); color: #fff; border-color: var(--range-a); }
  .chart-range-btn.active-b { background: var(--range-b); color: #fff; border-color: var(--range-b); }
  .chart-area { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
  .chart-area svg { max-width: 100%; max-height: 100%; overflow: visible; }
  .chart-area.cat-pending > * { opacity: .45; transition: opacity .15s; }
  .chart-legend { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 0 2px; border-top: 1px solid var(--bd); }
  .chart-legend:empty { display: none; }
  .chart-legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--t2); white-space: nowrap; }
  .chart-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .chart-empty { font-size: 11px; color: var(--t3); text-align: center; padding: 20px 0; }
  .chart-mode-pills { display: flex; gap: 3px; }
  .chart-field-sel { display: flex; gap: 3px; flex-shrink: 0; }
  /* Coloured range / seat names along the top of Categories and Buckets */
  .chart-keys { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10px; font-weight: 700; padding-bottom: 4px; }
  .chart-key { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
  .chart-key i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  /* Categories: names down the middle, Range A's bars to the left, Range B's to the right */
  .cc { width: 100%; height: 100%; display: flex; flex-direction: column; min-height: 0; }
  .cc-head { flex-shrink: 0; font-size: 10px; color: var(--t3); padding: 0 0 4px; border-bottom: 1px solid var(--bd); }
  .cc-head .cc-side { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cc-head .cc-side.b { text-align: right; }
  .cc-head .cc-mid { text-align: center; }
  /* Rows grow to fill a tall panel, up to a point, and scroll when there are too many. */
  .cc-body { flex: 1; min-height: 0; overflow-y: auto; padding-top: 2px; display: flex; flex-direction: column; scrollbar-width: none; }
  .cc-body::-webkit-scrollbar { display: none; }
  .cc-switch { flex-shrink: 0; display: flex; gap: 3px; padding-bottom: 6px; }
  .cc-mirror { display: grid; grid-template-columns: 1fr minmax(96px, 150px) 1fr; align-items: center; }
  .cc-band { flex: none; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); text-align: center; padding: 8px 0 2px; }
  .cc-row { flex: none; border-radius: 3px; }
  .cc-row.cc-mirror { flex: 1 0 20px; max-height: 30px; align-items: stretch; }
  .cc-row:hover { background: var(--bg2); }
  .cc-row.cc-grp { cursor: pointer; user-select: none; }
  .cc-half { display: flex; align-items: center; gap: 4px; min-width: 0; }
  .cc-half.a { justify-content: flex-end; }
  .cc-bar { height: clamp(10px, 50%, 15px); min-width: 1px; flex: none; border-radius: 2px; }
  .cc-half.a .cc-bar { border-radius: 2px 0 0 2px; }
  .cc-half.b .cc-bar { border-radius: 0 2px 2px 0; }
  .cc-half.lose .cc-bar { opacity: .45; }
  .cc-kid .cc-bar { height: clamp(8px, 40%, 11px); }
  .cc-val { flex: none; width: 38px; font-size: 10px; color: var(--t3); font-variant-numeric: tabular-nums; }
  .cc-half.a .cc-val { text-align: right; }
  .cc-val.lead { color: var(--t1); font-weight: 700; }
  .cc-label { align-self: center; font-size: 10px; color: var(--t1); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
  .cc-grp .cc-label { font-weight: 700; }
  .cc-kid .cc-label { color: var(--t2); }
  .cc-caret { display: inline-block; width: 10px; margin-right: 3px; color: var(--t3); transition: transform .15s; }
  .cc-grp.open .cc-caret { transform: rotate(90deg); color: var(--acc); }
  /* Multiway: a table, one column per seat (Categories) or one row per seat (Buckets) */
  .cc-table { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; font-size: 10px; }
  .cc-table th { padding: 4px 2px; font-size: 10px; font-weight: 700; color: var(--t2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cc-table th small { display: block; font-size: 9px; font-weight: 400; color: var(--t3); }
  .cc-table th.focus { text-decoration: underline; text-underline-offset: 3px; }
  .cc-table th.cc-tname { width: 26%; }
  .cc-table td { padding: 6px 2px; border-radius: 3px; text-align: center; color: var(--t1); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .cc-table td.cc-tname { text-align: left; padding-left: 6px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
  .cc-table .cc-label { text-align: left; padding: 0; }
  .cc-table .cc-kid .cc-label { padding-left: 13px; }
  .cc-table td.cc-cell { background: var(--bg2); }
  .cc-table td.cc-cell.focus, .cc-table tr.focus td.cc-cell { box-shadow: inset 0 0 0 1px var(--acc); }
  .cc-table tr.cc-row:hover td.cc-tname { background: var(--bg2); }
  .bk-table td { padding: 9px 2px; font-size: 11px; }
  /* Buckets */
  .bk { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
  .bk-cols { flex: 1; min-height: 90px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 4px 0; border-bottom: 1px solid var(--bd); }
  .bk-group { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; min-width: 0; }
  .bk-col { position: relative; flex: 1; max-width: 40px; min-width: 3px; border-radius: 3px 3px 0 0; }
  .bk-col span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 2px; font-size: 10px; font-weight: 700; color: var(--t1); white-space: nowrap; }
  .bk-lbls { flex-shrink: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
  .bk-lbls b { display: block; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--t2); }
  .bk-lbls small { font-size: 10px; color: var(--t3); }
  /* Equity curve stepper: one set of buttons, each range's hand listed beside them */
  .ec-stepper { flex-shrink: 0; }
  .ec-step-row { display: flex; align-items: center; gap: 3px; padding: 4px 6px; border: 1px solid var(--bd); border-radius: var(--rad-sm); background: var(--bg2); }
  .ec-step-btn { flex: none; width: 24px; height: 20px; padding: 0; border: 1px solid var(--bd2); border-radius: var(--rad-sm); background: var(--bg3); color: var(--t2); font-size: 9px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
  .ec-step-btn:hover { color: var(--acc); background: var(--acc-dim); border-color: var(--acc2); }
  .ec-step-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-left: 8px; }
  .ec-step-lines.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 14px; }
  .ec-step-lines.grid3 .ec-step-lbl { flex-basis: 46px; }
  .ec-step-line { display: flex; align-items: center; gap: 8px; font-size: 10px; min-width: 0; }
  .ec-step-lbl { flex: 0 0 64px; font-weight: 700; color: var(--ec-c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ec-step-val { flex: 1; min-width: 0; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ec-step-val b { color: var(--ec-c); }
  .ec-step-dim { color: var(--t3); }
  .ec-seatbar { flex-shrink: 0; padding: 0 0 5px; }
  .ec-seat-cap {
    font-size: 10px; color: var(--t3); height: 13px; line-height: 13px;
    white-space: nowrap; overflow: hidden;
  }
  .ec-seat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 3px;
  }
  .ec-seat {
    display: flex; flex-direction: column; gap: 1px;
    height: 30px; min-width: 0; padding: 3px 6px;
    border: 1px solid var(--bd); border-radius: 4px;
    background: var(--bg2); color: var(--t2);
    font: inherit; text-align: left; overflow: hidden;
    transition: background .12s, border-color .12s;
  }
  .ec-seat.pick { cursor: pointer; }
  .ec-seat.pick:hover { border-color: var(--ec-c); }
  .ec-seat.active { border-color: var(--ec-c); background: color-mix(in srgb, var(--ec-c) 16%, var(--bg2)); }
  .ec-seat-top {
    display: flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; color: var(--ec-c);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ec-seat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ec-c); flex: none; }
  .ec-seat-val {
    font-size: 10px; color: var(--t2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ec-seat.dim .ec-seat-top { color: var(--t3); }
  .chart-pos-pills { display: flex; flex-wrap: wrap; gap: 3px; flex-shrink: 0; }
  .chart-pos-pill {
    padding: 3px 8px; font-size: 10px; font-weight: 700;
    border: 1px solid var(--bd); border-radius: 3px;
    background: var(--bg2); color: var(--t2); cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .chart-pos-pill.active { background: var(--acc); color: #fff; border-color: var(--acc); }
  .hgrid{display:grid;grid-template-columns:repeat(var(--grid-n,13),1fr);grid-template-rows:repeat(var(--grid-n,13),1fr);gap:2px;flex:1;min-height:0;overflow:hidden;user-select:none;container-type:inline-size;}
  .hgrid .hc { font-size: clamp(7px, calc(21.7cqw / var(--grid-n, 13)), calc(156px / var(--grid-n, 13))); }
  .hgrid-ranks { display: none !important; }
  .weight-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--bd);
    background: var(--bg1);
  }
  .weight-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--t2);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: var(--rad-sm);
    background: var(--bg2);
    border: 1px solid var(--bd);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .weight-toggle-wrap:has(input:checked) {
    background: color-mix(in srgb, var(--org) 12%, transparent);
    color: var(--org);
    border-color: var(--org);
  }
  .weight-toggle-wrap input[type="checkbox"] {
    accent-color: var(--org);
    width: 13px;
    height: 13px;
    cursor: pointer;
    margin: 0;
  }
  .weight-pct-display {
    font-size: 11px;
    font-weight: 700;
    color: var(--t2);
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
  }
  #weight-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    min-width: 0;
    background: var(--bg3);
    --wt-thumb-color: var(--acc);
  }
  #weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--wt-thumb-color);
    cursor: pointer;
    border: 2px solid var(--bg1);
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
    transition: background 0.1s;
  }
  #weight-commit-btn, #suit-commit-btn {
    display: none;
    flex-shrink: 0;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid var(--org);
    color: var(--org);
    background: transparent;
    border-radius: var(--rad-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
  }
  #weight-commit-btn:hover,
  #suit-commit-btn:hover { background: color-mix(in srgb, var(--org) 15%, transparent); }
  /* GTO's + Group button: same look as Range vs Range's. */
  #sf-commit-btn {
    flex-shrink: 0; padding: 3px 10px;
    font-family: inherit; font-size: 10px; font-weight: 700;
    border: 1px solid var(--org); color: var(--org); background: transparent;
    border-radius: var(--rad-sm); cursor: pointer; white-space: nowrap;
    transition: background 0.15s;
  }
  #sf-commit-btn[hidden] { display: none; }
  #sf-commit-btn:hover { background: color-mix(in srgb, var(--org) 15%, transparent); }
  .weight-groups-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 10px 5px;
    background: var(--bg1);
    border-bottom: 1px solid var(--bd);
    flex-shrink: 0;
    min-height: 26px;
  }
  .wg-hint {
    font-size: 10px;
    color: var(--t3);
    font-style: italic;
  }
  .wg-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px 2px 9px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    border: 1.5px solid;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
    user-select: none;
  }
  .wg-pill:hover { opacity: 0.65; }
  .wg-pill-x { opacity: 0.55; font-size: 12px; line-height: 1; font-weight: 400; }  #tab-flops .combos-cell,
  #tab-turns .combos-cell,
  #tab-rivers .combos-cell { display: none; }  .rtab-content {
    overflow-y: auto;
    scrollbar-width: none;
  }
  .rtab-content::-webkit-scrollbar {
    display: none;
  }
  .lib-open > .board-panel,
  .lib-open > .cards-panel { display: none !important; }
  .range-lib {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
    background: var(--bg1); border: 1px solid var(--bd); border-radius: var(--rad);
    overflow: hidden;
  }
  .rl-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px; border-bottom: 1px solid var(--bd); flex-shrink: 0; gap: 6px;
  }
  .rl-target { font-size: 9px; color: var(--t3); }
  .rl-target b { color: var(--t2); font-weight: 700; }
  .rl-tree {
    flex: 1; min-height: 0; overflow-y: auto;
    scrollbar-width: none;
    padding: 6px 8px; display: flex; flex-direction: column; gap: 2px;
  }
  .rl-tree::-webkit-scrollbar { display: none; }
  .rl-new-btn {
    display: block; width: 100%; text-align: left;
    padding: 4px 6px; margin-bottom: 4px;
    font-size: 10px; font-weight: 600; color: var(--t3);
    background: transparent; border: 1px dashed var(--bd); border-radius: var(--rad-sm);
    cursor: pointer; transition: color .15s, border-color .15s;
  }
  .rl-new-btn:hover { color: var(--acc); border-color: var(--acc); }
  .rl-frow {
    display: flex; align-items: center; gap: 5px;
    padding: 4px; border-radius: var(--rad-sm);
    cursor: pointer; user-select: none;
  }
  .rl-frow:hover { background: var(--bg3); }
  .rl-caret { width: 10px; font-size: 8px; color: var(--t3); text-align: center; flex-shrink: 0; }
  .rl-fname {
    flex: 1; min-width: 0; font-size: 11px; font-weight: 700; color: var(--t1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rl-children {
    margin-left: 9px; padding-left: 8px;
    border-left: 1px solid var(--bd);
    display: flex; flex-direction: column; gap: 1px;
  }
  .rl-rrow {
    display: flex; align-items: center; gap: 5px;
    padding: 3px 4px; border-radius: var(--rad-sm); cursor: pointer;
  }
  .rl-rrow:hover { background: var(--bg3); }
  .rl-rname {
    flex: 1; min-width: 0; font-size: 11px; color: var(--t2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rl-rrow:hover .rl-rname { color: var(--t1); }
  .rl-x {
    flex-shrink: 0; padding: 0 3px; font-size: 12px; line-height: 1;
    color: var(--t3); background: none; border: none; cursor: pointer;
    opacity: 0; transition: opacity .12s, color .12s;
  }
  .rl-frow:hover .rl-x, .rl-rrow:hover .rl-x { opacity: .7; }
  .rl-x:hover { color: var(--red); opacity: 1; }
  .rl-save-btn {
    display: block; width: 100%; text-align: left;
    padding: 3px 4px; font-size: 10px; font-weight: 600; color: var(--t3);
    background: transparent; border: none; border-radius: var(--rad-sm);
    cursor: pointer; transition: color .15s, background .15s;
  }
  .rl-save-btn:hover { color: var(--grn); background: var(--bg3); }
  .rl-inline { display: flex; align-items: center; gap: 4px; padding: 2px 0 3px; }
  .rl-inp {
    flex: 1; min-width: 0;
    background: var(--bg2); border: 1px solid var(--acc); border-radius: var(--rad-sm);
    color: var(--t1); padding: 3px 6px; font-size: 11px;
  }
  .rl-inp::placeholder { color: var(--t3); }
  .rl-ok {
    flex-shrink: 0; padding: 3px 8px; font-size: 10px; font-weight: 700;
    border: 1px solid var(--grn); color: var(--grn); background: transparent;
    border-radius: var(--rad-sm); cursor: pointer; transition: background .15s;
  }
  .rl-ok:hover { background: var(--grn-dim); }
  .rl-cancel {
    flex-shrink: 0; padding: 0 4px; font-size: 13px; line-height: 1;
    color: var(--t3); background: none; border: none; cursor: pointer;
  }
  .rl-cancel:hover { color: var(--red); }
  .rl-empty    { font-size: 10px; color: var(--t3); font-style: italic; padding: 8px 4px; }
  .rl-empty-sm { font-size: 10px; color: var(--t3); font-style: italic; padding: 2px 4px; }
  .rl-status {
    flex-shrink: 0; min-height: 22px;
    padding: 4px 10px; border-top: 1px solid var(--bd);
    font-size: 10px; color: var(--t3);
  }
  .rl-status.ok  { color: var(--grn); }
  .rl-status.err { color: var(--red); }
  :root {
    --cmp-name-w:   130px;
    --cmp-bar-w:    clamp(80px, 24%, 200px);
    --cmp-pct-w:    44px;
    --cmp-edge-w:   48px;
    --cmp-combos-w: 44px;
    --cmp-win-w:    60px;
    --cmp-fld-w:    28px;
  }
  .ph-row.row-cmp,
  .accord-hdr.row-cmp { gap: 8px; justify-content: flex-start; }
  .row-cmp .ph-row-name,
  .row-cmp .accord-hdr-title,
  [id$="-made"] .row-cmp .ph-row-name,
  [id$="-made"] .row-cmp .accord-hdr-title,
  [id$="-draws"] .row-cmp .ph-row-name {
    flex: 0 1 var(--cmp-name-w);
    width: var(--cmp-name-w);
    min-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  [id$="-draws"] .row-cmp .ph-row-name {
    flex-basis: calc(var(--cmp-name-w) + 24px);
    width: calc(var(--cmp-name-w) + 24px);
  }
  .row-cmp .ph-row-bar { flex: 0 1 var(--cmp-bar-w); width: var(--cmp-bar-w); min-width: 40px; }
  .row-cmp .ph-row-pct,
  .row-cmp .accord-hdr-pct { margin-left: auto; }
  .row-cmp .ph-row-fill { min-width: 3px; }
  .row-cmp .ph-row-fill.is-tiny { opacity: .5; }
  .row-cmp .ph-row-fill.is-zero { min-width: 0; }
  .row-cmp .ph-row-pct,
  .row-cmp .accord-hdr-pct,
  .row-cmp .accord-row-pct { flex: 0 0 var(--cmp-pct-w); width: var(--cmp-pct-w); min-width: 0; text-align: right; }
  .row-cmp .accord-row-combos { flex: 0 0 var(--cmp-combos-w); width: var(--cmp-combos-w); text-align: right; }
  .accord-row.row-cmp { gap: 8px; padding: 4px 6px; }
  .accord-row.row-cmp .accord-row-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .row-cmp .fld-btn { flex: 0 0 var(--cmp-fld-w); width: var(--cmp-fld-w); margin-left: 0; box-sizing: border-box; text-align: center; }
  .edge-cell {
    flex: 0 0 var(--cmp-edge-w);
    width: var(--cmp-edge-w);
    text-align: right;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--t3);
    cursor: default;
  }
  .edge-cell.edge-pos  { color: var(--grn); }
  .edge-cell.edge-neg  { color: var(--red-lt); }
  .edge-cell.edge-zero { color: var(--t3); }
  .win-cell {
    flex: 0 0 var(--cmp-win-w);
    width: var(--cmp-win-w);
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-left: 1px solid var(--bd);
    font-size: 10px;
    font-weight: 700;
    color: var(--t3);
    white-space: nowrap;
  }
  .win-cell.win-hi  { color: var(--grn); }
  .win-cell.win-mid { color: var(--org-lt); }
  .win-cell.win-lo  { color: var(--red-lt); }
  .cmp-sec { display: flex; align-items: flex-end; gap: 8px; padding-right: 7px; }
  .cmp-sec > .cmp-sec-title { flex: 1 1 auto; min-width: 0; }
  .cmp-cols { display: flex; gap: 8px; flex-shrink: 0; }
  .cmp-col { flex: 0 0 auto; text-align: right; white-space: nowrap; cursor: default; }
  .cmp-col.pct    { width: var(--cmp-pct-w); }
  .cmp-col.edge   { width: var(--cmp-edge-w); }
  .cmp-col.combos { width: var(--cmp-combos-w); }
  .cmp-col.win    { width: var(--cmp-win-w); color: var(--t2); }
  .cmp-col.fld    { width: var(--cmp-fld-w); display: none; }
  #tab-analysis:has(#blk-btn.on) .cmp-col.fld { display: block; }
  .cmp-sec:not(:has(+ * .row-cmp)) .cmp-cols { visibility: hidden; }
  .cmp-sec:not(:has(+ * .edge-cell)) .cmp-col.edge { display: none; }

  /* BIGGER ANALYSIS NUMBERS - start (delete this block to undo) */
  :root {
    --cmp-pct-w:    56px;
    --cmp-edge-w:   60px;
    --cmp-combos-w: 50px;
    --cmp-win-w:    70px;
  }
  .ph-row-pct,
  .accord-hdr-pct,
  .accord-row-pct,
  .accord-row-combos,
  .edge-cell,
  .win-cell { font-size: 13px; }
  .ph-row-pct,
  .accord-hdr-pct { min-width: 52px; }
  .accord-row-pct,
  .accord-row-combos { width: 56px; }
  /* BIGGER ANALYSIS NUMBERS - end */
