/* manager-grid.css - front-page tile grid matching the Dashboard Manager home grid (19 Nov 2026).
   Values copied from dashboard-manager index.html (.home-grid / .tile / .cell .t) and confirmed with getComputedStyle:
   112px tiles, 14px gap, 22px radius, 3px group ring (outline, offset 2px), label 14.72px/1.2 700 system-ui, white,
   112px wide, 2 lines (2.4em reserved), 6px below the tile. Names hide with visibility only (no layout shift).
   Applied only after manager-grid.js adds body.mg-on and the mg-* classes. Image tiles shown as-is (no filter added). */
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace).mg-grid,
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace) .mg-grid:not(.mg-pack){display:grid!important;grid-template-columns:repeat(auto-fill,112px)!important;gap:14px!important;justify-content:center!important;align-content:start;width:100%!important;max-width:none!important}
html body.mg-on #g.mg-sections{display:block!important}
html body.mg-on #g .mg-grid.mg-pack{display:flex!important;flex-wrap:wrap!important;gap:14px!important}
html body.mg-on .mg-grid > .mg-cell.mg-cell{position:relative;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;box-sizing:border-box;width:112px!important;min-width:112px!important;max-width:112px!important;flex:0 0 112px!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;min-height:0!important;height:auto!important;color:#fff;text-decoration:none;transition:transform .12s,opacity .15s ease}
html body.mg-on .mg-cell:hover,html body.mg-on .mg-cell:focus-visible{opacity:.75}
html body.mg-on .mg-cell.mg-cell > .mg-tile.mg-tile{box-sizing:border-box!important;display:block;width:112px!important;height:112px!important;min-width:112px!important;max-width:112px!important;flex:0 0 112px!important;padding:0!important;margin:0!important;border:1px solid #2a2a2a!important;border-radius:22px!important;background:#0b0b0b!important;object-fit:cover!important;object-position:center!important;overflow:hidden;box-shadow:0 1px 0 rgba(255,255,255,.04),0 8px 24px rgba(0,0,0,.6);outline:3px solid var(--mg-g,#9CA3AF)!important;outline-offset:2px!important;position:relative!important;inset:auto!important}
html body.mg-on .mg-cell.mg-cell > span.mg-tile.mg-tile,html body.mg-on .mg-cell.mg-cell > svg.mg-tile.mg-tile{display:flex!important;align-items:center;justify-content:center}
html body.mg-on .mg-cell.mg-cell > .mg-ph{font:700 2.2rem/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:#fff}
html body.mg-on .mg-cell.mg-cell > .t{position:static!important;box-sizing:content-box!important;width:112px!important;max-width:112px!important;height:2.4em!important;min-height:2.4em!important;max-height:2.4em!important;clip:auto!important;clip-path:none!important;white-space:normal!important;overflow:hidden!important;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif!important;font-size:14.72px!important;font-weight:700!important;font-style:normal!important;line-height:1.2!important;color:#fff!important;text-align:center!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow-wrap:anywhere!important;word-break:normal!important;letter-spacing:normal!important;text-transform:none!important;text-decoration:none!important;visibility:visible!important;margin:0!important;padding:0!important;border:0!important}
html body.mg-on.io .mg-cell.mg-cell > .t{visibility:hidden!important}
html body.mg-on .mg-cell.mg-cell > .s,html body.mg-on .mg-cell.mg-cell > .n{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;margin:0!important;padding:0!important;border:0!important}
#mg-legend{display:flex;flex-wrap:wrap;gap:8px 16px;margin:0 0 14px;font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
#mg-legend span{display:inline-flex;align-items:center;gap:6px;color:#bdbdbd;font-size:.9rem}
#mg-legend i{width:14px;height:14px;border-radius:50%;display:inline-block}
html body.mg-on .mg-cell.mg-cell > .inst{position:absolute!important;top:4px!important;right:4px!important;z-index:2;width:auto!important;height:auto!important;overflow:visible!important;clip:auto!important;clip-path:none!important;white-space:nowrap!important;padding:1px 6px!important;font-size:.6rem!important;background:#0b0b0b!important;margin:0!important}

/* drawn-tile-bg: front-page + shared rules also live in drawn-tile-bg.css and the
   page marker <!-- drawn-tile-bg -->. Official favicon-is-tile / icons/boards/official tiles are excluded. */
/* drawn-tile-bg
   Solid category/ring (or board theme) fill behind a WHITE symbol on DRAWN tiles only.
   Official favicon / _brand / board-icon tiles (favicon-is-tile) stay as-is: no background,
   filter or fill. Status indicators are unchanged. Tile size, radius, gap and 112px fit
   are unchanged. This overrides the mono interior rule for drawn tiles only.
   IMPORTANT (20 Nov 2026 fix): CSS filters also tint the element's own background, so
   brightness(0) invert(1) must NEVER share an element with the coloured fill — that
   turns the face white and hides a white glyph (GitHub redrawn tiles, etc.). The fill
   is painted on the cell ::before (overriding visibility-fix's white face and
   nonofficial-white's #fff img face). The img stays transparent and is inverted so
   dark #111 glyphs render white. Contrast vs white is >= 4.5:1 via --drawn-fill or
   color-mix(62% source + black). */

:root{--board-theme:#14B8A6}

/* ---- Shared fill (resolved on the element, so --mg-g / --g inherit from the cell) ---- */
/* Use as: var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000)) */

/* ========== Front pages: colour on the cell ::before, never on the filtered img ========== */
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace) .mg-cell.mg-cell:not(.favicon-is-tile):is(
  :has(> img[src*="redrawn"]),
  :has(> img.drawn),
  :has(> img.monogram),
  :has(> img[src*="icons/boards"]:not([src*="official"]):not([src*="favicon"])),
  :has(> img[src*="icons\\boards"]:not([src*="official"]):not([src*="favicon"])),
  .drawn-bg-cell
){
  isolation:isolate;
}
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace) .mg-cell.mg-cell:not(.favicon-is-tile):is(
  :has(> img[src*="redrawn"]),
  :has(> img.drawn),
  :has(> img.monogram),
  :has(> img[src*="icons/boards"]:not([src*="official"]):not([src*="favicon"])),
  :has(> img[src*="icons\\boards"]:not([src*="official"]):not([src*="favicon"])),
  .drawn-bg-cell
)::before,
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace) .mg-cell.mg-cell.vf-glyph-cell:not(.favicon-is-tile):is(
  :has(> img[src*="redrawn"]),
  :has(> img.drawn),
  :has(> img.monogram),
  :has(> img[src*="icons/boards"]:not([src*="official"]):not([src*="favicon"])),
  :has(> img[src*="icons\\boards"]:not([src*="official"]):not([src*="favicon"])),
  .drawn-bg-cell
)::before{
  content:"";
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:112px;
  height:112px;
  box-sizing:border-box;
  border-radius:22px;
  pointer-events:none;
  z-index:0;
  background:#0F766E;
  background:var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000))!important;
  background-color:var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000))!important;
}

