:root { color-scheme: light; --ink: #303c32; --lead: #415947; --paper: #fbf6e9; --rule: #918b74; --accent: #285c48; --conflict: #8d2822; }
* { box-sizing: border-box; }
body { margin: 0; background: #eae3d4; color: var(--ink); font: 1rem/1.55 Georgia, serif; }
main { width: min(100% - 2rem, 51rem); margin: auto; padding: 1.35rem 0 3rem; }
a { color: var(--accent); text-underline-offset: .18em; }
header { margin: 1.7rem 0 1.35rem; }
h1 { margin: .25rem 0; font-size: clamp(2.25rem, 8vw, 4.4rem); line-height: .99; letter-spacing: -.045em; }
h2 { margin: 0 0 .25rem; font-size: 1.5rem; line-height: 1.15; }
p { margin: .4rem 0 .8rem; }
.edition { margin: 0; color: var(--lead); font: 700 .74rem/1.25 ui-monospace, monospace; letter-spacing: .11em; text-transform: uppercase; }
.tools { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.tools label { font-weight: bold; }
select, button { min-height: 2.7rem; font: inherit; color: var(--ink); }
.tools select, button { background: var(--paper); border: 1px solid var(--rule); border-radius: .25rem; padding: .3rem .55rem; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.desk { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; align-items: start; }
.sheet, .notes { padding: clamp(.8rem, 4vw, 1.5rem); background: var(--paper); border: 1px solid #c4baa3; box-shadow: 0 .3rem 0 #d9cfb9; }
.sheet { border-block-start: .28rem solid var(--accent); }
.notes { background: repeating-linear-gradient(#f7efd9 0 27px, #e8dcbf 27px 28px); }
.notes h2 { margin-top: .6rem; }
.legend { margin: .7rem 0 0; color: var(--lead); font-size: .93rem; }
#grid { width: min(100%, 20rem); margin: .7rem 0; border-collapse: collapse; text-align: center; table-layout: fixed; }
#grid th { color: var(--lead); font: 700 .76rem ui-monospace, monospace; }
#grid tr > :first-child { width: 1.25rem; }
#grid td[data-index] { position: relative; height: clamp(3rem, 12vw, 4.1rem); border: 1px solid var(--rule); font: 700 1.55rem Georgia, serif; }
#grid td.given { background: #e8e0cc; }
#grid td.neighbor { background: #eef0d9; }
#grid td.selected { background: #deead2; }
#grid td.conflict { background: #f8ddd1; color: var(--conflict); box-shadow: inset 0 -.2rem var(--conflict); }
#grid select { appearance: none; width: 100%; height: 100%; padding: .2rem; background: transparent; border: 0; border-radius: 0; text-align: center; font: 700 1.5rem Georgia, serif; color: var(--accent); cursor: pointer; }
#grid select:focus-visible { outline-offset: -3px; }
#grid td:has(select)::after { content: "▾"; pointer-events: none; color: var(--lead); position: absolute; inset: auto .15rem .05rem auto; font-size: .64rem; }
#grid td.conflict select { color: var(--conflict); }
#check { margin-top: 1.2rem; background: var(--accent); color: white; border-color: var(--accent); }
#status { min-height: 2.8rem; margin-bottom: 0; font-weight: bold; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 36rem) { .desk { grid-template-columns: 1fr; } }
@media print {
  body, .sheet, .notes { background: white; color: black; box-shadow: none; }
  main { width: 100%; }
  nav, .tools, button, #grid td::after { display: none !important; }
}
