html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #fff; color: #14171a; }
header { padding: 12px 18px 8px; border-bottom: 1px solid #dfe3e6; flex: none; }
h1 { font-size: 1.25rem; margin: 0 0 4px; }
.lede { margin: 0 0 8px; color: #5b6570; max-width: 110ch; }
.links { display: flex; gap: 18px; margin: 0 0 4px; font-weight: 600; }
.links a { color: #1f6feb; }
.demo { flex: 1; min-height: 360px; display: flex; flex-direction: column; padding: 10px 18px 0; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 6px; flex: none; }
.group { display: inline-flex; align-items: center; gap: 6px; }
.group-label { font-size: 13px; color: #5b6570; }
.group button { border-radius: 0; margin-left: -1px; }
.group button:first-of-type { border-radius: 6px 0 0 6px; margin-left: 0; }
.group button:last-of-type { border-radius: 0 6px 6px 0; }
button { font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid #c4ccd2; border-radius: 6px; background: #fff; cursor: pointer; }
button:disabled { cursor: default; color: #9aa4ad; }
button[aria-pressed="true"] { background: #2d6bff; color: #fff; border-color: #2d6bff; }
.overlay { color: #5b6570; font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }
.arena { flex: 1; min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; }
.stage { flex: none; position: relative; border: 1px solid #dfe3e6; border-radius: 6px; overflow: hidden; background: #000; box-sizing: content-box; }
.grid { position: absolute; inset: 0; }
.boot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; color: #cfd6dc; background: #000; font-size: 1.1rem; }
.boot[hidden] { display: none; }
.legend { flex: none; display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #5b6570; padding: 6px 2px; }
.legend kbd { font: inherit; border: 1px solid #c4ccd2; border-radius: 4px; padding: 1px 5px; background: #f6f7f8; }
footer { flex: none; font-size: 12px; color: #5b6570; padding: 6px 18px 8px; }
footer a { color: #1f6feb; }

/* The grid itself: no padding, no hover paint. Custom properties cascade to
   the grid's internal root regardless of its exact class name. */
.grid {
  --lattice-cell-padding-x: 0px;
  --lattice-cell-padding-y: 0px;
  --lattice-hovered-background: transparent;
  --lattice-hover-background: transparent;
}

/* A screen, not a table: no borders of any width, no stripe, no text, no title on hover. */
#grid, #grid .lattice { --lattice-border-width: 0px; --lattice-cell-border-width: 0px; --lattice-row-stripe: transparent; }
#grid .lat-row { border-bottom-width: 0; }
#grid .lat-cell { border-inline-end-width: 0; color: transparent; font-size: 0; line-height: 0; overflow: hidden; pointer-events: none; }
#grid .lat-cell * { pointer-events: none; }
#grid, #grid .lattice { --lattice-background: #000; background: #000; }
