:root {
  color-scheme: light;
  --ink: #25312e;
  --muted: #64706c;
  --paper: #fffdf8;
  --page: #f3eee3;
  --line: #c8d0c8;
  --line-strong: #3f5f57;
  --sage: #3f6d61;
  --sage-dark: #284b43;
  --sage-soft: #e5eee9;
  --honey: #b97823;
  --honey-dark: #6f3f00;
  --warning: #9a3f2d;
  --warning-soft: #fff0ea;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.55;
  font-weight: 450;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; min-width: 320px; background: var(--page); }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
button:focus-visible, input:focus-visible, summary:focus-visible, .cell:focus-visible { outline: 3px solid #6f3f00; outline-offset: 3px; }

.morning-header { position: relative; min-height: 210px; overflow: hidden; background: #ede3d2; isolation: isolate; }
.morning-header::before { position: absolute; inset: 0; z-index: -2; content: ""; background-image: url("assets/morning-puzzle.webp"); background-position: 66% 55%; background-size: cover; }
.morning-header::after { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(90deg, rgba(250,247,239,.98) 0%, rgba(250,247,239,.9) 39%, rgba(250,247,239,.18) 72%, rgba(250,247,239,.06) 100%); }
.header-inner { width: min(calc(100% - 32px), 1080px); margin: 0 auto; padding: 36px 0 30px; }
.eyebrow { margin: 0 0 5px; color: var(--sage-dark); font-size: .72rem; font-weight: 850; letter-spacing: .14em; }
h1 { margin-bottom: 7px; font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: -.055em; line-height: 1; }
h2 { margin-bottom: 0; font-size: 1.28rem; line-height: 1.25; }
.lead { max-width: 28rem; margin-bottom: 11px; color: #42524d; font-size: 1.02rem; font-weight: 650; }
.quiet-promise { width: max-content; max-width: 100%; margin: 0; padding: 5px 10px; border-radius: 999px; background: rgba(255,253,248,.78); color: var(--sage-dark); font-size: .78rem; font-weight: 750; }

.page-shell { width: min(calc(100% - 32px), 1080px); margin: -22px auto 0; padding-bottom: 36px; }
.puzzle-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 20px; align-items: start; }
.play-surface, .date-card, .guide-card { border: 1px solid rgba(63,95,87,.2); background: var(--paper); box-shadow: 0 12px 35px rgba(50,64,57,.08); }
.play-surface { padding: clamp(18px, 3.2vw, 34px); border-radius: 28px; }
.side-rail { display: grid; gap: 14px; }
.date-card, .guide-card { padding: 20px; border-radius: 20px; }
.today-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.badge { flex: 0 0 auto; padding: 4px 11px; border: 1px solid #afc7bd; border-radius: 999px; color: var(--sage-dark); background: var(--sage-soft); font-size: .78rem; font-weight: 850; }
.daily-status { min-height: 1.5em; margin: 7px 0; color: var(--sage-dark); font-size: .95rem; font-weight: 750; }
.daily-status.is-warning, .game-status.is-warning { color: var(--warning); }
.selection-help { margin: 0 0 8px; color: var(--muted); font-size: .8rem; text-align: right; }

.sudoku-grid { display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 500px); aspect-ratio: 1; margin: 0 auto 13px; overflow: hidden; border: 3px solid var(--line-strong); border-radius: 16px; background: var(--line-strong); box-shadow: 0 10px 24px rgba(40,75,67,.1); }
.cell { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 5px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--sage-dark); background: #fffefb; font-size: clamp(1.65rem, 7.6vw, 2.75rem); font-weight: 780; }
.cell:nth-child(4n) { border-right: 0; }
.cell:nth-child(n+13) { border-bottom: 0; }
.cell:nth-child(4n+2) { border-right: 3px solid var(--line-strong); }
.cell:nth-child(n+9):nth-child(-n+12) { border-top: 3px solid var(--line-strong); }
.cell.is-clue { color: var(--ink); background-color: #edf0e9; background-image: linear-gradient(rgba(63,109,97,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(63,109,97,.035) 1px, transparent 1px); background-size: 12px 12px; }
.cell.is-selected { z-index: 2; background: #fff8e8; box-shadow: inset 0 0 0 4px var(--honey); }
.cell.is-same-number:not(.is-selected) { background: var(--sage-soft); box-shadow: inset 0 0 0 2px var(--sage-dark); outline: 2px dashed rgba(40,75,67,.5); outline-offset: -7px; }
.cell.is-conflict { color: #812f21; background: var(--warning-soft); box-shadow: inset 0 0 0 4px var(--warning); }
.cell.is-selected.is-conflict { box-shadow: inset 0 0 0 4px var(--warning), inset 0 0 0 8px #fff; }
.cell[aria-readonly="true"] { cursor: default; }
.cell[aria-readonly="false"] { cursor: pointer; }
.cell-value { line-height: 1; }
.cell-flag, .cell-tag { position: absolute; z-index: 3; right: 5px; top: 4px; display: grid; place-items: center; min-width: 19px; min-height: 19px; padding: 0 4px; border-radius: 999px; color: #fff; background: var(--warning); font-size: .65rem; font-weight: 900; line-height: 1; }
.cell-tag { right: 4px; top: auto; bottom: 4px; background: var(--honey-dark); font-size: .58rem; }
.cell-notes { display: grid; grid-template-columns: repeat(2, 1fr); align-items: center; width: 100%; height: 100%; color: var(--sage-dark); font-size: clamp(.68rem, 3vw, 1rem); font-weight: 800; line-height: 1; }
.cell-notes span { text-align: center; }

.game-status { min-height: 2.6em; margin: 0 0 11px; color: var(--sage-dark); font-size: .94rem; font-weight: 750; text-align: center; }
.completion-card { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; margin: 0 0 13px; padding: 12px 14px; border: 1px solid #b9cfbd; border-radius: 14px; background: #edf6ec; }
.completion-card[hidden] { display: none; }
.completion-card p { margin: 2px 0 0; color: #52635d; font-size: .82rem; }
.completion-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--sage); font-weight: 900; }

.controls { display: grid; gap: 9px; }
.number-pad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.action-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.button { min-height: 46px; padding: 8px 10px; border: 1px solid var(--sage); border-radius: 12px; color: #fff; background: var(--sage); font-weight: 800; transition: transform .12s ease, background .12s ease; }
.button:hover { background: var(--sage-dark); }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-secondary { border-color: #738780; color: var(--ink); background: #fffdf8; }
.button-secondary:hover { background: #edf2ee; }
.button-hint { border-color: var(--honey-dark); background: var(--honey-dark); }
.button-hint:hover { background: #522f00; }
.button-quiet { border-color: #b9bdb8; color: #47534f; background: #f2f0ea; }
.button-quiet:hover { background: #e8e4dc; }
.digit-button { min-width: 44px; font-size: 1.18rem; }
[aria-pressed="true"] { color: #fff; background: var(--sage-dark); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--sage-dark); }
.control-note { margin: 10px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }

.date-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
input[type="date"] { min-width: 0; min-height: 46px; padding: 8px 10px; border: 1px solid #738780; border-radius: 11px; color: var(--ink); background: #fff; font-size: 16px; }
.muted, .site-footer { color: var(--muted); font-size: .8rem; }
#range-note { margin: 10px 0 0; }
.simple-steps { display: grid; gap: 8px; margin: 14px 0 18px; padding: 0; list-style: none; }
.simple-steps li { display: flex; align-items: center; gap: 9px; font-size: .9rem; font-weight: 650; }
.simple-steps li span { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; color: #fff; background: var(--sage); font-size: .75rem; }
details { border-top: 1px solid #dde1dc; padding: 11px 0; }
summary { min-height: 32px; cursor: pointer; font-size: .88rem; font-weight: 780; }
.details-content { padding-top: 9px; color: #4f5b57; font-size: .83rem; }
.details-content p:last-child { margin-bottom: 0; }
.sample-grid { display: grid; grid-template-columns: repeat(4, 30px); width: max-content; overflow: hidden; border: 2px solid var(--line-strong); border-radius: 6px; }
.sample-grid span { display: grid; place-items: center; width: 30px; height: 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--sage-dark); background: #fff; font-weight: 800; }
.sample-grid span:nth-child(4n) { border-right: 0; }
.sample-grid span:nth-child(n+13) { border-bottom: 0; }
.sample-grid span:nth-child(n+9):nth-child(-n+12) { border-top: 2px solid var(--line-strong); }
.site-footer { padding: 22px 0 0; text-align: center; }
.site-footer p { margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .morning-header { min-height: 176px; }
  .morning-header::before { background-position: 72% 55%; }
  .morning-header::after { background: linear-gradient(90deg, rgba(250,247,239,.98) 0%, rgba(250,247,239,.9) 56%, rgba(250,247,239,.25) 100%); }
  .header-inner { padding: 25px 0 22px; }
  .page-shell { margin-top: -17px; }
  .puzzle-layout { grid-template-columns: minmax(0, 1fr); }
  .side-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .morning-header { min-height: 152px; }
  .morning-header::before { opacity: .72; background-position: 68% 52%; }
  .morning-header::after { background: linear-gradient(90deg, rgba(250,247,239,.98) 0%, rgba(250,247,239,.93) 67%, rgba(250,247,239,.35) 100%); }
  .header-inner { width: calc(100% - 28px); padding: 18px 0; }
  h1 { font-size: clamp(2.15rem, 12vw, 3rem); }
  .lead { margin-bottom: 7px; font-size: .9rem; }
  .quiet-promise { font-size: .68rem; }
  .page-shell { width: calc(100% - 16px); margin-top: -12px; padding-bottom: 24px; }
  .puzzle-layout { gap: 12px; }
  .play-surface { padding: 14px; border-radius: 20px; }
  .daily-status { margin-bottom: 3px; font-size: .86rem; }
  .selection-help { margin-bottom: 5px; }
  .sudoku-grid { width: 100%; max-width: 420px; border-radius: 12px; }
  .cell { font-size: clamp(1.7rem, 10vw, 2.35rem); }
  .cell-flag { right: 3px; top: 3px; }
  .cell-tag { right: 3px; bottom: 3px; }
  .game-status { min-height: 2.4em; margin-bottom: 8px; font-size: .86rem; }
  .number-pad, .action-row { gap: 6px; }
  .action-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .button { min-height: 46px; padding-inline: 6px; font-size: .88rem; }
  .digit-button { font-size: 1.14rem; }
  .control-note { display: none; }
  .side-rail { grid-template-columns: 1fr; }
  .date-card, .guide-card { padding: 16px; border-radius: 17px; box-shadow: none; }
  .date-row { grid-template-columns: 1fr; }
  .date-row .button { width: 100%; }
}
@media (max-width: 340px) {
  .header-inner { width: calc(100% - 20px); }
  .quiet-promise { padding-inline: 7px; letter-spacing: -.02em; }
  .page-shell { width: calc(100% - 10px); }
  .play-surface { padding: 10px; }
  .button { min-height: 44px; font-size: .8rem; }
  .cell-tag { font-size: .5rem; }
}
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }

/* Stage A: first-view compression and tool entry */
.morning-header { min-height: 0; }
.header-inner { padding: 22px 0 20px; }
h1 { max-width: 24ch; font-size: clamp(1.75rem, 4vw, 2.8rem); line-height: 1.12; word-break: auto-phrase; }
.lead { margin-bottom: 9px; font-size: .92rem; line-height: 1.5; }
.firstview-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 10px 0 7px; padding-left: 1.1rem; color: var(--ink); font-size: .76rem; font-weight: 700; line-height: 1.35; }
.firstview-steps li { min-width: 0; padding-right: 3px; }
.firstview-cta { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: .55rem 1rem; border-radius: 9px; color: #fff; background: var(--sage-dark); font-size: .88rem; font-weight: 850; text-decoration: none; }
.firstview-cta:hover { background: #203f38; }
.firstview-cta:focus-visible { outline: 3px solid var(--honey-dark); outline-offset: 3px; }
@media (max-width: 640px) {
  .morning-header { min-height: 0; }
  .morning-header::before { display: none; }
  .morning-header::after { background: #faf7ef; }
  .header-inner { padding: 15px 0 17px; }
  h1 { max-width: none; margin-bottom: 6px; font-size: clamp(1.45rem, 7.5vw, 1.8rem); }
  .lead { margin-bottom: 7px; font-size: .82rem; }
  .firstview-steps { gap: 3px; margin: 7px 0 6px; padding-left: 1rem; font-size: 10px; }
  .firstview-steps li { padding-right: 1px; }
  .quiet-promise { margin-top: 7px; font-size: .68rem; }
  .play-surface .today-line { gap: 8px; margin-bottom: 2px; }
  .play-surface .today-line .eyebrow { display: none; }
  .play-surface .today-line h2 { font-size: 1.08rem; }
}
@media (max-width: 340px) {
  .firstview-steps { grid-template-columns: 1fr; gap: 2px; }
  .firstview-steps li { padding: 0; }
}

