/* tessera.css — the grid. Layered ON TOP of the calendar's styles.css, which supplies the header,
   buttons, dialogs and the whole config page. Only the data surface differs, so only it is styled
   here: tabular numerals so digits line up, a sticky header so the column you are reading stays
   named, and a visible difference between "read-only" and "edited but unsaved". */
.bc-gridwrap{overflow:auto;max-height:calc(100vh - 150px);border-top:1px solid rgba(128,128,128,.22)}
/* Column widths are set by colwidths.js on a <colgroup> (table-layout:fixed, table width = the sum
   of its columns, inline), so a wide view scrolls sideways inside .bc-gridwrap instead of crushing.
   styles.css gives .bc-grid width:100% + fixed layout — 40 columns forced into one tile width, the
   crush itself — so width is reset to auto here: without colwidths.js the table sizes to content.
   Text wraps at word boundaries only; whatever still does not fit is clipped at the cell edge. */
.bc-grid{border-collapse:separate;border-spacing:0;width:auto;table-layout:fixed;font-size:.9rem;font-variant-numeric:tabular-nums}
/* Header labels WRAP onto more lines when a column is narrower than its label (operator,
   2026-11-08): the header row grows taller instead of clipping. Labels sit on the bottom line so
   wrapped and one-line headers align. A word longer than the column breaks rather than spilling.
   The header is OPAQUE: rows scroll under it (operator, 2026-11-12: text showed through it). Its
   labels are dimmed by their color, never by opacity, which faded the background too; --ink-2 reads
   at 5.9:1 or better on the header (5.3:1 under a read-only column's tint). A hovered or sorted
   header is ink (gridtools.css); the look's header row has labels of its own (brand.css). */
