:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #2c403f;
  background: #f4f1e9;
  line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1180px; margin: auto; padding: 24px; }
.page-heading { max-width: 800px; margin-bottom: 24px; }
.eyebrow { color: #6d7362; font-weight: 650; letter-spacing: .07em; font-size: 13px; text-transform: uppercase; }
h1 { margin: 8px 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; }
h2 { margin: 0; font-size: 23px; }
h3 { margin: 0 0 12px; font-size: 18px; }
p { margin: 10px 0; }
.status { border-left: 4px solid #87a695; padding: 8px 12px; background: #e9eee3; font-size: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
a { color: #276a64; text-underline-offset: 3px; }
.section-heading a { display: inline-flex; min-height: 56px; align-items: center; }
.comparison { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.sample { background: #fffdf7; border: 1px solid #dfdfd2; border-radius: 18px; padding: 14px; min-width: 0; }
.sample h3 { margin: 0 0 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
figure { margin: 0; min-width: 0; }
.pair img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; display: block; border: 1px solid #ece7dc; border-radius: 8px; background: #fff; }
figcaption { color: #68716b; text-align: center; font-size: 13px; margin: 5px 0; }
button { min-width: 56px; min-height: 56px; padding: 8px 14px; color: #2c403f; background: #f3f5ee; border: 1px solid #c6d4c8; border-radius: 12px; font: inherit; font-weight: 650; cursor: pointer; }
button:hover { background: #e2ece0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #cf8a30; outline-offset: 3px; }
.sample button { width: 100%; font-size: 14px; margin-top: 8px; }
.detail { margin-top: 32px; padding: 22px; border: 1px solid #dce0d4; border-radius: 22px; background: #fffdf7; scroll-margin-top: 16px; }
.subject-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
button[aria-pressed="true"] { color: #fff; border-color: #326a60; background: #326a60; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card-panel, .puzzle-panel { min-width: 0; }
.word-card { background: #fff; border: 2px solid #dbddd0; border-radius: 22px; padding: 12px; width: 100%; max-width: 370px; margin: 0 auto; }
.word-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 12px; }
.word-card p { text-align: center; font-weight: 700; font-size: 27px; margin: 10px 0 2px; }
.puzzle-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; }
.piece-picker { display: flex; gap: 6px; }
.gap-option { display: flex; gap: 8px; align-items: center; min-height: 56px; font-size: 14px; cursor: pointer; }
.gap-option input { width: 22px; height: 22px; accent-color: #326a60; }
.puzzle { width: 100%; max-width: 360px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(var(--cols),1fr); grid-template-rows: repeat(var(--rows),1fr); margin: auto; background: #e4eadf; border: 3px solid #cedacb; border-radius: 9px; overflow: hidden; }
.puzzle.separated { gap: 6px; padding: 6px; }
.puzzle-piece { min-width: 0; min-height: 0; background-repeat: no-repeat; }
.puzzle.separated .puzzle-piece { border-radius: 3px; box-shadow: 0 1px 3px #263c3a20; }
.caption { text-align: center; font-weight: 650; }
.detail-note { font-size: 14px; color: #64736b; margin: 18px 0 0; max-width: 820px; }
footer { margin: 28px 0 8px; font-size: 13px; color: #65716c; }
footer code { overflow-wrap: anywhere; }
@media (max-width: 900px) { .comparison { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 580px) {
  main { padding: 16px; }
  .comparison { grid-template-columns: 1fr; }
  .detail { padding: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .subject-picker button { flex: 1 0 40%; }
}
@media print {
  :root { background: white; }
  main { padding: 0; }
  .sample { break-inside: avoid; }
  .sample button, .section-heading a, .subject-picker, .puzzle-toolbar { display: none; }
  .comparison { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .detail { break-before: page; }
}

