:root {
  --sheet-w: 210mm;
  --sheet-h: 297mm;
  --answer: #d3312b;
}

.ks-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #ddd4bf;
}

.ks-tab {
  min-width: 84px;
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ks-tab[aria-selected="true"] {
  background: var(--toolbar);
  color: var(--toolbar-text);
  font-weight: 700;
}

@media screen {
  .ks-sheets[data-view="q"] .is-answer,
  .ks-sheets[data-view="a"] .is-question {
    display: none;
  }
}

.ks-sheet {
  font-family: var(--cell-font);
  font-synthesis: none;
}

.ks-sheet .sheet-head {
  flex-wrap: wrap;
  row-gap: 3mm;
}

.ks-answer-mark {
  margin-left: 2mm;
  padding: 0.5mm 2.5mm;
  border: 0.4mm solid var(--answer);
  border-radius: 1.5mm;
  color: var(--answer);
  font-size: 4.2mm;
  vertical-align: 1mm;
}

.ks-body {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 100マス */
.hm-grid {
  display: grid;
  grid-template-columns: repeat(11, 15.5mm);
  grid-auto-rows: 15.5mm;
  border: 0.6mm solid var(--grid-outer);
}

.hm-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 0.25mm solid var(--grid-line);
  border-bottom: 0.25mm solid var(--grid-line);
  font-size: 7.2mm;
  line-height: 1;
}

.hm-cell:nth-child(11n) {
  border-right: none;
}

.hm-cell:nth-last-child(-n + 11) {
  border-bottom: none;
}

.hm-cell.is-head {
  background: #efe8d6;
  font-weight: 700;
}

.hm-cell.is-op {
  background: var(--toolbar);
  color: #fff;
  font-size: 8mm;
}

.hm-grid > .hm-cell:nth-child(-n + 11) {
  border-bottom: 0.6mm solid var(--grid-outer);
}

.hm-grid > .hm-cell:nth-child(11n + 1) {
  border-right: 0.6mm solid var(--grid-outer);
}

.hm-cell.is-answer {
  color: var(--answer);
  font-weight: 700;
}

/* ドリル */
.dr-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  grid-template-rows: repeat(10, 1fr);
  column-gap: 10mm;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 4mm 2mm 0;
  list-style: none;
}

.dr-item {
  display: flex;
  align-items: center;
  gap: 2mm;
  border-bottom: 0.25mm dashed #cfc8b6;
  font-size: 8mm;
  line-height: 1;
}

.dr-no {
  flex: none;
  width: 11mm;
  font-size: 4mm;
  color: var(--muted);
}

.dr-expr {
  flex: 1;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.dr-box {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24mm;
  height: 13mm;
  border: 0.4mm solid var(--grid-outer);
  border-radius: 1.5mm;
}

.dr-box.is-answer {
  color: var(--answer);
  font-weight: 700;
}

@page {
  size: A4 portrait;
  margin: 0;
}
