:root {
  --bg: #ffffff; --fg: #1a1a1a; --muted: #5a5a5a; --line: #d0d0d0; --shade: #efefef; --link: #0b57a4;
  --focus: #0b57a4;
  /* Okabe-Ito colours, separable with the common forms of colour vision deficiency; every square also has a letter */
  --c-A: #009e73; --c-N: #d55e00; --c-Q: #f0e442; --c-D: #bdbdbd;
  --t-A: #ffffff; --t-N: #ffffff; --t-Q: #1a1a1a; --t-D: #1a1a1a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616; --fg: #e8e8e8; --muted: #a8a8a8; --line: #444444; --shade: #262626; --link: #8ab8f0;
    --focus: #8ab8f0; --c-D: #6e6e6e; --t-D: #ffffff;
  }
}
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 72rem; padding: 0 16px 2rem; background: var(--bg); color: var(--fg);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--link); }
h1 { font-size: 1.5rem; margin: 1rem 0 .5rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
code { font-size: .9em; overflow-wrap: anywhere; }
.note { color: var(--muted); font-size: .9rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: end; margin: 1rem 0;
  padding: .75rem; border: 1px solid var(--line); border-radius: 6px; }
.filters label { display: flex; flex-direction: column; font-size: .9rem; gap: .2rem; max-width: 100%; }
.filters label.check { flex-direction: row; align-items: center; gap: .4rem; }
.filters select { font: inherit; max-width: 100%; padding: .25rem; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 4px; }
.filters .note { flex-basis: 100%; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .9rem; margin-bottom: .75rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; }
.grid th, .grid td { border: 1px solid var(--line); padding: .3rem .4rem; text-align: center; vertical-align: middle; }
.grid th.row { text-align: left; font-weight: normal; white-space: nowrap; }
.grid th.pair { text-align: left; background: var(--shade); }
.grid .expl { background: var(--shade); }
.grid td.empty { color: var(--muted); }
.cell { font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: 4px;
  padding: .2rem; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; }
.cell:hover { border-color: var(--line); }
.cell:focus-visible, .cell[aria-pressed="true"] { outline: 2px solid var(--focus); outline-offset: 1px; }
.sq-row { display: flex; gap: 2px; }
.sq { width: 15px; height: 15px; border-radius: 2px; font: bold 10px/15px system-ui, sans-serif; text-align: center; }
.sq.A { background: var(--c-A); color: var(--t-A); }
.sq.N { background: var(--c-N); color: var(--t-N); }
.sq.Q { background: var(--c-Q); color: var(--t-Q); }
.sq.D { background: var(--c-D); color: var(--t-D); }
.codes { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.detail th, .detail td { border: 1px solid var(--line); padding: .25rem .45rem; text-align: right; white-space: nowrap; }
.detail th { background: var(--shade); }
.detail td.l { text-align: left; }
footer { margin-top: 2rem; border-top: 1px solid var(--line); font-size: .92rem; }
footer li { margin: .3rem 0; }
@media (max-width: 480px) {
  body { font-size: 14px; }
  .filters { padding: .5rem; }
  .sq { width: 13px; height: 13px; line-height: 13px; font-size: 9px; }
}
.btn { font: inherit; font-size: .9rem; padding: .3rem .6rem; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.btn:hover { border-color: var(--focus); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.banner { margin: 0 0 .75rem; padding: .5rem .75rem; border: 1px solid var(--c-N); border-left-width: 4px;
  border-radius: 4px; background: var(--shade); }
.strip { display: block; }
.strip .axis { stroke: var(--line); stroke-width: 1; }
.strip .limit { stroke: var(--fg); stroke-width: 1.5; }
.strip .iv { stroke-width: 5; stroke-linecap: butt; }
.strip .ok { stroke: var(--c-A); fill: var(--c-A); }
.strip .bad { stroke: var(--c-N); fill: var(--c-N); }
.strip .mid { stroke: var(--muted); }