.bc-grid thead th{position:sticky;top:0;z-index:2;text-align:left;vertical-align:bottom;white-space:normal;
  overflow:hidden;overflow-wrap:break-word;line-height:1.35;
  font-family:"Tomorrow",sans-serif;font-size:.7rem;font-weight:600;letter-spacing:.08em;
  text-transform:uppercase;color:var(--ink-2,#6B6258);padding:10px 12px;
  background:var(--surface,#fff);border-bottom:1px solid rgba(128,128,128,.35)}
/* Read-only columns are told apart by a faint tint over header and cells, not a printed tag (operator,
   2026-11-08); the header's tooltip still says "read-only". An inset shadow, not a background, so row
   hover, the selected row and unsaved-edit highlights all still show through it. */
.bc-grid{--bc-ro-tint:rgba(120,108,84,.085)}
.bc-grid thead th.bc-col-ro,.bc-grid tbody td.bc-cell-ro{box-shadow:inset 0 0 0 100vmax var(--bc-ro-tint)}
/* A header row of its own color is a solid bar whose text (brand.js onHeader) was chosen for that color
   exactly, and no white, ink or black clears 4.5:1 on every color once the tint is laid over it (worst
   4.17:1): so the bar carries no tint, as in Hub. The header's tooltip still says "read-only". */
@media screen{html.bc-look-c-header .bc-grid thead th.bc-col-ro,.bc-tile.bc-tl-c-header .bc-grid thead th.bc-col-ro{box-shadow:none}}
.bc-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.bc-grid tbody td{padding:8px 12px;border-bottom:1px solid rgba(128,128,128,.16);
  vertical-align:top;overflow:hidden;overflow-wrap:normal;word-break:normal}
.bc-grid tbody tr:hover td{background:rgba(128,128,128,.06)}
.bc-cell-check{text-align:center}
.bc-cell-check input[type="checkbox"]{width:1.05em;height:1.05em;accent-color:#1E7A4C;cursor:pointer}
.bc-cell-check input[type="checkbox"]:disabled{cursor:default}
.bc-cell-edit{cursor:text}
.bc-cell-edit:hover{box-shadow:inset 0 0 0 1px rgba(128,128,128,.4)}
.bc-cell-changed{background:rgba(216,187,106,.22)!important;box-shadow:inset 2px 0 0 #8a6d1f}
.bc-cell-edit:focus-visible{outline:2px solid #1E7A4C;outline-offset:-2px}
.bc-dirtycount{font-size:.82rem;font-weight:600;color:#6b5210;background:rgba(216,187,106,.22);
  padding:4px 9px;border-radius:3px}
.bc-banner{padding:10px 20px;font-size:.9rem;background:rgba(156,74,47,.12);color:#9c4a2f}
.bc-banner.ok{background:rgba(30,122,76,.12);color:#1e7a4c}
.bc-banner.info{background:rgba(128,128,128,.14);color:var(--ink)}
.bc-gridfoot{padding:9px 20px;font-size:.78rem;opacity:.7;border-top:1px solid rgba(128,128,128,.22)}

/* The lead column: every row's highlight control (highlight.css) and the button that opens its card
   (rowcard.css styles the card itself). Its width is colwidths.js LEAD. */
.bc-social-th{width:54px}
.bc-social-td{width:54px;text-align:center;white-space:nowrap;padding:4px 2px!important}
.bc-rowinfo{border:0;background:none;cursor:pointer;font-size:.95rem;opacity:.45;padding:2px 4px}
.bc-rowinfo:hover{opacity:1}

/* The config editor's Columns table fills the panel — the modal is wide; the table must use it.
   "Shown as" gets real room instead of a clipped 160px input. */
.bc-cfg-fieldtable{width:100%;border-collapse:collapse}
.bc-cfg-fieldtable th,.bc-cfg-fieldtable td{padding:7px 10px;text-align:left}
.bc-cfg-fieldtable th:nth-child(1),.bc-cfg-fieldtable td:nth-child(1){width:42%}
.bc-cfg-fieldtable th:nth-child(2),.bc-cfg-fieldtable td:nth-child(2){width:20%}
.bc-cfg-fieldtable th:nth-child(3),.bc-cfg-fieldtable td:nth-child(3){width:38%}
.bc-cfg-fieldtable .bc-select,.bc-cfg-fieldtable .bc-text{width:100%;box-sizing:border-box;max-width:none}

/* ---- MOSAIC: several views on one page, each tile a card holding an ordinary grid.
   FREE PLACEMENT on a 12-column grid of 40px rows (functions/_lib/mosaics.js, js/mosaic-layout.js).
   VIEW mode is plain CSS grid: each tile carries --gx/--gy (1-based lines) and --gw/--gh (spans)
   inline, and an 8px margin on every tile makes the 16px gutter (the box's -8px keeps the outer
   edges flush with the header). EDIT mode is gridstack with the same cell height and margin, so a
   tile is the same size in both. Phones (<=760px) stack tiles in reading order (= DOM order) by a
   media query alone — no resize JS (the embedded browser fires no resize/matchMedia events). ---- */
.bc-mosaic{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:40px;gap:0;margin:8px -8px 24px}
.bc-mosaic.bc-mosaic-empty{display:block;margin:16px 0 32px}
.bc-tile{min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--surface,#fff);
  border:1px solid var(--hairline,#ECE6DA);border-radius:12px;box-shadow:var(--shadow,none);overflow:hidden}
.bc-mosaic > .bc-tile{margin:8px;grid-column:var(--gx,1) / span var(--gw,12);grid-row:var(--gy,auto) / span var(--gh,12)}
@media (max-width:760px){.bc-mosaic > .bc-tile{grid-column:1 / -1;grid-row:auto / span var(--gh,12)}}
/* the tile's own grid takes whatever height is left and scrolls inside the box */
.bc-tile > *{flex:0 0 auto}
.bc-tile > .bc-gridwrap{flex:1 1 auto;min-height:0;height:auto;max-height:none}
.bc-tile-head{display:flex;align-items:flex-start;gap:10px;padding:12px 14px 10px}
.bc-tile-titles{flex:1;min-width:0}
.bc-tile-title{margin:0;font-family:var(--display,"Tomorrow",sans-serif);font-size:1.02rem;font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bc-tile-sub{font-size:.74rem;opacity:.62;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bc-tile-sub:empty{display:none}
.bc-tile-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.bc-tile-btn{padding:4px 9px;font-size:.8rem;line-height:1.2;text-decoration:none;color:inherit;min-height:0}
.bc-tile .bc-dirtycount{font-size:.72rem;padding:3px 7px}
.bc-tile .bc-banner{padding:8px 14px;font-size:.84rem}
.bc-tile .bc-gridfoot{padding:7px 14px}
.bc-mz-deny{padding:28px 18px;text-align:center;opacity:.7;font-size:.9rem}
.bc-mz-empty{padding:40px;text-align:center;opacity:.7;background:var(--surface,#fff);
  border:1px dashed var(--hairline-strong,#D9D2C4);border-radius:12px}

/* edit layout: gridstack widgets (vendor/gridstack/gridstack.min.css does the positioning) */
.bc-mz-editbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 0 0}
.bc-mz-editbar[hidden]{display:none}
.bc-mz-flex{flex:1}
.bc-mz-editbar .bc-mz-name{width:min(340px,100%);font-size:1rem;padding:8px 11px}
.bc-mz-editbar .bc-mz-delete{width:auto;height:auto;padding:6px 12px;font-size:.78rem;white-space:nowrap;color:#8A3B30}
.bc-mz-editbar .bc-mz-preset{font-size:.88rem;padding:7px 8px}
.bc-mosaic-edit{margin:8px -8px 24px}
.bc-mz-stack{min-height:80px}
/* Phone width: the 12-column canvas keeps 720px (60px a column, so a narrow tile's title and a widget's bars stay
   readable) and scrolls sideways inside its own box; the page never does. Above 780px the box is wider than 720px
   already, so none of this changes anything. */
@media (max-width:780px){
  .bc-mosaic-edit{overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain}
  .bc-mosaic-edit > .bc-mz-stack{min-width:720px}
}
.bc-tile-edit{border-style:dashed;border-width:2px}
.bc-tile-edit .bc-tile-head{align-items:center;user-select:none}
/* the grip is the ONLY drag handle (gridstack `handle`), so a column-edge drag can never move a tile */
.bc-mz-grip{flex:0 0 auto;font-size:1.05rem;line-height:1;opacity:.45;cursor:move;padding:6px 5px;margin:-6px -5px;border-radius:4px}
.bc-mz-grip:hover{opacity:.9;background:rgba(128,128,128,.1)}
.bc-mz-tiletitle{flex:1;min-width:0;width:auto;font-size:.95rem;padding:7px 10px;cursor:text}
.bc-mz-src{padding:0 14px 10px;font-size:.8rem;opacity:.65}
.bc-mz-ctrls{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 12px}
.bc-mz-ctrls:empty{display:none}
/* each tile's live grid (mosaic-edit.js), there for its column widths: the body is inert, so only the
   column edges, the scrollbars and the width buttons respond. The 10px inset leaves gridstack's 10px
   edge handles over empty margin, so a tile resize and a column drag never start from one spot. */
.bc-tile-edit > .bc-mz-preview{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;margin:0 10px 10px;
  border:1px solid var(--hairline,#ECE6DA);border-radius:8px;overflow:hidden}
.bc-mz-preview > *{flex:0 0 auto}
.bc-mz-preview > .bc-caltile{flex:1 1 auto;min-height:0;pointer-events:none}   /* a calendar tile drawn in Edit layout: a picture, never edited here */
.bc-mz-preview > .bc-gridwrap{flex:1 1 auto;min-height:0;max-height:none;border-top:0}
.bc-mz-preview .bc-gridfoot{padding:5px 14px}
.bc-mz-preview .bc-banner{padding:6px 10px;font-size:.82rem}
.bc-mz-preview tbody{user-select:none}
.bc-mz-select{font-size:.82rem;padding:4px 6px}
.bc-mz-stack > .grid-stack-placeholder > .placeholder-content{background:rgba(var(--wuwm-gold-rgb,128,128,128),.14);
  border:2px dashed var(--wuwm-gold,#999);border-radius:12px}
.bc-mz-addcard{display:block;width:calc(100% - 16px);margin:8px;min-height:120px;border:2px dashed var(--hairline-strong,#D9D2C4);
  border-radius:12px;background:none;cursor:pointer;font:inherit;font-weight:600;opacity:.7}
.bc-mz-addcard:hover{opacity:1;background:rgba(128,128,128,.06)}
/* Touch: this file loads after styles.css, so its 40px tap targets must be restored here, and the
   drag/resize handles get 40px hit areas (edge handles start below the header so they never cover
   the remove button). */
@media (pointer:coarse){
  .bc-tile-btn,.bc-mz-linkclear{min-height:40px;min-width:40px}
  .bc-tile-edit .bc-tile-head{min-height:52px}
  .bc-mz-grip{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px}
  .bc-mz-stack > .grid-stack-item > .ui-resizable-se,.bc-mz-stack > .grid-stack-item > .ui-resizable-sw{width:40px;height:40px}
  .bc-mz-stack > .grid-stack-item > .ui-resizable-e,.bc-mz-stack > .grid-stack-item > .ui-resizable-w{width:40px;top:64px;bottom:48px}
  .bc-mz-stack > .grid-stack-item > .ui-resizable-s{height:40px;left:48px;right:48px}
  /* 40px handles would cover the grid's edges: the grid sits above them (column edges and scrolling
     win inside it) and stops 40px short of the bottom, where the s/se/sw handles stay reachable. */
  .bc-tile-edit > .bc-mz-preview{position:relative;z-index:102;margin-bottom:40px}
}

/* modal + list section */
.bc-mz-ov{position:fixed;inset:0;z-index:9500;background:rgba(35,31,32,.42);display:flex;align-items:flex-start;
  justify-content:center;padding:8vh 16px;overflow-y:auto}
.bc-mz-card{width:min(520px,100%);background:var(--surface,#fff);border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.bc-mz-cardhead{display:flex;align-items:center;padding:16px 20px;border-bottom:1px solid var(--hairline,#ECE6DA)}
.bc-mz-cardhead h2{margin:0;flex:1;font-family:var(--display,"Tomorrow",sans-serif);font-size:1.2rem;font-weight:600}
.bc-mz-x{border:0;background:none;font-size:1.4rem;line-height:1;cursor:pointer;opacity:.6;padding:2px 6px}
.bc-mz-x:hover{opacity:1}
.bc-mz-cardbody{padding:16px 20px 20px;max-height:70vh;overflow-y:auto}
.bc-mz-status{margin:0 0 12px;font-size:.88rem;opacity:.7}
.bc-mz-field{display:flex;flex-direction:column;gap:5px;margin:0 0 14px}
.bc-mz-label{font-size:.78rem;font-weight:600;opacity:.75}
.bc-mz-field .bc-text,.bc-mz-field .bc-select{width:100%;box-sizing:border-box;font-size:1rem;padding:9px 11px}
.bc-mz-foot{display:flex;align-items:center;gap:12px;justify-content:flex-end}
.bc-mz-err{flex:1;color:#9c4a2f;font-size:.85rem}
.bc-mz-pickgroup{margin:0 0 14px}
.bc-mz-pickhead{font-size:.72rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;opacity:.6;margin:0 0 6px}
.bc-mz-pick{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:1px solid var(--hairline,#ECE6DA);
  background:none;border-radius:8px;padding:9px 11px;margin:4px 0;cursor:pointer;font:inherit;font-size:.92rem}
.bc-mz-pick:hover{background:rgba(128,128,128,.07)}
.bc-mz-pick:disabled{opacity:.45;cursor:default}
.bc-mz-pick:disabled:hover{background:none}
.bc-mz-on{margin-left:auto;font-size:.74rem;opacity:.6}
/* filter links: the selectable source tile, its picked row, and the strip under each linked tile.
   Accent colours come from the theme (styles.css), so a re-branded accent carries through. */
.bc-tile.bc-selectable .bc-grid tbody tr{cursor:pointer}
.bc-grid tbody tr.bc-row-selected td{background:rgba(var(--wuwm-gold-rgb,30,122,76),.16)}
.bc-grid tbody tr.bc-row-selected td:first-child{box-shadow:inset 3px 0 0 var(--wuwm-gold,#1E7A4C)}
.bc-mz-links{display:flex;flex-wrap:wrap;gap:4px 12px;padding:0 14px 6px;font-size:.76rem}
.bc-mz-linktgt,.bc-mz-linksrc{display:flex;align-items:center;gap:6px;min-height:22px;opacity:.55}
.bc-mz-linktgt.on,.bc-mz-linksrc.on{opacity:1;color:var(--ink,#231F20);font-weight:600}
.bc-mz-linkclear{border:1px solid rgba(var(--wuwm-gold-rgb,30,122,76),.55);background:var(--wuwm-gold-soft,#FFF4D2);
  color:var(--ink,#231F20);border-radius:999px;padding:1px 8px;font:inherit;font-size:.74rem;font-weight:600;cursor:pointer}
.bc-mz-linkclear:hover{background:rgba(var(--wuwm-gold-rgb,30,122,76),.3)}
.bc-mz-linkrow{align-items:center}
.bc-mz-linkword{font-size:.78rem;opacity:.65}
.bc-mz-list{padding-top:8px;margin-top:28px}
/* The views page and the mosaic page scroll as a page; the shell's fixed 100vh column (styles.css)
   would otherwise let the views list swallow the screen and push mosaics out of sight. */
#app.bc-page-flow{height:auto}
#app.bc-page-flow #config-page{flex:0 0 auto;overflow:visible}
/* The mosaic's header stays at the top while the tiles scroll under it. At the very top of the page it is untouched
   (laid out and painted as it always was, under the Classic | Hub switch, z 6, that hangs into its bottom edge).
   Scrolled (bc-head-live, mosaic-head.js) it is sticky; pinned over the page (bc-head-stuck) it takes the page's
   background and sits above the tiles, gridstack's handles (100) and the Hub's links (4); below the row card, drawers,
   menus and dialogs (9000 and up). Inside a branded frame (5px, z 50) it stops at the frame. A title bar keeps its own
   background. */
@media screen{
  #app > header.bc-head.bc-head-pin{--bc-pin-top:0px}
  html.bc-look-frame #app > header.bc-head.bc-head-pin{--bc-pin-top:5px}
  #app > header.bc-head.bc-head-pin.bc-head-live{position:sticky;top:var(--bc-pin-top)}
  #app > header.bc-head.bc-head-pin.bc-head-stuck{z-index:300}
  header.bc-head.bc-head-stuck{background-color:var(--paper)}
  html.bc-look-c-bg:not(.bc-look-titlebar) header.bc-head.bc-head-stuck{background-color:var(--bc-page-bg)}
  html:has(header.bc-head-pin){scroll-padding-top:calc(var(--bc-head-h,0px) + var(--bc-bar-h,0px))}
  /* Edit layout's bar stays under the pinned header, above gridstack's handles (100), below the header (300). */
  #mz-editbar.bc-mz-editbar{position:sticky;top:var(--bc-head-h,0px);z-index:299}
  html:not([data-theme="hub"]) #mz-editbar.bc-mz-editbar{background-color:var(--paper)}   /* the Hub's bar is its own panel (hub-mosaic.css) */
  html.bc-look-c-bg:not(.bc-look-titlebar):not([data-theme="hub"]) #mz-editbar.bc-mz-editbar{background-color:var(--bc-page-bg)}
  /* pinned: a strip of its own ground below it (a shadow, so the bar's height and place never change) */
  html:not([data-theme="hub"]) #mz-editbar.bc-mz-editbar.bc-bar-stuck{box-shadow:0 8px 0 0 var(--paper)}
  html.bc-look-c-bg:not(.bc-look-titlebar):not([data-theme="hub"]) #mz-editbar.bc-mz-editbar.bc-bar-stuck{box-shadow:0 8px 0 0 var(--bc-page-bg)}
}
.bc-cfg-role-admin{background:#E8EEE9;color:#1e5a3c}
/* Phone: the header's buttons wrap rather than push the page wider than the screen. */
@media (max-width:640px){.bc-head-right{flex-wrap:wrap;row-gap:6px;justify-content:flex-end}}
/* The view's name, renamed in place (header-rename.js): a button inside the heading for editors only,
   inline so the heading lays out exactly as plain text; the box that replaces it while typing copies
   the heading's type and box in JS, so only its frame is styled here. */
.bc-title-edit{cursor:text;border-radius:2px}
@media screen and (hover:hover){   /* never printed, never stuck on after a tap */
  .bc-title-edit:hover{text-decoration:underline dotted;text-decoration-thickness:1px;text-underline-offset:.14em}
}
.bc-title-edit:focus{outline:none}
.bc-title-edit:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.bc-title-edit[aria-disabled="true"]{cursor:progress;text-decoration:none}
.bc-tile-title .bc-title-edit:focus-visible{outline-offset:-2px}   /* the tile title clips its overflow */
.bc-title-input{display:block;min-width:0;background:transparent;border:1px solid currentColor;border-radius:4px;
  outline:none;box-shadow:0 0 0 3px rgba(var(--wuwm-gold-rgb),.45)}
.bc-title-input[aria-invalid="true"]{box-shadow:0 0 0 3px rgba(156,74,47,.55)}
