:root {
  color-scheme: light;
  --paper: #f5f6ef;
  --white: #fcfdf8;
  --ink: #222d24;
  --muted: #536456;
  --green: #254f38;
  --line: #d9e0d3;
  --soft: #e8eee1;
  --board-line: #d7dfd1;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #4a815b; outline-offset: 3px; }
button, select { touch-action: manipulation; }
[hidden] { display: none !important; }
.top { border-bottom: 1px solid #dde3d7; }
.bar, .layout, .footer { width: min(100% - 64px, 980px); margin-inline: auto; }
.bar { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; gap: 11px; align-items: center; font-size: 1rem; font-weight: 800; white-space: nowrap; }
.mark { width: 33px; height: 33px; flex: none; display: grid; grid-template-columns: repeat(2, 6px); grid-auto-rows: 6px; gap: 3px; place-content: center; border-radius: 10px; background: var(--green); }
.mark i { background: #e4efdb; border-radius: 1px; }
.mark i:last-child { background: #a7cb93; }
.top-actions { display: flex; gap: 8px; }
.top-actions .ghost { white-space: nowrap; }
.ghost { padding: 8px 12px; min-height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--white); font-weight: 650; font-size: .875rem; }
.ghost:hover, .edits button:not(:disabled):hover { background: var(--soft); }
.help-icon { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; margin-right: 4px; font-size: .7rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 332px); gap: 30px; align-items: start; padding-top: 33px; }
.intro { margin-bottom: 19px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 5vw, 3.15rem); font-weight: 800; letter-spacing: -.08em; line-height: 1.13; }
.intro p { margin-top: 9px; color: var(--muted); font-size: 1rem; }
.board-frame, .panel { background: var(--white); border: 1px solid var(--line); border-radius: 18px; }
.board-frame { padding: 13px clamp(10px, 2vw, 19px) clamp(10px, 2vw, 19px); box-shadow: 0 9px 22px #36533d0a; }
.board-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; gap: 8px; }
.level-label { border-radius: 999px; background: var(--soft); color: var(--green); font-weight: 750; padding: 4px 10px; font-size: .875rem; }
.board-count { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.board { aspect-ratio: 1; border: 2px solid #657967; border-radius: 8px; overflow: hidden; display: grid; grid-template-rows: repeat(9, minmax(0, 1fr)); background: var(--white); }
.board-row { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); min-height: 0; }
.board-row:not(:last-child) { border-bottom: 1px solid var(--board-line); }
.board-row:nth-child(3n):not(:last-child) { border-bottom: 2px solid #657967; }
.cell { position: relative; display: grid; place-items: center; border: 0; padding: 0; min-width: 0; border-radius: 0; background: #fbfcf8; color: #28573c; font-size: clamp(1.04rem, 3.2vw, 1.92rem); font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.cell:not(:last-child) { border-right: 1px solid var(--board-line); }
.cell:nth-child(3n):not(:last-child) { border-right: 2px solid #657967; }
.cell.fixed { font-weight: 750; color: #27372b; }
.cell.peer { background: #eef3e8; }
.cell.same { background: #e1ecda; }
.cell.conflict { background: #f8e5df; color: #983727; }
.cell.selected { background: #d5e6c9; z-index: 1; box-shadow: inset 0 0 0 2px #578159; }
.cell.suggested { background: #f7edc9; box-shadow: inset 0 0 0 2px #9b7c34; }
.cell.selected.conflict { background: #f4d9d1; }
.cell:focus-visible { outline-offset: -4px; z-index: 2; }
.cell .pencils { width: 83%; height: 85%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; font-size: clamp(.5rem, 1.2vw, .75rem); color: #45634d; }
.keyboard { text-align: center; margin-top: 13px; color: var(--muted); font-size: .84rem; }
.controls { display: grid; gap: 12px; padding-top: 4px; }
.panel { padding: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
h2 { font-size: 1rem; line-height: 1.4; font-weight: 800; letter-spacing: -.03em; }
.text-button { border: 0; background: transparent; color: var(--green); padding: 4px 7px; font-size: .9rem; font-weight: 750; border-radius: 7px; }
.text-button:hover, .note-toggle[aria-pressed=true] { background: var(--soft); }
.levels { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 3px; padding: 4px; border-radius: 10px; margin-top: 8px; background: #edf0e7; }
.levels button { border: 0; border-radius: 7px; min-height: 35px; padding: 2px; color: #46574a; background: transparent; font-size: .875rem; font-weight: 680; }
.levels button[aria-pressed=true] { background: var(--green); color: white; }
.levels button:not([aria-pressed=true]):hover { background: #dfe8db; }
.divider { border-top: 1px solid var(--line); margin: 14px 0 11px; }
.numbers { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; margin-top: 8px; }
.numbers button { min-height: 38px; background: #f1f4eb; border: 1px solid #e2e8dd; border-radius: 8px; color: var(--green); font-size: 1.2rem; font-weight: 700; }
.numbers button:not(:disabled):hover { background: #e1edda; }
.edits, .auto-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.edits button { min-height: 38px; border-radius: 8px; border: 1px solid var(--line); background: transparent; font-size: .875rem; font-weight: 650; }
.quiet { font-size: .84rem; font-weight: 700; color: var(--green); }
.hint-message { margin-top: 5px; min-height: 26px; font-size: .9rem; color: var(--muted); line-height: 1.47; }
.hint-button { width: 100%; min-height: 39px; margin-top: 7px; border-radius: 8px; border: 1px solid #d8e4d3; background: #ebf1e6; font-weight: 750; color: var(--green); font-size: .9rem; }
.hint-button:not(:disabled):hover { background: #dcead7; }
.auto-panel { background: #e8efe2; border-color: #d7e2d2; }
.auto-heading { display: flex; align-items: center; gap: 9px; }
.auto-icon { display: grid; place-items: center; width: 37px; height: 37px; flex: none; border-radius: 10px; background: #d9e7d2; color: var(--green); font-size: 1.4rem; }
.auto-heading p { color: var(--muted); font-size: .875rem; line-height: 1.4; }
.auto-actions { grid-template-columns: 1fr auto; }
.primary { min-height: 39px; padding: 7px 14px; background: var(--green); color: white; font-weight: 750; font-size: .9rem; border: 1px solid transparent; border-radius: 8px; }
.primary:not(:disabled):hover { background: #326448; }
.speed-label { position: relative; }
.speed-label::after { content: ""; pointer-events: none; width: 6px; height: 6px; border: solid var(--green); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); position: absolute; top: 14px; right: 12px; }
select { appearance: none; height: 100%; min-height: 39px; width: 84px; padding: 4px 24px 4px 9px; background: #f9fbf6; border: 1px solid #d0ddce; border-radius: 8px; font-size: .875rem; }
.continuation { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: .875rem; }
.continuation input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 23px; padding: 14px 0 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
dialog { max-width: min(420px, calc(100% - 36px)); border: 1px solid var(--line); border-radius: 16px; background: var(--white); color: var(--ink); padding: 23px; }
dialog::backdrop { background: #20332666; }
dialog h2 { font-size: 1.25rem; }
dialog p { margin-top: 12px; line-height: 1.6; }
.dialog-actions { margin-top: 18px; display: flex; justify-content: end; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 780px) {
  .layout { gap: 17px; grid-template-columns: minmax(0, 1fr) minmax(255px, 292px); }
  .bar, .layout, .footer { width: calc(100% - 36px); }
}
@media (max-width: 660px) {
  .bar { min-height: 58px; }
  .layout { width: min(100% - 24px, 515px); padding-top: 19px; grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .intro { margin-bottom: 12px; padding-inline: 4px; }
  .intro p { margin-top: 4px; }
  .cell { font-size: clamp(1rem, 5vw, 1.6rem); }
  .cell .pencils { font-size: clamp(.48rem, 2vw, .72rem); }
  .keyboard { display: none; }
  .controls { padding-top: 0; }
  .numbers { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
  .numbers button { min-height: 41px; padding: 0; }
  .panel { padding: 13px; }
}
@media (max-width: 420px) {
  .bar { gap: 8px; }
  .brand { gap: 8px; min-width: 0; }
  .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .top-actions { gap: 6px; flex: none; }
  .top-actions .ghost { padding: 8px 10px; }
  #open-guide .guide-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #open-guide .help-icon { margin-right: 0; }
}
.guide { width: min(600px, calc(100% - 24px)); max-width: none; max-height: min(88dvh, 810px); padding: 0 22px 22px; }
.guide-header { position: sticky; top: 0; z-index: 2; padding: 17px 0 9px; background: var(--white); }
.guide-languages { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.guide-languages button { min-height: 37px; padding: 5px 11px; background: var(--soft); color: var(--green); border-radius: 7px; border: 0; font-weight: 700; }
.guide-languages button[aria-pressed=true] { color: white; background: var(--green); }
.guide h3 { margin: 0; font-size: 1.05rem; }
.guide-rule { margin-top: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.guide-rule p, .guide-tips p { margin-top: 6px; }
.example-grid { width: min(100%, 300px); margin-top: 11px; border: 1px solid #809383; border-radius: 5px; overflow: hidden; }
.example-box { width: min(100%, 110px); }
.example-line { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
.example-box .example-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.example-line:not(:last-child) { border-bottom: 1px solid var(--line); }
.example-column .example-line:nth-child(3n):not(:last-child) { border-bottom: 2px solid #809383; }
.example-cell { aspect-ratio: 1; display: grid; place-items: center; color: #626f63; font-size: clamp(.7rem, 3vw, .95rem); }
.example-cell:not(:last-child) { border-right: 1px solid var(--line); }
.example-column .example-cell:nth-child(3n):not(:last-child) { border-right: 2px solid #809383; }
.example-active { color: var(--green); background: #dcebd6; font-weight: 750; }
.example-blank { background: #f7e9bc; color: #624a15; box-shadow: inset 0 0 0 2px #a58a48; }
.example-answer strong { margin-right: 4px; color: var(--green); }
.guide-tips { margin-top: 13px; padding: 14px; border-radius: 12px; background: var(--soft); }

.web-privacy { margin: 0 auto 2rem; padding: 0 1rem; text-align: center; font-size: .82rem; }
.web-privacy a { color: var(--green); }
.web-ad { width: min(100% - 36px, 728px); margin: 3rem auto 0; }
