/* Scoped styles keep the site's dark input/button theme out of the white cells. */
.cw-workspace { color: #25343a; }
.cw-instructions { line-height: 1.65; max-width: 85ch; }
.cw-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, 1fr); gap: 28px; align-items: start; }
.cw-puzzle { min-width: 0; }
.cw-answer-panel { padding: 16px; margin-bottom: 18px; background: #edf6f2; border: 1px solid #b8d5c9; border-left: 4px solid #137860; border-radius: 8px; }
.cw-active-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: #137860; }
#cw-letter-count { font-size: .85rem; }
#cw-active-clue { margin: 8px 0 12px; color: #25343a; line-height: 1.5; }
.cw-answer-panel label { display: block; margin-bottom: 6px; font-weight: 700; font-size: .85rem; }
.cw-answer-row { display: flex; align-items: stretch; gap: 8px; }
#cw-answer { box-sizing: border-box; width: 100%; min-width: 0; min-height: 46px; margin: 0; padding: 8px 10px; border: 2px solid #6c8b7f; border-radius: 5px; background: #fff; color: #183b31; font-size: 1.1rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
#cw-answer:focus { outline: 3px solid #8dccb5; outline-offset: 2px; }
.cw-answer-row button { flex-shrink: 0; margin: 0; padding: 8px 12px; }
#crossword-board.cw-grid { display: grid; grid-template-columns: repeat(var(--cw-columns), minmax(0, 1fr)); gap: 2px; width: 100%; max-width: 560px; padding: 6px; box-sizing: border-box; background: #dce3e0; border: 1px solid #a9b9b2; border-radius: 6px; }
.cw-grid .cw-block { aspect-ratio: 1; background: #46544e; border-radius: 1px; }
#crossword-board .cw-square { appearance: none; position: relative; display: grid; place-items: center; box-sizing: border-box; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1; margin: 0; padding: 8px 0 0; border: 1px solid #768b81; border-radius: 1px; background: #fff; color: #162c24; font-size: clamp(.85rem, 2.7vw, 1.35rem); font-weight: 800; line-height: 1; box-shadow: none; cursor: pointer; }
#crossword-board .cw-square.is-active { background: #d8f0e5; border-color: #137860; }
#crossword-board .cw-square.is-cursor { background: #aedfc9; outline: 3px solid #137860; outline-offset: -3px; z-index: 1; }
#crossword-board .cw-square:focus-visible { outline: 3px solid #1755a1; outline-offset: -3px; z-index: 2; }
#crossword-board .cw-square.is-correct { color: #116546; }
#crossword-board .cw-square.is-error { background: #fff0ee; color: #a12228; box-shadow: inset 0 -3px #be3943; }
.cw-square .cw-number { position: absolute; top: 2px; left: 3px; font-size: clamp(.55rem, 1.5vw, .7rem); font-weight: 700; color: #263f34; line-height: 1; }
.cw-grid-help { color: #596a62; font-size: .82rem; line-height: 1.5; margin: 12px 0 0; }
.cw-clues h3 { margin: 0 0 10px; font-size: 1rem; color: #137860; }
.cw-clues h3:not(:first-child) { margin-top: 20px; }
.cw-clue-list { display: grid; gap: 7px; }
#crossword-wrap .cw-clues .cw-clue { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; width: 100%; padding: 10px; margin: 0; border: 1px solid #d5dfd9; border-radius: 6px; background: #fff; color: #25343a; text-align: left; line-height: 1.45; box-shadow: none; font: inherit; cursor: pointer; }
#crossword-wrap .cw-clues .cw-clue:hover { background: #f3f8f5; border-color: #6d9c86; }
#crossword-wrap .cw-clues .cw-clue[aria-pressed="true"] { background: #edf6f2; border: 2px solid #137860; padding: 9px; }
.cw-clue-number { font-weight: 800; color: #137860; }
.cw-clue small { display: block; margin-top: 4px; font-size: .76rem; color: #65756c; }
.cw-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid #d5dfd9; margin-top: 24px; padding-top: 18px; }
#cw-progress { margin-right: auto; font-size: .88rem; color: #53675c; }
.cw-toolbar button { margin: 0; }
.cw-result { margin: 14px 0 0; font-weight: 700; line-height: 1.6; }
.cw-result:empty { display: none; }
.cw-result[data-state="error"] { color: #a12228; }
.cw-result[data-state="success"] { color: #116546; }
.cw-result[data-state="solution"] { color: #845615; }
@media (max-width: 1050px) { .cw-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; } .cw-puzzle { max-width: 560px; } }
@media (max-width: 420px) { .cw-workspace { padding: 12px; } .cw-answer-panel { padding: 12px; } .cw-answer-row { flex-wrap: wrap; } .cw-answer-row button { width: 100%; } #crossword-board.cw-grid { gap: 1px; padding: 3px; } #crossword-board .cw-square { padding-top: 6px; font-size: .88rem; } .cw-square .cw-number { font-size: .52rem; top: 1px; left: 2px; } }
@media (prefers-reduced-motion: reduce) { #crossword-wrap * { animation: none; transition: none; } }
@media print { .cw-answer-panel, .cw-grid-help, .cw-toolbar, .cw-result { display: none; } .cw-layout { grid-template-columns: 1fr 1fr; } #crossword-board { print-color-adjust: exact; } }

#crossword-wrap .cw-answer-row button, #crossword-wrap .cw-toolbar button { border-radius:5px; border:1px solid #137860; background:#137860; color:#fff; box-shadow:none; min-height:42px; padding:8px 12px; font-size:14px; }
#crossword-wrap .cw-toolbar button.secondary { background:#fff; color:#25343a; border-color:#a9b9b2; }
