:root {
  --ink: #18343b;
  --muted: #5e706e;
  --paper: #f8f3e8;
  --paper-deep: #efe5d2;
  --cream: #fffdf8;
  --teal: #0c746d;
  --teal-dark: #075953;
  --ochre: #e1a52b;
  --coral: #d9684b;
  --sky: #8fc9c4;
  --line: #d6cbb8;
  --success: #247055;
  --error: #a83f32;
  --shadow: 0 18px 60px rgba(49, 63, 58, 0.12);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 7%, rgba(225, 165, 43, 0.08) 0 2px, transparent 3px) 0 0 / 34px 34px,
    var(--paper);
  color: var(--ink);
}

button, input, select { font: inherit; }

a { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  background: var(--ink);
  color: white;
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
}

.skip-link:focus { top: 1rem; }

.site-header {
  max-width: 1220px;
  margin: 0 auto;
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  position: relative;
  display: inline-block;
}

.brand-mark i { position: absolute; display: block; }
.brand-mark i:nth-child(1) { width: 23px; height: 23px; border-radius: 50%; background: var(--teal); left: 0; top: 2px; }
.brand-mark i:nth-child(2) { width: 19px; height: 19px; background: var(--ochre); transform: rotate(10deg); right: 0; bottom: 1px; }
.brand-mark i:nth-child(3) { width: 10px; height: 28px; border: 3px solid var(--coral); transform: rotate(-36deg); left: 17px; top: 8px; }

nav { display: flex; align-items: center; gap: 1.6rem; font-size: 0.92rem; font-weight: 700; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; text-underline-offset: 0.25rem; }
.source-link { border: 1px solid var(--ink); padding: 0.62rem 0.9rem; border-radius: 999px; }

main { overflow: hidden; }

.hero {
  max-width: 1220px;
  margin: 0 auto;
  min-height: 650px;
  padding: 5.5rem 2rem 6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

h1 { margin-bottom: 1.5rem; max-width: 760px; font-size: clamp(3.25rem, 7vw, 6.75rem); }
h1 em { color: var(--coral); font-weight: inherit; }
h2 { margin-bottom: 1rem; font-size: clamp(2.25rem, 4vw, 4rem); }
h3 { font-size: 1.65rem; }

.lede { max-width: 660px; color: var(--muted); font-size: clamp(1.08rem, 1.7vw, 1.32rem); line-height: 1.7; }
.hero-actions, .print-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin-top: 2rem; }