/* Img is the 112px face: keep it transparent so invert cannot bleach the fill.
   Beat nonofficial-white's background:#fff and filter:none (exact [src=...] list)
   and visibility-fix's transparent already, plus white-tile-icons filters. */
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace) .mg-cell.mg-cell:not(.favicon-is-tile):is(
  :has(> img[src*="redrawn"]),
  :has(> img.drawn),
  :has(> img.monogram),
  .drawn-bg-cell
) > img.mg-tile.mg-tile:not(.favicon-is-tile):not([src*="favicon"]):not([src*="_brand"]):not([src*="board-icon"]):not([src*="icons/boards"]):is(
  [src*="redrawn"],
  .drawn,
  .monogram,
  .vf-glyph
),
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace) .mg-cell.mg-cell.vf-glyph-cell:not(.favicon-is-tile) > img.mg-tile.mg-tile.vf-glyph:not(.favicon-is-tile):is(
  [src*="redrawn"],
  .drawn,
  .monogram
){
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  filter:brightness(0) invert(1)!important;
  -webkit-filter:brightness(0) invert(1)!important;
  object-fit:contain!important;
  position:relative!important;
  z-index:1;
}

/* .si glyphs already stroke currentColor (white): colour the face, no invert */
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace) .mg-cell.mg-cell:not(.favicon-is-tile) > .si.mg-tile,
html body.mg-on :is(#g,#g-platforms,#g-shopify,#g-wordpress,#g-squarespace) .mg-cell.mg-cell:not(.favicon-is-tile) > svg.drawn.mg-tile{
  background:var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000))!important;
  background-color:var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000))!important;
  color:#fff!important;
  filter:none!important;
  position:relative!important;
  z-index:1;
}

