.cw-instruction {
  margin: .35rem 0 1rem;
  color: #315a70;
  font-weight: 700;
}

.cw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(18rem, .92fr);
  gap: 1rem;
  align-items: start;
  margin: 1rem 0;
}

.cw-grid-scroll {
  max-width: 100%;
  overflow: auto;
  padding: .7rem;
  border: 1px solid #d5e5ec;
  border-radius: .8rem;
  background: #f7fbfd;
  overscroll-behavior-inline: contain;
}

.cw-grid {
  display: grid;
  grid-template-columns: repeat(var(--cw-cols), 2rem);
  grid-template-rows: repeat(var(--cw-rows), 2rem);
  gap: 0;
  width: max-content;
  margin: auto;
  border: 1px solid #173f54;
  background: #173f54;
}

.cw-cell,
.cw-block {
  width: 2rem;
  height: 2rem;
}

.cw-cell {
  position: relative;
  display: block;
  background: #fff;
  box-shadow: inset 0 0 0 1px #9ab3bf;
}

.cw-block {
  display: block;
  background: #173f54;
}

.cw-cell input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: #0a3850;
  background: transparent;
  text-align: center;
  text-transform: uppercase;
  font: 800 1rem/1 system-ui, sans-serif;
  caret-color: #0a3850;
}

.cw-cell > span {
  position: absolute;
  z-index: 2;
  top: .08rem;
  left: .14rem;
  color: #405f70;
  font-size: .5rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.cw-cell:focus-within {
  z-index: 3;
  background: #fff0c9;
  box-shadow: inset 0 0 0 3px #d78b16;
}

.cw-clues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.cw-clue-group {
  min-width: 0;
  padding: .8rem;
  border: 1px solid #d5e5ec;
  border-radius: .75rem;
  background: #fbfdff;
}

.cw-clue-group h3 {
  margin: 0 0 .65rem;
  color: #0d4566;
  font-size: 1.05rem;
}

.cw-clue-group ol {
  margin: 0;
  padding-left: 1.45rem;
  line-height: 1.35;
}

.cw-clue-group li {
  margin: 0 0 .55rem;
  break-inside: avoid;
}

.cw-clue-group small {
  color: #637f90;
}

@media (max-width: 850px) {
  .cw-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .cw-grid-scroll { padding: .4rem; }
  .cw-grid {
    grid-template-columns: repeat(var(--cw-cols), 1.75rem);
    grid-template-rows: repeat(var(--cw-rows), 1.75rem);
    margin: 0;
  }
  .cw-cell,
  .cw-block { width: 1.75rem; height: 1.75rem; }
  .cw-cell input { font-size: .92rem; }
  .cw-clues { grid-template-columns: 1fr; }
}
