.wb {
  --m-clonk: #a9bccd;
  --m-fraggles: #eea27a;
  --m-grabble: #c79bff;
  --m-plasto: #5fd6df;
  --m-scrags: #f494c0;
  --m-gnomium: #f7cd55;
  --on-color: #14100c;
  position: relative; padding: 16px; font-size: 16px;
}
.wb .m-clonk { --m: var(--m-clonk); }
.wb .m-fraggles { --m: var(--m-fraggles); }
.wb .m-grabble { --m: var(--m-grabble); }
.wb .m-plasto { --m: var(--m-plasto); }
.wb .m-scrags { --m: var(--m-scrags); }
.wb .m-gnomium { --m: var(--m-gnomium); }
.wb [class*="m-boar"], .wb .m-marble, .wb .m-poopling, .wb .m-scrapling { --m: var(--mute); }
.wb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wb-h { margin: 0; font: 400 22px/1.2 var(--display); color: var(--ink); }
.wb-hint { margin: 0; color: var(--dim); font: 400 12px/1.4 var(--body); }
.wb-h .wb-hint { margin-left: 8px; }
.wb-empty { margin: 16px 0; color: var(--dim); }

/* banner + presets */
.wb-banner { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; margin-bottom: 12px; border-radius: 8px; background: var(--panel-2); color: var(--mute); font-size: 14px; }
.wb-banner b { color: var(--glow); font-weight: 600; }
.wb-banner-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-presets { display: flex; gap: 8px; align-items: center; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.wb-presets-label { color: var(--dim); font-size: 14px; }
.wb-preset { flex: none; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 14px; white-space: nowrap; }
.wb-preset:hover, .wb-preset.is-on { border-color: var(--cap); background: var(--cap-soft); }
.wb-sum { display: none; }

/* three columns */
.wb-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.wb-lib, .wb-queue, .wb-report { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.wb-lib { grid-row: span 2; }
.wb-queue { grid-column: 2 / 4; }
.wb-report { grid-column: 2 / 4; }

/* library controls */
.wb-tools { display: flex; gap: 8px; margin: 12px 0 8px; }
.wb-search { flex: 1; }
.wb-search input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.wb-sort { flex: none; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; }
.wb-sort:hover { border-color: var(--cap); }
.wb-seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 8px; border-radius: 999px; background: var(--panel); overflow-x: auto; scrollbar-width: none; }
.wb-seg button { flex: 1; min-height: 36px; padding: 4px 12px; border: 0; border-radius: 999px; background: none; color: var(--mute); font-size: 14px; font-weight: 600; white-space: nowrap; }
.wb-seg button[aria-pressed="true"] { background: var(--cap-btn); color: #fff; }
.wb-matf { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.wb-matpill { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--mute); font-size: 12px; }
.wb-matpill i { font-style: normal; }
.wb-matpill[aria-pressed="true"] { border-color: var(--m); color: var(--ink); box-shadow: inset 0 -3px 0 var(--m); }
.wb-group { margin: 16px 0 8px; color: var(--mute); font-size: 14px; font-weight: 600; }
.wb-group:first-child { margin-top: 0; }

/* cards */
.wb-cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.wb-card, .wb-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 124px; padding: 12px 4px 8px; border: 1px solid var(--line); border-top: 3px solid var(--m, var(--line)); border-radius: var(--r); background: var(--panel-2); color: var(--ink); text-align: center; -webkit-touch-callout: none; user-select: none; touch-action: manipulation; }
.wb-card:hover { border-color: var(--cap); border-top-color: var(--m); }
.wb-card.is-picked { box-shadow: inset 0 0 0 2px var(--cap); }
.wb-card.is-gnomium { border-color: rgba(247, 205, 85, .5); border-top-color: var(--m-gnomium); }
.wb-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: color-mix(in srgb, var(--m, var(--line)) 18%, transparent); font-size: 28px; line-height: 1; }
.wb-ico svg { width: 32px; height: 32px; }
.wb-name { font-size: 12px; font-weight: 600; line-height: 1.25; }
.wb-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.wb-pill { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border-radius: 999px; background: var(--m); color: var(--on-color); font-size: 12px; font-weight: 600; line-height: 20px; }
.wb-pill i { font-style: normal; font-size: 12px; }
.wb-badge { position: absolute; top: 4px; right: 4px; padding: 0 6px; border-radius: 999px; background: var(--cap); color: var(--on-color); font-size: 12px; font-weight: 600; line-height: 20px; }
.wb-badge:empty { display: none; }
.wb-gem { position: absolute; top: 4px; left: 6px; color: var(--m-gnomium); font-size: 14px; }

