/* PrismBoard: one-screen widget boards (homepage + every tab landing). Shared widget look + kit. */
.pb{--pb-num:'JetBrains Mono',monospace;position:relative;font:13px/1.5 Inter,Arial,sans-serif;color:var(--text)}
.pb a{color:inherit;text-decoration:none}
.pb .positive{color:#12834b}.pb .negative{color:#c33b49}
:root[data-theme=dark] .pb .positive{color:#66ce96}:root[data-theme=dark] .pb .negative{color:#ff8f99}
.pb-bar{display:flex;justify-content:flex-end;margin-bottom:8px}
.pb-actions{display:flex;gap:8px;flex:none}
.pb-btn{height:28px;padding:0 10px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);font:500 12px Inter,Arial,sans-serif;cursor:pointer;white-space:nowrap}
.pb-btn:hover{background:var(--hover)}.pb-btn[aria-pressed=true]{background:var(--soft);border-color:var(--accent-text);color:var(--accent-text)}
/* First visit (UX-M7): one quiet icon button stands in for Edit widgets / + Add widget until clicked */
.pb-more{display:inline-grid;place-items:center;width:28px;padding:0;color:var(--secondary)}.pb-more:hover{color:var(--text)}
.pb-note{margin:0 0 6px;font-size:12px;color:var(--muted)}.pb-note[hidden]{display:none}
/* Widget grid */
.pb-grid{display:grid;grid-template-columns:repeat(var(--pb-cols,3),minmax(0,1fr));grid-auto-rows:var(--pb-row,300px);gap:var(--gap,12px)}
.hw{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding:var(--pd-card,14px);border:1px solid var(--border);border-radius:var(--r-card,10px);background:var(--surface);cursor:pointer;transition:box-shadow .15s,border-color .15s}
.hw:hover{box-shadow:0 4px 16px #0f172a12}
.hw-head{display:flex;align-items:center;gap:8px;min-height:24px;margin-bottom:6px;min-width:0}
.hw-title{flex:none;font:600 var(--fs-title,14px)/1.3 Inter,Arial,sans-serif;white-space:nowrap}
.hw-title:focus-visible{outline:2px solid var(--accent-text);outline-offset:2px;border-radius:3px}
.hw-more{display:inline-block;margin-left:4px;color:var(--accent-text);opacity:0;transition:opacity .12s}
.hw:hover .hw-more,.hw-title:focus-visible .hw-more{opacity:1}
.hw-sub{flex:1;min-width:0;font:var(--fs-label,11px)/1.4 Inter,Arial,sans-serif;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hw-tools{display:flex;align-items:center;gap:4px;flex:none}
.hw-body{position:relative;flex:1;min-height:0;overflow:hidden}
.hw-body>.widget-empty{margin:0;height:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center}
.hw-seg{display:inline-flex;border:1px solid var(--border);border-radius:6px;overflow:hidden}
.hw-seg button{height:22px;padding:0 7px;border:0;background:var(--surface);color:var(--secondary);font:500 11px Inter,Arial,sans-serif;cursor:pointer}
.hw-seg button+button{border-left:1px solid var(--border)}
.hw-seg button[aria-pressed=true]{background:var(--soft);color:var(--accent-text)}
.hw-badge{display:inline-block;padding:0 5px;border-radius:4px;background:var(--soft);font:11px/1.6 var(--pb-num);font-variant-numeric:tabular-nums;color:var(--secondary)}
.hw-tile-ai{position:absolute;top:4px;right:4px}
/* edit mode */
.pb.editing .hw{cursor:grab;border-style:dashed}
.pb.editing .hw.dragging{opacity:.5}.pb.editing .hw.drop{border-color:var(--accent-text)}
.pb.editing .hw-body{pointer-events:none;opacity:.75}
.hw-edit{display:grid;place-items:center;width:24px;height:24px;padding:0;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--secondary);font:14px/1 Inter,Arial,sans-serif;cursor:pointer}
.hw-edit:disabled{opacity:.35;cursor:default}.hw-remove:hover{color:#c33b49;border-color:currentColor}
/* picker */
.pb-picker{position:absolute;z-index:20;right:0;margin-top:6px;width:min(560px,calc(100% - 48px));max-height:min(520px,calc(100vh - 140px));overflow:auto;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);box-shadow:0 16px 40px #0f172a26}
.pb-picker[hidden]{display:none}
.pb-picker-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.pb-picker-head strong{font:600 14px Inter,Arial,sans-serif}.pb-picker-head span{flex:1;font-size:12px;color:var(--muted)}
.pb-picker-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.pb-pick{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:9px 11px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);text-align:left;cursor:pointer;font:12px/1.4 Inter,Arial,sans-serif}
.pb-pick:hover:not(:disabled){border-color:var(--accent-text);background:var(--hover)}
.pb-pick strong{font-size:13px;font-weight:600}.pb-pick span{color:var(--secondary)}.pb-pick small{margin-top:2px;font-size:11px;color:var(--accent-text)}
.pb-pick:disabled{cursor:default;opacity:.6}.pb-pick:disabled small{color:var(--muted)}

/* Sectors heat tiles */
.hw-heat{display:grid;grid-template-columns:repeat(var(--c,4),minmax(0,1fr));grid-auto-rows:1fr;gap:3px;height:100%}
.hw-heat-tile{display:flex;flex-direction:column;justify-content:center;min-width:0;padding:3px 8px;border-radius:5px;background:var(--soft)}
.hw-heat-tile:hover{outline:2px solid var(--text);outline-offset:-2px}
.hw-heat-name{font:500 11px/1.3 Inter,Arial,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hw-heat-v{font:600 12px/1.35 var(--pb-num);font-variant-numeric:tabular-nums}
.hw-heat-tile.missing{color:var(--muted)}
/* Regime rings */
.hw-rings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;height:100%;align-items:center}
.hw-ring-wrap{position:relative;min-width:0}
.hw-ring{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:8px 4px;border-radius:8px;text-align:center}
.hw-ring:hover{background:var(--hover)}
.hw-ring strong{margin-top:4px;font:600 13px/1.3 Inter,Arial,sans-serif}
.hw-ring span{max-width:100%;font-size:11px;line-height:1.35;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Economy tiles */
.hw-eco-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:8px;height:100%}
.hw-eco-wrap{position:relative;min-width:0;min-height:0}
.hw-eco{display:flex;flex-direction:column;height:100%;box-sizing:border-box;padding:7px 10px 6px;border-radius:8px;background:var(--soft);overflow:hidden}
.hw-eco:hover{background:var(--hover)}
.hw-eco-top{display:flex;justify-content:space-between;gap:6px;padding-right:18px}.hw-eco-label{font:500 11px/1.35 Inter,Arial,sans-serif;color:var(--secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hw-eco-val{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px}
.hw-eco-val strong{font:600 15px/1.35 var(--pb-num)}
.hw-eco-per{flex:none;font-size:11px;line-height:1.35;color:var(--muted)}
.hw-eco-spark{flex:1;min-height:12px;margin-top:2px}
.hw-eco-spark svg{display:block;width:100%;height:100%}
/* States map */
.hw-split{display:flex;gap:10px;height:100%;align-items:center}
.hw-map{flex:none;min-width:0}
.hw-rank{flex:none;list-style:none;margin:0;padding:0;font-size:12px}
.hw-rank-h{margin:6px 0 2px;font:500 11px Inter,Arial,sans-serif;color:var(--muted)}.hw-rank-h:first-child{margin-top:0}
.hw-rank a{display:flex;justify-content:space-between;gap:8px;padding:2px 6px;margin:0 -6px;border-radius:5px;line-height:20px}
.hw-rank a:hover{background:var(--hover)}
.hw-rank a span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hw-rank b{font:500 11.5px var(--pb-num)}
/* Valuation and VIX */
.hw-val-top{display:flex;align-items:center;gap:14px}
.hw-val-big{display:flex;align-items:baseline;gap:6px;flex:none}
.hw-val-big strong{font:600 26px/1.2 var(--pb-num)}.hw-val-big>span:not(.hw-badge){font-size:12px;color:var(--muted)}
.hw-val-note{margin:0;font-size:12px;line-height:1.4;color:var(--secondary)}
.hw-val-range{margin-top:10px}
.hw-val-rows{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.hw-val-rows>div{display:flex;flex-direction:column;padding:7px 10px;border-radius:8px;background:var(--soft)}
.hw-val-rows span,.hw-val-rows small{font-size:11px;color:var(--muted)}.hw-val-rows strong{font:600 14px/1.4 var(--pb-num)}
.hw-spark-big{height:calc(100% - 52px);margin-top:10px}


@media(max-width:640px){.pb-picker{left:0;right:0;width:auto}.pb-picker-list{grid-template-columns:minmax(0,1fr)}.pb-actions{width:100%}.pb-actions .pb-btn{flex:1;height:32px}.pb-actions.pb-quiet{justify-content:flex-end}.pb-actions .pb-more{flex:none;width:32px}}
.hw-map .pv-attrib{white-space:normal;text-align:right;line-height:1.3}.hw-map .pv-map-foot{justify-content:flex-end}
/* Bento sizes: the size toggle in Edit mode shows the tile's columns x rows. */
.hw-edit.hw-size{width:auto;padding:0 6px;font:500 11px/1 var(--pb-num)}
/* 28 Oct: more room under widget titles */
.hw-head{margin-bottom:12px}