/* ========== Dashboard Manager: baked white-on-dark PNGs/SVGs, no invert ========== */
html body :is(.home-grid,#action-tiles,#board-grid,#view-board,#home-grid) .tile:is(
  :has(> img[src*="icons/boards"]:not([src*="official"]):not([src*="favicon"])),
  :has(> img[src*="icons\\boards"]:not([src*="official"]):not([src*="favicon"])),
  :has(> img.drawn),
  :has(> .ph),
  :has(> .mark)
),
html body :is(.home-grid,#action-tiles,#board-grid,#view-board,#home-grid) .cell:is(
  :has(> .tile > img[src*="icons/boards"]:not([src*="official"]):not([src*="favicon"])),
  :has(> .tile > img.drawn)
) > .tile{
  background:var(--drawn-fill, color-mix(in srgb, var(--g, var(--mg-g, var(--board-theme, #14B8A6))) 50%, #000))!important;
  background-color:var(--drawn-fill, color-mix(in srgb, var(--g, var(--mg-g, var(--board-theme, #14B8A6))) 50%, #000))!important;
}
html body :is(.home-grid,#action-tiles,#board-grid,#view-board,#home-grid) .tile:is(
  :has(> img[src*="icons/boards"]:not([src*="official"]):not([src*="favicon"])),
  :has(> img[src*="icons\\boards"]:not([src*="official"]):not([src*="favicon"])),
  :has(> img.drawn)
) > img{
  mix-blend-mode:screen;
  background:none!important;
  background-color:transparent!important;
  filter:none!important;
  -webkit-filter:none!important;
}

/* ========== Detail / drill-down pages ========== */
/* .si: white currentColor on coloured face, no invert */
html body .grid > a.btn:not(.open):not(.back):not(.quote):not(.cta):not(.info):not(.settings):not(.api):has(> .si) > .si{
  background:var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000))!important;
  background-color:var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000))!important;
  color:#fff!important;
  filter:none!important;
}

/* Drawn imgs: colour on the anchor ::before, img transparent + invert */
html body .grid > a.btn:not(.open):not(.back):not(.quote):not(.cta):not(.info):not(.settings):not(.api):is(
  :has(> img[src*="redrawn"]),
  :has(> img.drawn),
  :has(> img.monogram)
){
  isolation:isolate;
}
html body .grid > a.btn:not(.open):not(.back):not(.quote):not(.cta):not(.info):not(.settings):not(.api):is(
  :has(> img[src*="redrawn"]),
  :has(> img.drawn),
  :has(> img.monogram)
)::before{
  content:"";
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:112px;
  height:112px;
  box-sizing:border-box;
  border-radius:22px;
  pointer-events:none;
  z-index:0;
  background:var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000))!important;
  background-color:var(--drawn-fill, color-mix(in srgb, var(--mg-g, var(--g, var(--board-theme, #14B8A6))) 62%, #000))!important;
}
html body .grid > a.btn:not(.open):not(.back):not(.quote):not(.cta):not(.info):not(.settings):not(.api):is(
  :has(> img[src*="redrawn"]),
  :has(> img.drawn),
  :has(> img.monogram)
) > img:not([src*="favicon"]):not([src*="_brand"]):not([src*="board-icon"]):not([src*="icons/boards"]){
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  filter:brightness(0) invert(1)!important;
  -webkit-filter:brightness(0) invert(1)!important;
  object-fit:contain!important;
  position:relative!important;
  z-index:1;
  color:#fff!important;
}