/* queue */
.wb-qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.wb-qhead .wb-h { flex: 1; }
.wb-text { min-height: 36px; padding: 4px 8px; border: 0; background: none; color: var(--mute); font-size: 14px; }
.wb-text:hover { color: var(--cap); }
.wb-copy { min-height: 36px; padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; }
.wb-copy:hover { border-color: var(--cap); }
.wb-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.wb-slot { min-height: 96px; justify-content: center; border: 1px dashed var(--line-2); border-top-width: 1px; background: none; color: var(--dim); font-size: 28px; }
.wb-slot.is-full { border: 1px solid var(--line); border-top: 3px solid var(--cap); background: var(--panel-2); color: var(--ink); font-size: 16px; }
.wb-slot.is-full .wb-ico { width: 40px; height: 40px; font-size: 22px; background: var(--cap-soft); }
.wb-slot.is-holding { animation: wb-hold .5s linear forwards; }
@keyframes wb-hold { to { box-shadow: inset 0 -96px 0 var(--cap-soft); } }

/* report */
.wb-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.wb-num { padding: 12px; border-radius: var(--r); background: var(--panel-2); }
.wb-num b { display: block; font: 400 36px/1.1 var(--display); color: var(--glow); }
.wb-num span { color: var(--mute); font-size: 12px; }
.wb-num-gold b { color: var(--m-gnomium); }
.wb-num-gold.is-zero b { color: var(--dim); }
.wb-mwrap { overflow-x: auto; }
.wb-mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.wb-mtable th, .wb-mtable td { padding: 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.wb-mtable thead th { color: var(--dim); font-size: 12px; font-weight: 600; }
.wb-mtable tbody th { font-weight: 600; white-space: nowrap; }
.wb-dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--m); }
.wb-need { color: var(--glow); font-weight: 600; font-size: 16px; }
.wb-steal { color: var(--mute); }
.wb-sep td { padding-top: 16px; color: var(--dim); font-size: 12px; font-weight: 600; }

/* tooltip */
.wb-tip { position: absolute; z-index: 5; width: 260px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); pointer-events: none; }
.wb-tip b { display: block; font: 400 18px/1.2 var(--display); }
.wb-tip-kind { color: var(--cap); font-size: 12px; font-weight: 600; }
.wb-tip p { margin: 8px 0; font-size: 14px; line-height: 1.45; }
.wb-tip .wb-pills { justify-content: flex-start; }
.wb-tip .wb-tip-src { margin-bottom: 0; color: var(--dim); font-size: 12px; }

@media (max-width: 1023px) {
  .wb-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wb-lib { grid-row: span 2; }
  .wb-queue, .wb-report { grid-column: 2; }
  .wb-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .wb { padding: 12px; }
  .wb-grid { grid-template-columns: minmax(0, 1fr); }
  .wb-lib, .wb-queue, .wb-report { grid-column: 1; grid-row: auto; padding: 12px; }
  .wb-sum { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; display: flex; justify-content: space-around; gap: 8px; margin: 0 -12px 12px; padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--mute); font-size: 14px; text-decoration: none; }
  .wb-sum b { color: var(--glow); }
  .wb-cardgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wb-card { min-height: 112px; }
  .wb-ico { width: 40px; height: 40px; font-size: 24px; }
  .wb-tip { width: min(260px, calc(100% - 16px)); }
}
.wb-presets::-webkit-scrollbar, .wb-seg::-webkit-scrollbar { display: none; }