.button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0.84rem 1.25rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover { transform: translateY(-2px); }
.button:disabled { opacity: 0.48; cursor: not-allowed; transform: none; }
.button:focus-visible, button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.button-primary { background: var(--teal); color: white; box-shadow: 0 8px 24px rgba(12, 116, 109, 0.24); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.button-quiet { background: var(--paper-deep); color: var(--ink); }
.text-link { font-weight: 800; text-underline-offset: 0.24rem; }

.trust-list {
  margin: 2.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.2rem;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.trust-list li::before { content: "✓"; margin-right: 0.42rem; color: var(--teal); }

.number-garden {
  min-height: 500px;
  position: relative;
  isolation: isolate;
}

.number-garden::before {
  content: "";
  position: absolute;
  inset: 7% 3% 4% 8%;
  z-index: -2;
  border-radius: 46% 54% 58% 42% / 43% 40% 60% 57%;
  background: #d7e7dc;
  transform: rotate(-4deg);
}

.number-garden::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -25px;
  top: 0;
  z-index: -3;
  border: 28px solid rgba(225, 165, 43, 0.45);
  border-radius: 50%;
}

.number-garden p {
  position: absolute;
  right: 4%;
  bottom: 4%;
  color: var(--teal-dark);
  font-family: Georgia, serif;
  font-size: 1.28rem;
  font-style: italic;
  line-height: 1.55;
  transform: rotate(-3deg);
}

.garden-card {
  width: 205px;
  height: 155px;
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(24, 52, 59, 0.12);
  border-radius: 10px 17px 9px 15px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.garden-card span { color: var(--muted); font-size: 1.25rem; font-weight: 750; }
.garden-card strong { font-family: Georgia, serif; font-size: 4.4rem; line-height: 1; }
.card-one { left: 1%; top: 8%; transform: rotate(-7deg); }
.card-two { right: 0; top: 29%; transform: rotate(6deg); }
.card-three { left: 16%; bottom: 5%; transform: rotate(2deg); }
.garden-shape { position: absolute; z-index: -1; }
.shape-one { width: 94px; height: 94px; background: var(--coral); border-radius: 38% 62% 50% 50%; left: 36%; top: 33%; transform: rotate(18deg); }
.shape-two { width: 42px; height: 138px; border: 10px solid var(--teal); right: 23%; top: 4%; transform: rotate(41deg); }

.practice-section { background: var(--ink); color: var(--cream); padding: 7.5rem max(2rem, calc((100vw - 1160px) / 2)); }
.section-heading { display: grid; grid-template-columns: 1fr minmax(300px, 0.72fr); gap: 4rem; align-items: end; margin-bottom: 3rem; }
.section-heading > p { color: #b9cac6; font-size: 1.04rem; line-height: 1.7; }
.section-heading .eyebrow { color: var(--sky); }
.practice-shell { display: grid; grid-template-columns: 275px minmax(0, 1fr); gap: 1.5rem; align-items: stretch; }
.practice-controls { border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius); padding: 1.25rem; }
.learner-label { display: block; margin-bottom: 0.45rem; color: white; font-size: 0.88rem; font-weight: 800; }
.learner-input { width: 100%; min-height: 48px; border: 1px solid rgba(255,255,255,0.35); border-radius: 12px; padding: 0.7rem 0.8rem; background: rgba(255,255,255,0.1); color: white; font-weight: 750; }
.learner-input::placeholder { color: #b9cac6; }
.learner-help { margin: 0.55rem 0 1.6rem; color: #b9cac6; font-size: 0.76rem; line-height: 1.45; }
.control-label { margin-bottom: 1rem; color: #c6d4d1; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.operation-picker { display: grid; gap: 0.55rem; }
.operation {
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: transparent;
  color: white;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.operation span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,0.32); border-radius: 50%; font-size: 1.25rem; }
.operation:hover { background: rgba(255,255,255,0.08); }
.operation.is-selected { background: var(--cream); color: var(--ink); }
.operation.is-selected span { border-color: var(--ochre); background: var(--ochre); }
.timing-option { margin-top: 1.1rem; padding: 0.75rem; display: flex; align-items: center; gap: 0.7rem; border: 1px solid rgba(255,255,255,0.16); border-radius: 12px; cursor: pointer; }
.timing-option input { width: 21px; height: 21px; accent-color: var(--ochre); }
.timing-option span { display: grid; gap: 0.1rem; }
.timing-option strong { font-size: 0.85rem; }
.timing-option small { color: #b9cac6; font-size: 0.72rem; }
.device-history { margin-top: 1.8rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.16); display: grid; gap: 0.3rem; }
.device-history span { color: #aebfbb; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; }
.device-history strong { font-size: 0.9rem; }
.text-button { width: max-content; padding: 0.2rem 0; border: 0; background: transparent; color: var(--sky); text-decoration: underline; text-underline-offset: 0.2rem; cursor: pointer; }

.practice-card { min-height: 510px; border-radius: var(--radius); background: var(--cream); color: var(--ink); padding: clamp(1.5rem, 5vw, 4.5rem); box-shadow: 0 20px 70px rgba(0,0,0,0.24); }
.progress-row { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.83rem; font-weight: 800; }
.progress-track { height: 7px; margin-top: 0.7rem; overflow: hidden; border-radius: 99px; background: var(--paper-deep); }
.progress-track span { display: block; width: 10%; height: 100%; border-radius: inherit; background: var(--ochre); transition: width 220ms ease; }
.equation { margin: clamp(3.5rem, 8vw, 6rem) 0 1.8rem; display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: clamp(0.45rem, 2.5vw, 1.5rem); font-family: Georgia, serif; font-size: clamp(2.5rem, 8vw, 5.7rem); font-weight: 700; }
.equation input { width: clamp(105px, 18vw, 190px); height: clamp(78px, 12vw, 112px); border: 3px solid var(--line); border-radius: 17px 12px 19px 14px; background: white; color: var(--ink); font-family: inherit; font-size: inherit; font-weight: inherit; text-align: center; }
.equation input.is-correct { border-color: var(--success); background: #edf8f1; }
.equation input.is-wrong { border-color: var(--error); background: #fff2ee; animation: nudge 180ms ease-in-out 2; }
@keyframes nudge { 50% { transform: translateX(5px); } }
.feedback { min-height: 1.7rem; color: var(--muted); text-align: center; font-weight: 700; }
.feedback.success { color: var(--success); }
.feedback.error { color: var(--error); }
.answer-actions { margin-top: 1.3rem; display: flex; justify-content: center; gap: 0.8rem; }
.hint { min-height: 1.6rem; margin: 1.2rem auto 0; max-width: 580px; color: var(--teal-dark); text-align: center; font-style: italic; }
.progress-toolbar select { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0.45rem 0.6rem; background: white; color: var(--ink); }

.complete-view { max-width: 610px; margin: 0 auto; padding-top: 2rem; text-align: center; }
.complete-view[hidden] { display: none; }
.celebration { width: 88px; height: 88px; margin: 0 auto 1.6rem; display: grid; place-items: center; border-radius: 45% 55% 59% 41%; background: var(--ochre); color: var(--ink); font-size: 2.6rem; transform: rotate(-6deg); }
.complete-view h3 { margin-bottom: 1rem; font-size: clamp(2.3rem, 5vw, 3.8rem); }
.complete-view > p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.confidence { margin: 2rem 0; padding: 0; border: 0; }
.confidence legend { width: 100%; margin-bottom: 0.8rem; font-weight: 800; }
.confidence div { display: flex; justify-content: center; gap: 0.55rem; }
.confidence button { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-weight: 850; cursor: pointer; }
.confidence button:hover, .confidence button.is-selected { border-color: var(--teal); background: var(--teal); color: white; }
.complete-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.complete-view .award-note { margin: 1rem auto 0; font-size: 0.78rem !important; }

.progress-panel { margin-top: 1.5rem; padding: clamp(1.25rem, 3vw, 2.5rem); border-radius: var(--radius); background: var(--cream); color: var(--ink); box-shadow: 0 20px 70px rgba(0,0,0,0.2); }
.progress-panel[hidden] { display: none; }
.progress-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.progress-panel h3 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3rem); }
.progress-panel h4 { margin: 0 0 0.8rem; font: 700 1.22rem Georgia, serif; }
.progress-toolbar { margin: 1.7rem 0; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; }
.progress-toolbar label { display: grid; gap: 0.4rem; font-size: 0.8rem; font-weight: 800; }
.progress-toolbar .timing-view { display: flex; align-items: center; gap: 0.55rem; min-height: 42px; }
.timing-view input { width: 20px; height: 20px; accent-color: var(--teal); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
.stats-grid article { min-height: 105px; padding: 1rem; display: grid; align-content: center; gap: 0.28rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.stats-grid strong { font: 700 clamp(1.65rem, 3vw, 2.4rem) Georgia, serif; }
.stats-grid span { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.progress-detail-grid { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr); gap: 1.5rem; }
.progress-detail-grid > article, .session-history { min-width: 0; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; }
.session-history { margin-top: 1.5rem; }
.table-wrap { width: 100%; overflow-x: auto; }
.progress-panel table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.progress-panel th, .progress-panel td { padding: 0.72rem 0.65rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.progress-panel th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.panel-note, .privacy-note, .legacy-note, .empty-state { color: var(--muted); font-size: 0.8rem; line-height: 1.55; }
.fact-list { display: grid; gap: 0.6rem; }
.fact-chip { padding: 0.72rem 0.8rem; display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; border-radius: 10px; background: var(--paper); }
.fact-chip strong { font-family: Georgia, serif; font-size: 1.1rem; }
.fact-chip span { color: var(--muted); font-size: 0.72rem; text-align: right; }
.progress-actions { margin-top: 1.4rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; }
.danger-link { margin-left: auto; color: var(--error); }
.privacy-note, .legacy-note { margin: 1rem 0 0; }

.sudoku-section { padding: 7.5rem max(2rem, calc((100vw - 1160px) / 2)); background: #dce9df; }
.sudoku-section .section-heading > p { color: var(--muted); }
.sudoku-shell { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(250px, 0.65fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.sudoku-card { padding: clamp(1.2rem, 4vw, 2.2rem); border-radius: var(--radius); background: var(--cream); box-shadow: var(--shadow); }
.sudoku-toolbar { margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.sudoku-toolbar > span { font-weight: 850; }
.sudoku-grid { width: min(100%, 390px); aspect-ratio: 1; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); border: 4px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--ink); gap: 1px; }
.sudoku-cell { min-width: 44px; min-height: 44px; border: 0; background: white; color: var(--ink); font: 800 clamp(1.7rem, 5vw, 3.1rem)/1 Georgia, serif; cursor: pointer; }
.sudoku-cell[data-column="1"] { border-right: 3px solid var(--ink); }
.sudoku-cell[data-row="1"] { border-bottom: 3px solid var(--ink); }
.sudoku-cell.is-given { background: var(--paper-deep); color: var(--teal-dark); cursor: default; }
.sudoku-cell.is-selected { position: relative; z-index: 1; background: #fff0bd; box-shadow: inset 0 0 0 4px var(--ochre); }
.sudoku-cell.is-wrong { background: #fff2ee; color: var(--error); box-shadow: inset 0 0 0 3px var(--error); }
.sudoku-cell.is-correct { background: #edf8f1; color: var(--success); }
.sudoku-keypad { margin: 1.1rem auto 0; display: grid; grid-template-columns: repeat(5, minmax(48px, 1fr)); gap: 0.55rem; max-width: 480px; }
.sudoku-keypad button { min-height: 50px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-weight: 850; cursor: pointer; }
.sudoku-keypad button:last-child { font-size: 0.76rem; }
.sudoku-feedback { min-height: 1.6rem; margin: 1rem 0 0; color: var(--muted); text-align: center; font-weight: 750; }
.sudoku-feedback.success { color: var(--success); }
.sudoku-feedback.error { color: var(--error); }
.sudoku-actions { margin-top: 1rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.7rem; }
.sudoku-note { padding: clamp(1.2rem, 3vw, 2rem); border-left: 5px solid var(--teal); }
.sudoku-note h3 { margin-bottom: 0.8rem; }
.sudoku-note p { color: var(--muted); line-height: 1.7; }

.print-section { padding: 8rem max(2rem, calc((100vw - 1160px) / 2)); }
.print-card { display: grid; grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1fr); gap: clamp(3rem, 7vw, 7rem); align-items: center; }
.pdf-preview { min-height: 520px; position: relative; }
.paper-sheet { width: min(355px, 78vw); aspect-ratio: 8.5 / 11; position: absolute; left: 50%; top: 50%; border: 1px solid var(--line); background: white; box-shadow: var(--shadow); }
.sheet-back { transform: translate(-45%, -48%) rotate(8deg); background: #d9e8de; }
.sheet-middle { transform: translate(-53%, -49%) rotate(-5deg); background: #f1d493; }
.sheet-front { transform: translate(-50%, -50%) rotate(1deg); padding: 2.1rem 1.7rem; display: flex; flex-direction: column; }
.sheet-front > span { color: var(--teal); font-size: 0.7rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.sheet-front > strong { margin: 1rem 0 1.5rem; font-family: Georgia, serif; font-size: clamp(1.7rem, 3vw, 2.45rem); line-height: 1.02; }
.sheet-front small { margin-top: auto; color: var(--muted); }
.mini-grid { flex: 1; opacity: 0.55; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 10% 10%; border: 1px solid var(--line); }
.print-copy > p { color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.feature-list { padding: 0; list-style: none; }
.feature-list li { padding: 0.75rem 0 0.75rem 1.8rem; position: relative; border-bottom: 1px solid var(--line); }
.feature-list li::before { content: "○"; position: absolute; left: 0; color: var(--coral); font-weight: 900; }

.approach-section { padding: 7.5rem max(2rem, calc((100vw - 1160px) / 2)); background: #dce9df; }
.approach-section .section-heading > p { color: var(--muted); }
.approach-section .section-heading .eyebrow { color: var(--teal-dark); }
.idea-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.idea-grid article { min-height: 300px; padding: 1.6rem; border: 1px solid rgba(24,52,59,0.17); border-radius: 15px 24px 17px 21px; background: rgba(255,255,255,0.47); }
.idea-grid article:nth-child(2) { transform: translateY(15px) rotate(0.5deg); }
.idea-grid article:nth-child(3) { transform: rotate(-0.5deg); }
.idea-grid h3 { margin-top: 1.5rem; margin-bottom: 0.8rem; font-size: 1.55rem; }
.idea-grid p { color: var(--muted); line-height: 1.65; }
.idea-icon { width: 72px; height: 72px; display: block; position: relative; }
.pattern-icon { border: 10px dotted var(--ochre); border-radius: 50%; }
.shape-icon { background: var(--coral); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.story-icon { border-radius: 50% 50% 45% 55%; background: var(--teal); }
.story-icon::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; color: white; font: 700 2.4rem Georgia, serif; }
.explain-icon { border: 5px solid var(--ink); border-radius: 50%; }
.explain-icon::after { content: ""; position: absolute; right: 4px; bottom: -10px; width: 20px; height: 24px; border-left: 5px solid var(--ink); transform: rotate(-35deg); }

.open-note { max-width: 1160px; margin: 0 auto; padding: 6.5rem 2rem; display: grid; grid-template-columns: 1fr 1fr auto; gap: 3rem; align-items: center; }
.open-note h2 { max-width: 480px; margin: 0; }
.open-note > p { margin: 0; color: var(--muted); line-height: 1.7; }

footer { padding: 2.5rem max(2rem, calc((100vw - 1160px) / 2)); display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; line-height: 1.6; }
footer p { margin: 0; }
footer a { text-underline-offset: 0.2rem; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 900px) {
  .site-header { align-items: flex-start; }
  nav a:not(.source-link) { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 3.5rem; }
  .number-garden { width: min(560px, 100%); margin: 0 auto; }
  .section-heading { grid-template-columns: 1fr; gap: 1rem; }
  .practice-shell { grid-template-columns: 1fr; }
  .operation-picker { grid-template-columns: repeat(4, 1fr); }
  .operation { justify-content: center; }
  .operation span { flex: 0 0 auto; }
  .device-history { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.35rem 0.8rem; }
  .device-history .text-button { grid-column: 1 / -1; }
  .progress-detail-grid { grid-template-columns: 1fr; }
  .print-card { grid-template-columns: 1fr; }
  .sudoku-shell { grid-template-columns: 1fr; }
  .idea-grid { grid-template-columns: repeat(2, 1fr); }
  .open-note { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .site-header { padding: 1rem; gap: 0.8rem; }
  .brand span:last-child { max-width: 160px; font-size: 0.9rem; }
  .source-link { padding: 0.55rem 0.65rem; font-size: 0.78rem; }
  .hero { min-height: 0; padding: 3rem 1.1rem 4.5rem; }
  h1 { font-size: clamp(3.05rem, 16vw, 4.8rem); }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .trust-list { display: grid; }
  .number-garden { min-height: 390px; transform: scale(0.88); transform-origin: center top; margin-bottom: -40px; }
  .garden-card { width: 170px; height: 130px; }
  .garden-card strong { font-size: 3.6rem; }
  .practice-section, .sudoku-section, .print-section, .approach-section { padding: 5rem 1rem; }
  .operation-picker { grid-template-columns: repeat(2, 1fr); }
  .operation { justify-content: flex-start; }
  .practice-card { min-height: 500px; padding: 1.3rem; }
  .equation { margin-top: 4.4rem; gap: 0.42rem; font-size: clamp(2.1rem, 11vw, 3.5rem); }
  .equation input { width: 92px; height: 75px; border-width: 2px; }
  .answer-actions { align-items: stretch; flex-direction: column; }
  .complete-actions { align-items: stretch; flex-direction: column; }
  .sudoku-actions { align-items: stretch; flex-direction: column; }
  .progress-panel-heading { align-items: stretch; flex-direction: column; }
  .progress-panel-heading .button { align-self: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-detail-grid > article, .session-history { padding: 0.85rem; }
  .progress-actions { align-items: stretch; flex-direction: column; }
  .danger-link { width: auto; margin: 0.5rem auto 0; }
  .idea-grid { grid-template-columns: 1fr; }
  .idea-grid article:nth-child(2) { transform: none; }
  .pdf-preview { min-height: 430px; }
  footer { flex-direction: column; }
}

@media (max-width: 420px) {
  .brand { gap: 0.5rem; }
  .brand-mark { width: 36px; height: 36px; transform: scale(0.86); transform-origin: left center; }
  .brand span:last-child { max-width: 112px; font-size: 0.78rem; line-height: 1.1; }
  .source-link { padding: 0.5rem 0.58rem; font-size: 0.7rem; }
  .hero { padding-top: 2rem; }
  h1 { font-size: clamp(2.85rem, 14.5vw, 3.5rem); }
  .lede { font-size: 1rem; line-height: 1.6; }
  .number-garden { width: 122%; min-height: 340px; margin-left: -11%; margin-bottom: -70px; transform: scale(0.78); }
  .practice-section, .sudoku-section, .print-section, .approach-section { padding: 4rem 0.75rem; }
  .practice-controls { padding: 1rem; border-radius: 18px; }
  .operation { min-height: 52px; padding-inline: 0.65rem; gap: 0.55rem; font-size: 0.82rem; }
  .operation span { width: 30px; height: 30px; }
  .practice-card { min-height: 440px; padding: 1rem; border-radius: 18px; }
  .progress-row { font-size: 0.74rem; }
  .equation { margin: 3.2rem 0 1.35rem; gap: 0.28rem; font-size: clamp(2rem, 10.5vw, 2.75rem); }
  .equation input { width: 80px; height: 66px; }
  .feedback { font-size: 0.88rem; }
  .progress-panel { padding: 0.85rem; border-radius: 18px; }
  .stats-grid { gap: 0.55rem; }
  .stats-grid article { min-height: 92px; padding: 0.75rem; }
  .paper-sheet { width: min(300px, 82vw); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .hero, .practice-section, .sudoku-section, .approach-section, .open-note, footer { display: none; }
  .print-section { padding: 0; }
  .print-card { display: block; }
  .pdf-preview { display: none; }
}
