.ws-mark {
  width: 24px;
  height: 24px;
  display: inline-block;
  flex: none;
  vertical-align: middle;
}
.ws-mark .ws-tone { fill: currentColor; fill-opacity: .14; stroke: none; }
.ws-mark .ws-wash-and-stroke { fill: currentColor; fill-opacity: .12; }
.ws-cluster {
  display: inline-flex;
  align-items: flex-start;
  vertical-align: middle;
  flex: none;
  isolation: isolate;
  line-height: 1;
}
.ws-chip {
  --ws-ink: var(--as-c0, #694d19);
  --ws-wash: var(--as-w0, #eee1c6);
  width: 37px;
  height: 37px;
  flex: none;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--ws-ink) 36%, var(--ws-wash));
  border-radius: 9px;
  background: var(--ws-wash);
  color: var(--ws-ink);
}
.ws-chip[data-ws-col="1"] { --ws-ink:var(--as-c1,#36554b); --ws-wash:var(--as-w1,#dde7df); }
.ws-chip[data-ws-col="2"] { --ws-ink:var(--as-c2,#3b5361); --ws-wash:var(--as-w2,#dce4e7); }
.ws-chip[data-ws-col="3"] { --ws-ink:var(--as-c3,#534b60); --ws-wash:var(--as-w3,#e4dfe8); }
.ws-chip[data-ws-col="4"] { --ws-ink:var(--as-c4,#654849); --ws-wash:var(--as-w4,#eaded9); }
.ws-chip[data-ws-col="5"] { --ws-ink:var(--as-c5,#53582f); --ws-wash:var(--as-w5,#e4e6d5); }
.ws-chip-secondary {
  z-index: 1;
  width: 27px;
  height: 27px;
  margin: 12px 0 0 -4px;
  border-radius: 7px;
  box-shadow: 0 0 0 2px var(--as-surface,#faf8f2);
}
.ws-chip-secondary .ws-mark { width: 18px; height: 18px; }
.ws-legend {
  width: fit-content;
  max-width: 100%;
  color: var(--as-ink,#252621);
  font: inherit;
  text-align: start;
}
.ws-legend > summary {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb,var(--as-line,#817e72) 68%,var(--as-surface,#faf8f2));
  border-radius: 5px;
  padding: 4px 9px;
  font: 600 .78rem/1.2 Inter,Arial,sans-serif;
  color: var(--as-ink,#252621);
  background: var(--as-surface,#faf8f2);
  cursor: pointer;
  list-style: none;
}
.ws-legend > summary::-webkit-details-marker { display: none; }
.ws-legend > summary::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
.ws-legend[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.ws-legend > summary:hover { background: var(--as-subtle,#e5e0d6); }
.ws-legend > summary:focus-visible { outline: 2px solid var(--as-focus,#997831); outline-offset: 2px; }
.ws-legend ul {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px 16px;
  padding: 11px 12px;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 5px 0 0;
  background: var(--as-surface,#faf8f2);
  border: 1px solid color-mix(in srgb,var(--as-line,#817e72) 62%,var(--as-surface,#faf8f2));
  border-radius: 8px;
  list-style: none;
}
.ws-legend li {
  display:flex;
  align-items:center;
  gap:7px;
  margin:0;
  color:var(--as-ink,#252621);
  font: 500 .8rem/1.25 Inter,Arial,sans-serif;
}
.ws-legend .ws-chip { width:27px; height:27px; border-radius:6px; }
.ws-legend .ws-mark { width:18px; height:18px; }
@media(max-width:420px) {
  .ws-legend ul { gap:6px 10px; padding:8px; }
}
@media(forced-colors:active) {
  .ws-chip,.ws-legend > summary,.ws-legend ul { border-color:CanvasText; }
  .ws-chip-secondary { outline:2px solid Canvas; }
}

/* The key opens over the register so column headings and rows keep their places. */
.ws-legend { position:relative;flex:none; }
.ws-legend > ul {
  position:absolute;z-index:9;inset-inline-end:0;top:100%;
  width:max-content;max-width:calc(100vw - 34px);
  grid-template-columns:repeat(2,max-content);column-gap:19px;
  box-shadow:0 5px 18px color-mix(in srgb,var(--as-ink) 13%,transparent);
}
@media print { .ws-legend{display:none} }
