.toolbar { gap: 12px; }
.generation-note { color: #66503a; font-size: .9rem; }
.rules { position: relative; z-index: 1; margin: 0 0 24px; line-height: 1.7; }
.play-area { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(200px, 380px) minmax(0, 1fr); gap: 32px; align-items: center; }
.puzzle-column { width: 100%; }
.puzzle-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; color: var(--bark); font-weight: 600; }
.sudoku-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 4px solid var(--pine); border-radius: 12px; overflow: hidden; background: var(--pine); }
.cell { position: relative; aspect-ratio: 1; min-height: 44px; width: 100%; min-width: 0; border-radius: 0; border: 0; border-right: 1px solid #bbbd9e; border-bottom: 1px solid #bbbd9e; box-shadow: none; padding: 0; background: #fffdf3; color: #256944; font-family: "PingFang SC", sans-serif; font-size: clamp(1.75rem, 5vw, 2.8rem); font-weight: 700; cursor: pointer; }
.cell:nth-child(4n) { border-right: 0; }
.cell:nth-child(4n + 2) { border-right: 3px solid var(--pine); }
.cell:nth-child(n + 5):nth-child(-n + 8) { border-bottom: 3px solid var(--pine); }
.cell:nth-child(n + 13) { border-bottom: 0; }
.cell.given { background: #eee4c5; color: var(--ink); cursor: default; opacity: 1; }
.cell:hover { filter: none; background: #eef3dd; }
.cell.given:hover { background: #eee4c5; }
.cell:active { transform: none; box-shadow: none; }
.cell.selected { background: #fff2bf; box-shadow: inset 0 0 0 3px #b68420; }
.cell.check-ok { background: #e4efdc; }
.cell.check-bad { background: #fbe0d5; color: #9b2f18; }
.cell.selected.check-ok, .cell.selected.check-bad { box-shadow: inset 0 0 0 3px #b68420; }
.cell .mark { position: absolute; top: 2px; right: 5px; font-size: .8rem; line-height: 1.2; }
.cell:focus-visible { outline: 3px solid #805406; outline-offset: -6px; }
button:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #a26408; outline-offset: 4px; }
button:disabled { cursor: default; }
.number-pad button:disabled, #eraseBtn:disabled { opacity: .5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; font-size: .78rem; color: #66503a; }
.legend-given, .legend-fill { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); margin-left: 6px; }
.legend-given { margin-left: 0; }
.legend-fill { background: #256944; }
.controls h2 { margin: 0 0 8px; font-size: 1.3rem; }
.input-hint { margin: 0 0 16px; color: #66503a; line-height: 1.5; }
.number-pad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.number-pad button { padding: 8px 0; font-family: "PingFang SC", sans-serif; font-size: 1.75rem; font-weight: 700; min-height: 58px; border-radius: 14px; }
.erase { width: 100%; margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.actions button { flex: 1 1 auto; }
.status { margin: 18px 0 0; min-height: 3.2em; line-height: 1.5; }
.status[data-kind="success"] { color: #25603d; font-weight: 700; }
.status[data-kind="error"] { color: #96351c; }
.keyboard-hint { color: #75654d; font-size: .8rem; line-height: 1.5; margin: 8px 0 0; }
.howto { margin-top: 24px; line-height: 1.7; }
@media (max-width: 680px) {
  .sheet { padding: 18px 16px 22px; }
  .play-area { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .puzzle-column, .controls { width: min(100%, 380px); margin: auto; }
  .site-switch a { padding: 10px 4px; font-size: .85rem; }
  .generation-note { width: 100%; }
  .controls h2 { font-size: 1.15rem; }
  .cell { font-size: clamp(1.75rem, 7vw, 2.6rem); }
  .status { min-height: 1.6em; }
}
