.worksheet-main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(54px, 7vw, 90px) 0 72px;
}

.worksheet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, .65fr);
  align-items: center;
  gap: clamp(42px, 8vw, 100px);
}

.worksheet-hero h1 {
  margin: 0;
  font-size: clamp(50px, 7vw, 82px);
  font-weight: 950;
  letter-spacing: -.06em;
  line-height: 1.02;
}

.worksheet-hero h1 em { color: var(--mint-deep); font-style: normal; }
.worksheet-hero-copy > p:last-of-type { max-width: 650px; margin: 22px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 20px); font-weight: 650; }

.worksheet-start {
  min-height: 54px;
  margin-top: 28px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  border-radius: 18px;
  background: var(--mint-deep);
  color: var(--on-dark);
  font-weight: 900;
  text-decoration: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.worksheet-start:hover { opacity: .86; transform: translateY(-2px); }

.hero-paper {
  position: relative;
  min-height: 430px;
  padding: 58px 36px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #e7ded1;
  border-radius: 10px 46px 12px 10px;
  background: #fffefa;
  color: #2e2a26;
  box-shadow: 22px 25px 0 var(--gold-soft), 0 28px 64px rgba(46, 42, 38, .13);
  transform: rotate(2.4deg);
}

.hero-paper::after {
  position: absolute;
  right: 0;
  top: 0;
  width: 58px;
  aspect-ratio: 1;
  border-radius: 0 44px 0 10px;
  background: linear-gradient(225deg, var(--cream) 48%, #e8dfd3 50%, #fffefa 52%);
  content: "";
}

.hero-paper-tab { position: absolute; left: -17px; top: 30px; padding: 8px 14px; border-radius: 12px 4px 4px 12px; background: var(--coral); color: #5b2d20; font-size: 12px; font-weight: 950; letter-spacing: .12em; }
.hero-paper p { margin: 0; color: #777067; font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.hero-paper > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-paper strong { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #eadfd2; border-radius: 12px; background: linear-gradient(90deg, transparent 49%, #efe7dc 50%, transparent 51%), linear-gradient(transparent 49%, #efe7dc 50%, transparent 51%); color: #2d726a; font-size: 40px; }
.hero-paper small { color: #8a8177; font-weight: 750; }

.worksheet-maker {
  margin-top: clamp(76px, 10vw, 126px);
  display: grid;
  grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr);
  overflow: hidden;
  border-radius: 44px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: 0 30px 80px rgba(46, 42, 38, .08);
}

.worksheet-controls { padding: clamp(28px, 4vw, 44px); }
.maker-heading p, .preview-heading p { margin: 0; color: var(--coral-deep); font-size: 11px; font-weight: 950; letter-spacing: .13em; text-transform: uppercase; }
.maker-heading h2 { margin: 7px 0 0; font-size: clamp(32px, 4vw, 44px); font-weight: 950; letter-spacing: -.04em; }

.control-step { padding: 30px 0; border-top: 1px solid var(--line); }
.maker-heading + .control-step { margin-top: 28px; }
.step-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 13px; }
.step-heading > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #463217; font-size: 13px; font-weight: 950; }
.step-heading h3 { margin: 0; font-size: 18px; font-weight: 950; }
.step-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }

.layout-options { margin-top: 17px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.layout-options button { min-height: 88px; padding: 14px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 18px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.layout-options button[aria-pressed="true"] { border-color: var(--mint); background: var(--mint-soft); color: var(--mint-deep); }
.layout-options strong { font-size: 14px; font-weight: 950; }
.layout-options small { color: var(--muted); font-size: 10px; font-weight: 700; }

.group-options { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 8px; }
.group-options button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 999px; background: var(--surface-muted); color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 850; }
.group-options button[aria-pressed="true"] { background: var(--mint-deep); color: var(--on-dark); }

.symbol-picker { margin-top: 15px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.symbol-picker button { position: relative; min-height: 46px; border: 1px solid transparent; border-radius: 12px; background: var(--surface-muted); color: var(--muted); cursor: pointer; font-size: 22px; font-weight: 900; }
.symbol-picker button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--mint) 55%, transparent); background: var(--surface); color: var(--mint-deep); }
.symbol-picker button[aria-pressed="true"]::after { position: absolute; right: 3px; top: 1px; color: var(--gold-deep); content: "•"; font-size: 12px; }

.print-step { padding-bottom: 0; }
.print-button { width: 100%; min-height: 56px; margin-top: 18px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 18px; background: var(--coral); color: #572e22; cursor: pointer; font-weight: 950; }
.print-button:hover { filter: saturate(1.06); }
.print-tip { margin: 10px 3px 0; color: var(--muted); font-size: 11px; font-weight: 700; }

.preview-desk { min-width: 0; padding: clamp(24px, 4vw, 44px); background: color-mix(in srgb, var(--mint-soft) 60%, var(--cream)); }
.preview-heading { margin-bottom: 20px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.preview-heading strong { margin-top: 4px; display: block; color: var(--mint-deep); font-size: 22px; font-weight: 950; }
.preview-heading > span { padding: 7px 11px; border-radius: 999px; background: var(--paper); color: var(--mint-deep); font-size: 11px; font-weight: 900; }
.worksheet-preview { display: grid; gap: 20px; }
.worksheet-noscript { padding: 18px; border-radius: 16px; background: var(--coral-soft); color: var(--coral-deep); font-weight: 800; }

.print-sheet {
  width: min(100%, 680px);
  min-height: 0;
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  padding: clamp(22px, 4cqw, 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e7ded1;
  border-radius: 5px;
  background: #fff;
  color: #2e2a26;
  box-shadow: 0 18px 45px rgba(46, 42, 38, .12);
  container-type: inline-size;
}

.print-sheet-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 2.8cqw; border-bottom: 1px solid #dfd8cf; }
.print-sheet-header p { margin: 0; color: #28776f; font-size: clamp(10px, 2.1cqw, 16px); font-weight: 900; letter-spacing: .08em; }
.print-sheet-header h2 { margin: .5cqw 0 0; font-size: clamp(18px, 4.2cqw, 32px); line-height: 1.1; }
.student-lines { min-width: 34%; display: grid; gap: 1.2cqw; color: #6b6157; font-size: clamp(8px, 1.7cqw, 13px); font-weight: 700; }
.student-lines span { padding-bottom: .5cqw; border-bottom: 1px solid #b9b0a7; }

.chart-groups { flex: 1; padding: 3cqw 0 1cqw; display: grid; align-content: space-evenly; gap: 2.2cqw; }
.chart-group { display: grid; grid-template-columns: 10cqw minmax(0, 1fr); align-items: center; gap: 2cqw; }
.chart-group h3 { margin: 0; color: #28776f; font-size: clamp(10px, 2.2cqw, 17px); text-align: center; }
.chart-symbols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1cqw; }
.chart-symbol { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #eadfd2; border-radius: 1.2cqw; background: linear-gradient(90deg, transparent 49.5%, #eee7df 50%, transparent 50.5%), linear-gradient(transparent 49.5%, #eee7df 50%, transparent 50.5%); color: #28776f; }
.chart-symbol svg { width: 74%; height: 74%; }

.practice-rows { flex: 1; padding: 2.6cqw 0 1.2cqw; display: grid; grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 1.3cqw; }
.practice-row { min-height: 0; display: grid; grid-template-columns: 9cqw minmax(0, 1fr); gap: 1.2cqw; }
.practice-symbol-label { display: grid; place-items: center; border-radius: 1.2cqw; background: #e7f4f1; color: #28776f; font-size: clamp(22px, 5.8cqw, 44px); font-weight: 900; }
.writing-cells { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9cqw; }
.writing-cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 1px solid #d9d1c7; background: linear-gradient(90deg, transparent 49.5%, #e7dfd6 50%, transparent 50.5%), linear-gradient(transparent 49.5%, #e7dfd6 50%, transparent 50.5%); }
.writing-cell::before, .writing-cell::after { position: absolute; inset: 50% -21%; height: 1px; background: #eee7df; content: ""; transform: rotate(45deg); transform-origin: center; }
.writing-cell::after { transform: rotate(-45deg); }
.writing-cell svg { position: relative; z-index: 1; width: 76%; height: 76%; }
.writing-cell.is-model svg { color: #28776f; }
.writing-cell.is-trace svg { color: #c7dcd8; }
.worksheet-stroke { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.writing-cell.is-model .worksheet-stroke { stroke-width: 4.75; }
.writing-cell.is-trace .worksheet-stroke { stroke-width: 4.25; }
.stroke-order-leader { stroke: #d86f57; stroke-width: 1.1; stroke-linecap: round; opacity: .72; }
.stroke-start { fill: #fff5f1; stroke: #d86f57; stroke-width: 1.4; }
.stroke-order { fill: #a94f3b; font-size: 5.5px; font-weight: 900; text-anchor: middle; dominant-baseline: central; }

.print-sheet-footer { margin-top: auto; padding-top: 1.5cqw; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #dfd8cf; color: #776f67; font-size: clamp(7px, 1.45cqw, 11px); font-weight: 700; }

.worksheet-help { margin-top: clamp(64px, 9vw, 110px); display: grid; grid-template-columns: minmax(240px, .65fr) minmax(0, 1.35fr); gap: clamp(36px, 7vw, 88px); }
.worksheet-help h2 { margin: 0; font-size: clamp(32px, 4.5vw, 50px); letter-spacing: -.045em; line-height: 1.12; }
.worksheet-help ol { margin: 0; padding: 0; display: grid; gap: 0; list-style: none; }
.worksheet-help li { padding: 20px 0; display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 20px; border-top: 1px solid var(--line); }
.worksheet-help li strong { color: var(--mint-deep); font-size: 18px; }
.worksheet-help li span { color: var(--muted); font-weight: 650; }
.worksheet-help > p { grid-column: 2; margin: 0; padding: 16px 18px; border-radius: 16px; background: var(--gold-soft); color: var(--gold-deep); font-size: 12px; font-weight: 750; }

@media (max-width: 900px) {
  .worksheet-hero { grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr); gap: 46px; }
  .hero-paper { min-height: 360px; }
  .worksheet-maker { grid-template-columns: minmax(0, 1fr); }
  .preview-desk { border-top: 1px solid color-mix(in srgb, var(--mint) 25%, transparent); }
}

@media (max-width: 680px) {
  .worksheet-main { width: min(100% - 24px, 620px); padding-top: 44px; }
  .worksheet-hero { grid-template-columns: minmax(0, 1fr); }
  .worksheet-hero h1 { font-size: clamp(46px, 14vw, 66px); }
  .hero-paper { width: min(86%, 380px); min-height: 330px; margin: 0 auto; }
  .worksheet-maker { border-radius: 30px; }
  .worksheet-controls, .preview-desk { padding: 24px 18px; }
  .symbol-picker { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .worksheet-help { grid-template-columns: minmax(0, 1fr); }
  .worksheet-help > p { grid-column: auto; }
}

@media (max-width: 430px) {
  .layout-options { grid-template-columns: minmax(0, 1fr); }
  .symbol-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .preview-heading { align-items: start; }
  .preview-heading > span { white-space: nowrap; }
  .worksheet-help li { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}

@page { size: A4 portrait; margin: 12mm; }

@media print {
  :root, :root[data-site-theme="dark"] { color-scheme: light; }
  body { overflow: visible; background: #fff !important; color: #2e2a26; }
  body::before, .practice-header, .worksheet-hero, .worksheet-controls, .preview-heading, .worksheet-help, .practice-footer { display: none !important; }
  .worksheet-main { width: auto; margin: 0; padding: 0; }
  .worksheet-maker { margin: 0; display: block; overflow: visible; border-radius: 0; background: none; box-shadow: none; }
  .preview-desk { padding: 0; background: none; }
  .worksheet-preview { display: block; }
  .print-sheet { width: 186mm; height: 273mm; min-height: 273mm; margin: 0; padding: 8mm; break-after: page; border: 0; border-radius: 0; box-shadow: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-sheet:last-child { break-after: auto; }
}
