#panel-whiteboard {
  --wb-paper: var(--vi-leaf);
  --wb-ink: var(--vi-ink);
  --wb-line: var(--vi-line);
  --wb-muted: var(--vi-muted);
  color: var(--wb-ink);
}
#panel-whiteboard button, .wb-placement select { cursor: pointer; }
.wb-board { border: 1px solid var(--wb-line); border-radius: 5px; }
.wb-inbox { padding: 12px 0 16px; margin-bottom: 24px; border-block: 1px solid var(--wb-line); }
.wb-toolbar, .wb-heading, .wb-dialog footer { display: flex; align-items: center; gap: 12px; }
.wb-toolbar { justify-content: space-between; margin: 24px 0 14px; }
.wb-sync { margin-left: auto; padding: 5px 2px; border: 0; background: transparent; color: var(--wb-muted); font: 12px/1.5 system-ui,sans-serif; }
.wb-sync:hover, .wb-sync:focus-visible { color: var(--vi-pine); }
.wb-toolbar h2, .wb-heading h2, .wb-heading h3 { margin: 0; font: 500 1.15rem/1.4 var(--serif, serif); }
.wb-heading small, .wb-stock small { color: var(--wb-muted); font: 400 .81rem/1.4 system-ui, sans-serif; }
.wb-heading h2 small { margin-left: 6px; }
.wb-boards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 16px; }
.wb-board { min-width: 0; padding: 16px; background: var(--wb-paper); }
.wb-board .wb-heading { justify-content: space-between; border-bottom: 1px solid var(--wb-line); padding-bottom: 10px; }
.wb-heading button, .wb-stock-name { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.wb-heading h3 { min-width: 0; overflow-wrap: anywhere; }
.wb-heading small { flex-shrink: 0; }
.wb-stocks { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 12px; }
.wb-stock { display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; padding: 6px 4px 6px 11px; border: 1px solid var(--wb-line); background: var(--wb-paper); border-radius: 5px; cursor: grab; }
.wb-stock-name { display: grid; gap: 1px; min-width: 0; }
.wb-stock-name b { font: 500 .96rem/1.4 var(--serif, serif); overflow-wrap: anywhere; }
.wb-stock-name:hover b, .wb-heading button:hover { text-decoration: underline; text-underline-offset: 3px; }
.wb-stock small { letter-spacing: .04em; }
.wb-placement { position: relative; display: grid; place-items: center; width: 24px; min-height: 36px; color: var(--wb-muted); }
.wb-placement svg { width: 16px; height: 16px; }
.wb-placement select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.wb-placement:focus-within { outline: 2px solid #718861; border-radius: 3px; }
.wb-moving { opacity: .5; }
.wb-over { outline: 2px dashed #718861; outline-offset: -2px; background: color-mix(in srgb, var(--wb-paper) 80%, #91ab82); }
.wb-empty, .wb-status { font-size: .875rem; line-height: 1.6; color: var(--wb-muted); margin: 0; }
.wb-board .wb-empty { width: 100%; padding: 15px 0; text-align: center; }
.wb-status:not(:empty) { margin-top: 12px; }
.wb-create, .wb-dialog footer button { border: 1px solid var(--wb-line); border-radius: 5px; padding: 7px 12px; font: inherit; background: var(--wb-paper); color: var(--wb-ink); }
.wb-toolbar .wb-create, .wb-dialog .wb-create { color: var(--vi-pine); background: var(--vi-sage); }
.wb-dialog { width: min(320px, calc(100vw - 32px)); box-sizing: border-box; padding: 20px; background: var(--wb-paper); color: var(--wb-ink); border: 1px solid var(--wb-line); border-radius: 8px; }
.wb-dialog::backdrop { background: #24372e45; }
.wb-dialog label { font: 500 1.12rem var(--serif, serif); }
.wb-dialog input { display: block; box-sizing: border-box; width: 100%; margin: 14px 0; padding: 9px; color: inherit; background: transparent; font: inherit; border: 1px solid var(--wb-line); border-radius: 4px; }
.wb-dialog footer { justify-content: flex-end; flex-wrap: wrap; }
#wbDelete { margin-inline-end: auto; color: var(--heat-red); }
#wbDeleteConfirm, #wbStockConfirm { color: var(--heat-red); border-color: currentColor; }
#wbDeleteTitle, #wbStockRemovalTitle { margin: 0; font: 500 1.12rem var(--serif, serif); overflow-wrap: anywhere; }
#wbDeleteDetail { margin: 14px 0; }
#wbDeleteError, #wbStockRemoveError { color: var(--heat-red); }
#wbError { font-size: .875rem; color: var(--heat-red); }

.wb-stock, .wb-stock-name { touch-action: none; user-select: none; -webkit-user-select: none; }

.wb-toolbar h2 { font: 500 clamp(30px, 3vw, 44px)/1.2 var(--serif, serif); letter-spacing: .08em; }
.wb-heading h3 button { background: var(--vi-sage); padding: 3px 9px; border-radius: 2px; }
.wb-count[data-assigned]::after { content: ""; display: inline-block; vertical-align: middle; margin-left: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--vi-cinnabar); }
.wb-board .wb-stocks { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,158px),1fr)); align-items: stretch; }
.wb-inbox .wb-stock { background: transparent; border: 0; border-right: 1px solid var(--wb-line); border-radius: 0; padding: 0 10px 0 0; }
.wb-stock { gap: 1px; border-radius: 3px; }
.wb-stock-name { flex: 1; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 2px 6px; }
.wb-stock small { grid-column: 1/-1; font-size: 11px; }
.wb-percent { font: 500 16px/1.2 Georgia,serif; white-space: nowrap; color: var(--wb-muted); font-variant-numeric: tabular-nums; }
.wb-percent[data-sign=up] { color: var(--up,#b74c3e); }
.wb-percent[data-sign=down] { color: var(--down,#496951); }
.wb-slot { visibility: hidden; min-height: 48px; background: transparent; border: 1px dashed var(--wb-line); color: var(--wb-muted); border-radius: 3px; }
.wb-placing .wb-slot { visibility: visible; }
.wb-picked { outline: 1px dashed var(--vi-pine); }
@media (max-width:760px) { .wb-boards { grid-template-columns: 1fr; } .wb-board { padding: 12px; } }

.wb-modes { display:flex; align-items:center; gap:4px; margin:0 0 14px; }
.wb-modes button { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border:1px solid transparent; border-radius:4px; background:transparent; color:var(--wb-muted); font:inherit; }
.wb-modes [aria-pressed=true] { background:var(--vi-sage); color:var(--wb-ink); border-color:var(--wb-line); }
.wb-modes svg { width:18px; height:18px; stroke:currentColor; stroke-width:1.6; fill:none; stroke-linecap:round; }
.wb-summary { padding:5px 8px; margin:8px 0; background:var(--vi-sage); color:var(--wb-muted); font-size:.81rem; }
.wb-board .wb-stocks { grid-template-columns:minmax(0,1fr); gap:3px; margin-top:4px; }
.wb-entry { min-width:0; display:flex; align-items:center; gap:10px; }
.wb-board .wb-entry { min-height:58px; border-bottom:1px solid var(--wb-line); }
.wb-board .wb-entry .wb-stock { flex:1; }
.wb-spark { min-width:0; width:32%; color:var(--wb-muted); font-size:.75rem; }
.wb-spark svg { display:block; width:100%; height:36px; fill:currentColor; }
.wb-spark polyline { stroke:currentColor; stroke-width:1.5; fill:none; vector-effect:non-scaling-stroke; }
.wb-spark .wb-baseline { stroke:var(--wb-line); stroke-width:1; stroke-dasharray:2 3; }
.wb-spark[data-sign=up] { color:var(--up,#b74c3e); }
.wb-spark[data-sign=down] { color:var(--down,#496951); }
.wb-board .wb-slot:last-child { display:none; }
.wb-placing .wb-board .wb-slot:last-child { display:block; }
#panel-whiteboard[data-mode=review] .wb-boards { display:block; }
.wb-scroll { overflow-x:auto; overscroll-behavior-x:contain; border:1px solid var(--wb-line); border-radius:5px; background:var(--wb-paper); }
.wb-ladder { display:grid; grid-template-columns:65px repeat(var(--boards),minmax(min(260px,70vw),1fr)); }
.wb-ladder .wb-heading,.wb-axis { background:var(--vi-sage); padding:12px 10px; }
.wb-ladder .wb-heading { min-width:0; flex-wrap:wrap; gap:6px; }
.wb-ladder .wb-heading h3 button { padding:0; }
.wb-level,.wb-axis { position:sticky; left:0; z-index:1; display:grid; place-items:center; text-align:center; font:500 1rem var(--serif,serif); }
.wb-level { background:var(--wb-paper); border-top:1px solid var(--wb-line); color:var(--wb-ink); }
.wb-cell { display:flex; flex-wrap:wrap; align-items:center; align-content:center; gap:6px 14px; min-height:64px; min-width:0; padding:10px 12px; border:solid var(--wb-line); border-width:1px 0 0 1px; }
.wb-cell:has(.wb-pip[aria-expanded=true]) { min-height:82px; }
.wb-cell .wb-entry { max-width:100%; gap:7px; }
.wb-cell .wb-entry:has(.wb-pip[aria-expanded=true]) { width:100%; min-height:58px; flex-wrap:wrap; }
.wb-cell .wb-spark:not([hidden]) { flex:1 1 98px; max-width:180px; }
.wb-cell .wb-stock { position:relative; max-width:100%; padding:4px 11px 4px 8px; }
.wb-cell .wb-stock-name small { display:none; }
.wb-cell .wb-placement { width:18px; min-height:26px; }
.wb-pip { position:absolute; right:-.5px; top:50%; transform:translate(50%,-50%); border:0; background:transparent; border-radius:50%; padding:0; width:18px; height:28px; display:grid; place-items:center; }
.wb-pip::after { content:""; width:6px; height:6px; background:var(--vi-cinnabar); border-radius:50%; box-shadow:0 0 0 2px var(--wb-paper); }
.wb-pip[aria-expanded=true]::after { box-shadow:0 0 0 2px var(--wb-paper),0 0 0 3px var(--vi-cinnabar); }
.wb-dash { color:var(--wb-muted); }
.wb-cell-target { display:none; border:1px dashed var(--wb-line); background:transparent; border-radius:3px; color:var(--wb-muted); min-height:32px; }
.wb-placing .wb-cell-target { display:inline-block; }
.wb-placing .wb-dash { display:none; }
.wb-cell.wb-over,.wb-entry.wb-over { outline:2px dashed var(--vi-pine); outline-offset:-2px; }
@media(max-width:620px){ .wb-ladder { grid-template-columns:46px repeat(var(--boards),minmax(min(190px,68vw),1fr)); } .wb-cell { padding:9px; } }
.wb-axis button { padding:0 4px; border:0; color:var(--vi-pine); background:transparent; font:inherit; }

#panel-whiteboard[data-mode=live] .wb-boards {
  grid-template-columns:repeat(auto-fill,min(100%,310px));
  gap:20px; justify-content:start;
}
.wb-boards .wb-board:has(.wb-live-body) { padding:0; border:0; background:transparent; }
.wb-board:has(.wb-live-body) .wb-heading { border:0; padding:0; justify-content:flex-start; }
.wb-board:has(.wb-live-body) .wb-heading h3 button {
  display:block; position:relative; margin-bottom:-1px; padding:5px 14px;
  border:1px solid var(--wb-line); border-bottom:0; border-radius:5px 5px 0 0;
}
.wb-board:has(.wb-live-body) .wb-count { font-size:12px; }
.wb-live-body { border:1px solid var(--wb-line); border-radius:0 5px 5px 5px; padding:0 12px; background:var(--wb-paper); }
.wb-board .wb-live-body .wb-stocks { gap:0; margin:0; }
.wb-live-body .wb-entry { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(0,1fr); gap:9px; min-height:56px; }
.wb-live-body .wb-stock { position:relative; padding:0; background:transparent; border:0; }
.wb-live-body .wb-stock-name { min-height:48px; column-gap:4px; align-content:center; }
.wb-live-body .wb-stock-name b { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:17px; }
.wb-live-body .wb-stock-name small { grid-column:1; grid-row:2; }
.wb-live-body .wb-percent { grid-column:2; grid-row:1/3; align-self:center; text-align:right; font:400 18px/1.2 Georgia,"Times New Roman",serif; font-variant-numeric:oldstyle-nums tabular-nums; }
.wb-live-body .wb-spark { width:100%; }
.wb-live-body .wb-placement { position:absolute; left:3.2rem; bottom:0; width:18px; min-height:18px; opacity:0; }
.wb-live-body .wb-entry:hover .wb-placement,.wb-live-body .wb-placement:focus-within { opacity:1; }
@media(hover:none){ .wb-live-body .wb-placement { opacity:1; } }
#panel-whiteboard:not(.wb-placing) .wb-live-body .wb-slot { display:none; }
.wb-add-stock { display:grid; place-items:center; width:100%; height:35px; padding:0; border:0; background:transparent; color:var(--vi-pine); }
.wb-add-stock:hover { background:var(--vi-sage); }
.wb-add-stock svg { width:17px; height:17px; stroke:currentColor; stroke-width:1.5; }
.wb-modes [data-wb-mode] svg { width:23px; height:23px; stroke-linejoin:round; }
#wbResults { max-height:42vh; overflow:auto; margin-bottom:12px; }
#wbResults button { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; border:0; border-bottom:1px solid var(--wb-line); padding:8px 2px; background:transparent; color:inherit; font:inherit; }
#wbResults button:hover { background:var(--vi-sage); }
#wbResults small { color:var(--wb-muted); }

.wb-level:has(.wb-remove-level) { align-content:center; gap:2px; }
.wb-remove-level {
  display:grid; place-items:center; width:24px; height:20px; padding:0;
  color:var(--wb-muted); border:0; border-radius:3px; background:transparent;
  font:500 16px/1 system-ui,sans-serif;
}
.wb-remove-level:hover,.wb-remove-level:focus-visible { color:var(--wb-ink); background:var(--vi-sage); }
