/* mosaic-widgets.css - a mosaic's widgets band (js/mosaic-widgets.js: small gauges above the tiles,
   in the arrangers' order, wrapping at narrow widths) in the classic look - a flat ring and the number
   (js/gauge.js "flat"), or a column's top values as bars - and the Widgets tab's cards in the mosaic
   drawer (js/mosaic-settings-widgets.js). The Hub look is hub-widgets.css. Colors are the page's
   tokens only (styles.css; the accent follows the mosaic's branding). A mosaic with no widgets has
   no band, so nothing here touches it. */
.bc-wg[hidden]{display:none}
.bc-wg{flex:0 1 176px;min-width:150px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:12px 14px 10px;background:var(--surface);border:1px solid var(--hairline);border-radius:12px;box-shadow:var(--shadow)}
.bc-wg-head{align-self:stretch;min-width:0;text-align:center}
.bc-wg-label{display:block;font-size:.7rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-2);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bc-wg-cap{min-height:1.2em;font-size:.76rem;color:var(--ink-2);font-variant-numeric:tabular-nums}

/* the flat gauge: a track, the arc in the accent, the number in the middle */
.bc-gauge{position:relative;width:84px;height:84px;flex:0 0 auto}
.bc-gauge-svg{position:absolute;inset:0;display:block;width:100%;height:100%}
.bc-gauge-track{fill:none;stroke:var(--hairline);stroke-width:6}
.bc-gauge-arc{fill:none;stroke:var(--bc-gauge-arc,#a57e09);stroke-width:6;stroke-linecap:round}
.bc-gauge-num{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--display);font-size:1.3rem;font-weight:700;
  line-height:1;color:var(--ink);font-variant-numeric:tabular-nums}
.bc-gauge-num[data-len="4"]{font-size:1.1rem}
.bc-gauge-num[data-len="5"]{font-size:.95rem}
.bc-gauge-num[data-len="6"]{font-size:.82rem}

/* a breakdown: each value, its count, its bar */
.bc-wg[data-kind="breakdown"]{flex-basis:240px;align-items:stretch}
.bc-wg-list{display:flex;flex-direction:column;gap:6px;min-width:0}
.bc-wg-bar{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:baseline;gap:3px 8px;min-width:0;font-size:.8rem}
.bc-wg-pc{font-style:normal;min-width:3.2ch;text-align:right;font-variant-numeric:tabular-nums;color:var(--ink-2)}
.bc-wg-pc:empty{display:none}
.bc-wg[data-narrow] .bc-wg-pc{display:none}
.bc-wg-bar:is([data-other],[data-blank]) .bc-wg-track > i{background:var(--ink-2)}
.bc-wg-k{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}
.bc-wg-bar > b{font-variant-numeric:tabular-nums;color:var(--ink)}
.bc-wg-track{grid-column:1 / -1;position:relative;display:block;height:5px;border-radius:3px;background:var(--hairline)}
.bc-wg-track > i{position:absolute;left:0;top:0;bottom:0;border-radius:3px;background:var(--bc-gauge-arc,#a57e09)}
.bc-wg-none{font-size:.8rem;color:var(--ink-2);text-align:center}

/* the number look, and the bar look's meter under it */
.bc-wg-body{display:flex;justify-content:center;align-items:center}
.bc-wg-big{font-family:var(--display);font-size:2.2rem;font-weight:700;line-height:1.1;color:var(--ink);font-variant-numeric:tabular-nums;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bc-wg-big[data-len="4"]{font-size:1.9rem}
.bc-wg-big[data-len="5"]{font-size:1.6rem}
.bc-wg-big[data-len="6"]{font-size:1.4rem}
.bc-wg-meter{align-self:stretch;position:relative;display:block;height:8px;border-radius:4px;background:var(--hairline)}
.bc-wg-meter > i{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:var(--bc-gauge-arc,#a57e09)}

/* a donut: each value's share of the ring, the total in the middle, a legend under it */
.bc-wg[data-look="donut"]{flex-basis:240px;align-items:stretch}
.bc-wg-donut{position:relative;width:84px;height:84px;flex:0 0 auto}
.bc-wg-dn-svg{position:absolute;inset:0;display:block;width:100%;height:100%}
.bc-wg-dn-track{fill:none;stroke:var(--hairline);stroke-width:8}
.bc-wg-dn-seg{fill:none;stroke-width:8}
.bc-wg-dn-num{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--display);font-size:1.2rem;font-weight:700;line-height:1;
  color:var(--ink);font-variant-numeric:tabular-nums}
.bc-wg-dn-num[data-len="4"],.bc-wg-dn-num[data-len="5"],.bc-wg-dn-num[data-len="6"]{font-size:.9rem}
.bc-wg-leg{display:flex;flex-direction:column;gap:4px;min-width:0}
.bc-wg-lg{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0;font-size:.8rem}
.bc-wg-lg > b{font-variant-numeric:tabular-nums;color:var(--ink)}
.bc-wg-sw{display:block;width:10px;height:10px;border-radius:2px}
/* a donut's legend is one grid: each value sits after the longest label, in one column, not at the card's far edge */
.bc-wg[data-look="donut"] > .bc-wg-leg{display:grid;grid-template-columns:auto minmax(0,max-content) auto;justify-content:start;align-content:start;gap:4px 8px}
.bc-wg[data-look="donut"] > .bc-wg-leg > .bc-wg-lg{grid-column:1 / -1;grid-template-columns:subgrid}
.bc-wg[data-look="donut"] > .bc-wg-leg > .bc-wg-none{grid-column:1 / -1}
.bc-wg-dn-0{stroke:var(--bc-gauge-arc,#a57e09);background:var(--bc-gauge-arc,#a57e09)}
.bc-wg-dn-1{stroke:#1b6ca8;background:#1b6ca8}
.bc-wg-dn-2{stroke:#2f7d32;background:#2f7d32}
.bc-wg-dn-3{stroke:#8e44ad;background:#8e44ad}
.bc-wg-dn-4{stroke:#c0392b;background:#c0392b}
.bc-wg-dn-5{stroke:#00796b;background:#00796b}
.bc-wg-dn-6{stroke:#6d4c41;background:#6d4c41}
.bc-wg-dn-7{stroke:#5d6d7e;background:#5d6d7e}
.bc-wg-dn-x{stroke:var(--ink-2);background:var(--ink-2)}

/* ---- a widget as a grid item of the mosaic (js/mosaic-widgets.js): placed by --gx/--gy/--gw/--gh like a
   tile (tessera.css), with the tile's 8px margin. A cell is as tall as its rows (h = 3: 104px inside the
   margins), so a ring sits beside its label, a number over its caption, and a breakdown scrolls inside
   its card when it has more rows than room. At phone width it stacks with the tiles, full width. ---- */
.bc-mosaic > .bc-wg-cell{margin:8px;min-width:0;min-height:0;flex:none;overflow:hidden;gap:2px 12px;padding:8px 12px;
  grid-column:var(--gx,1) / span var(--gw,3);grid-row:var(--gy,auto) / span var(--gh,3);
  display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"b h" "b c";grid-template-rows:auto auto;align-content:center;align-items:center}
.bc-mosaic > .bc-wg-cell[hidden]{display:none}
.bc-wg-cell > .bc-wg-head{grid-area:h;align-self:end;text-align:left}
.bc-wg-cell > .bc-wg-body{grid-area:b}
.bc-wg-cell > .bc-wg-cap{grid-area:c;align-self:start}
/* number and bar looks have no ring: one centered column */
.bc-wg-cell[data-look="number"],.bc-wg-cell[data-look="bar"][data-kind="count"],.bc-wg-cell[data-look="bar"][data-kind="sum"],.bc-wg-cell[data-look="bar"][data-kind="avg"]{
  display:flex;flex-direction:column;justify-content:center;align-items:stretch;gap:3px}
.bc-wg-cell[data-look="number"] > .bc-wg-head,.bc-wg-cell[data-look="bar"] > .bc-wg-head{text-align:center}
.bc-wg-cell[data-look="number"] > .bc-wg-cap,.bc-wg-cell[data-look="bar"] > .bc-wg-cap{text-align:center;min-height:0}
.bc-wg-cell .bc-wg-big{font-size:1.8rem}
.bc-wg-cell .bc-wg-big[data-len="4"]{font-size:1.6rem}
.bc-wg-cell .bc-wg-big[data-len="5"]{font-size:1.4rem}
.bc-wg-cell .bc-wg-big[data-len="6"]{font-size:1.2rem}
/* a breakdown: the label over its rows, which scroll when there are more than fit */
.bc-wg-cell[data-kind="breakdown"][data-look="bar"]{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:6px}
.bc-wg-cell[data-kind="breakdown"][data-look="bar"] > .bc-wg-head{text-align:left}
.bc-wg-cell .bc-wg-list{flex:1 1 auto;min-height:0;overflow:auto}
.bc-wg-cell[data-look="donut"]{grid-template-areas:"b h" "b l";grid-template-rows:auto minmax(0,1fr);align-items:start}
.bc-wg-cell[data-look="donut"] > .bc-wg-leg{grid-area:l;overflow:auto;min-height:0;max-height:100%}
@media print{html.bc-gt-printing .bc-mosaic > .bc-wg-cell{display:none!important}}
@media (max-width:760px){.bc-mosaic > .bc-wg-cell{grid-column:1 / -1;grid-row:auto / span var(--gh,3)}}

/* edit layout: a widget's placeholder card inside gridstack (js/mosaic-edit-widgets.js): the grip, what it
   reads, its look; no data. Sized by the item, like a tile's card. */
.bc-wg-edit{display:flex;flex-direction:column;gap:2px;box-sizing:border-box;height:100%;padding:6px 10px;background:var(--surface);
  border:1px dashed var(--ink-2);border-radius:12px;overflow:hidden;min-width:0}
.bc-wg-edit-head{display:flex;align-items:center;gap:8px;min-width:0}
.bc-wg-edit-name{flex:1 1 auto;min-width:0;font-size:.82rem;font-weight:700;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bc-wg-edit-sub{font-size:.74rem;color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bc-wg-edit-sub[hidden]{display:none}
/* the widget's own drawing in that card (the page's card, js/widget-draw.js): the grid cell's layout, filling what is left */
.bc-wg-edit > .bc-wg-live{flex:1 1 auto;margin:0;min-width:0;min-height:0;overflow:hidden;gap:2px 12px;padding:2px 4px;border:0;border-radius:0;box-shadow:none;background:transparent;
  display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"b h" "b c";grid-template-rows:auto auto;align-content:center;align-items:center}
.bc-wg-edit > .bc-wg-live[hidden]{display:none}
/* the name is in the card's own header row (grip, name, x), so the drawing's label would say it twice, and at 3 rows there is no room for both */
.bc-wg-edit > .bc-wg-live > .bc-wg-head{display:none}
.bc-wg-edit > .bc-wg-live .bc-gauge{width:60px;height:60px}
.bc-wg-edit > .bc-wg-live .bc-gauge-num{font-size:1.05rem}
.bc-wg-edit > .bc-wg-live[data-look="number"],.bc-wg-edit > .bc-wg-live[data-look="bar"][data-kind="count"],.bc-wg-edit > .bc-wg-live[data-look="bar"][data-kind="sum"],.bc-wg-edit > .bc-wg-live[data-look="bar"][data-kind="avg"]{
  display:flex;flex-direction:column;justify-content:center;align-items:stretch;gap:3px}
.bc-wg-edit > .bc-wg-live[data-kind="breakdown"][data-look="bar"]{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:6px}
.bc-wg-edit > .bc-wg-live[data-look="donut"]{grid-template-areas:"b h" "b l";grid-template-rows:auto minmax(0,1fr);align-items:start}

/* the drawer's Widgets tab: one card per widget (the Tiles tab's cards) */
.bc-wge .bc-group-head .bc-select{flex:1 1 auto;min-width:0}
.bc-wge-move{padding:4px 9px;min-height:0}
.bc-wge-fields{margin-top:4px}
.bc-wge-fields .bc-row{padding:6px 0;flex-wrap:nowrap}
.bc-wge-fields .bc-row[hidden]{display:none}
.bc-wge-fields .bc-row-label{font-size:1.05rem}
.bc-wge-fields .bc-row .bc-select,.bc-wge-fields .bc-row .bc-text{flex:0 1 66%;min-width:0}
/* the values picker: the column's real values with counts, a check box each */
.bc-wge-fields .bc-wge-pickrow{align-items:flex-start}
.bc-wge-pick{flex:0 1 66%;min-width:0;display:flex;flex-direction:column;gap:4px}
.bc-wge-vals{display:flex;flex-direction:column;gap:2px;max-height:220px;overflow:auto}
.bc-wge-opt{display:flex;align-items:center;gap:8px;min-width:0;padding:2px 0}
.bc-wge-optl{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bc-wge-optn{font-variant-numeric:tabular-nums}
/* "Automatic: top" and its number box: the box keeps its own width (the row's 66% rule is for a row's one field), the words wrap before they clip */
.bc-wge-fields .bc-wge-auto .bc-text{flex:0 0 4.5em;width:4.5em}
.bc-wge-auto > .bc-wge-optl{flex:0 1 auto;min-width:auto;white-space:normal;overflow:visible}
.bc-wge-filter{width:100%}
.bc-wge-valbox{flex:0 1 66%;min-width:0;display:flex;flex-direction:column;gap:4px}
.bc-wge-valbox > .bc-wge-pick{flex:none}
.bc-wge-auto .bc-text[hidden]{display:none}
.bc-wge-ordered{list-style:none;margin:4px 0 0;padding:4px 0 0;border-top:1px solid var(--hairline);display:flex;flex-direction:column;gap:2px}
.bc-wge-ordered .bc-wge-move{padding:2px 8px}
/* the collapsed advanced fields, and the live preview (a card as the page draws it, at the width it gets there) */
.bc-wge-adv{margin-top:4px;border-top:1px solid var(--hairline)}
.bc-wge-advhead{cursor:pointer;padding:8px 0;font-size:1.05rem;color:var(--ink-2)}
.bc-wge-preview{box-sizing:border-box;max-width:100%;margin:10px 0 2px;display:flex}
.bc-wge-preview > .bc-wg{flex:1 1 auto;min-width:0}
@media (max-width:640px){.bc-wge-fields .bc-wge-pickrow{flex-wrap:wrap}.bc-wge-pick{flex-basis:100%}.bc-wge-fields .bc-wge-valbox{flex-basis:100%}}

/* a legend (widget.legend, widget.legendAt: js/widget-draw.js): a bars widget's list and legend share one box,
   below or at the right of each other; a donut's own legend moves with data-legend-at */
.bc-wg-gr{display:flex;flex-direction:column;gap:8px;min-width:0}
.bc-wg-gr[data-at="right"]{flex-direction:row;align-items:flex-start}
.bc-wg-gr > .bc-wg-list{flex:1 1 0;min-width:0}
.bc-wg-gr[data-at="right"] > .bc-wg-leg{flex:0 1 40%}
.bc-wg-gr > .bc-wg-leg .bc-wg-lg{grid-template-columns:auto minmax(0,1fr)}
.bc-wg-cell > .bc-wg-gr{flex:1 1 auto;min-height:0;overflow:auto}
.bc-wg[data-legend-at="right"]{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"h h" "b l";align-items:center;justify-items:stretch}
.bc-wg[data-legend-at="right"] > .bc-wg-head{grid-area:h}
.bc-wg[data-legend-at="right"] > .bc-wg-body{grid-area:b}
.bc-wg[data-legend-at="right"] > .bc-wg-leg{grid-area:l;overflow:auto;max-height:100%}
.bc-wg[data-legend-at="below"]{display:flex;flex-direction:column;align-items:stretch}
.bc-wg[data-legend-at="below"] > .bc-wg-body{justify-content:center}
.bc-wg[data-legend-at="below"] > .bc-wg-leg{overflow:auto;max-height:100%}
.bc-wg[hidden]{display:none}
/* the editor's color fields: one color input per value drawn */
.bc-wge-colors[hidden]{display:none}
.bc-wge-colorlist{max-height:220px;overflow:auto}
.bc-wge-colorrow .bc-wge-move[hidden]{display:none}
.bc-wge-colorin{flex:0 0 auto;width:2.2rem;height:1.6rem;padding:0;border:1px solid var(--hairline);border-radius:4px;background:var(--surface);cursor:pointer}
