:root {
  --ink: #20221f;
  --muted: #737872;
  --line: #dedfd8;
  --paper: #fffdf8;
  --canvas: #f6f3ee;
  --accent: #135e5b;
  --accent-soft: #e5f0ee;
  --yellow: #f0bf35;
  --shadow: 0 18px 50px rgba(25, 31, 28, .09);
  font-family: ui-rounded, "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.maker-shell { min-height: 100vh; }
.topbar { align-items: center; background: rgba(255, 253, 248, .9); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 18px 28px; position: sticky; top: 0; z-index: 4; backdrop-filter: blur(12px); }
.brand-block { align-items: center; display: flex; gap: 12px; }
.brand-mark { align-items: center; background: var(--yellow); border-radius: 12px; color: #fff; display: flex; font-size: 28px; font-weight: 800; height: 42px; justify-content: center; width: 42px; }
.eyebrow, .preview-kicker, .worksheet-kicker { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; margin: 0 0 3px; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.topbar h1 { font-size: 20px; letter-spacing: -.02em; margin: 0; }
.topbar-actions { display: flex; gap: 10px; }
.primary-button, .secondary-button { border-radius: 10px; font-weight: 750; padding: 11px 15px; }
.primary-button { background: var(--accent); border: 1px solid var(--accent); color: white; }
.secondary-button { background: white; border: 1px solid var(--line); color: var(--ink); }
.maker-layout { display: grid; gap: 28px; grid-template-columns: minmax(320px, 425px) minmax(520px, 1fr); margin: 0 auto; max-width: 1500px; padding: 28px; }
.controls-panel { align-self: start; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; }
.control-section { border-bottom: 1px solid var(--line); padding: 0 0 19px; margin-bottom: 19px; }
.section-heading { align-items: center; display: flex; gap: 10px; margin-bottom: 14px; }
.section-heading h2 { font-size: 16px; letter-spacing: -.015em; margin: 0; }
.section-number { align-items: center; background: var(--accent-soft); border-radius: 50%; color: var(--accent); display: inline-flex; font-size: 12px; font-weight: 850; height: 25px; justify-content: center; width: 25px; }
.field-label { color: #555b54; display: block; font-size: 13px; font-weight: 750; margin: 13px 0 6px; }
.text-control, .select-control { background: white; border: 1px solid #cdd1c8; border-radius: 9px; color: var(--ink); min-height: 42px; padding: 9px 11px; width: 100%; }
.goal-grid { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.goal-card, .level-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); text-align: left; transition: border-color .15s, background .15s, transform .15s; }
.goal-card { min-height: 65px; padding: 10px 11px; }
.goal-card-wide { grid-column: 1 / -1; min-height: 55px; }
.goal-card strong, .goal-card span, .level-card strong, .level-card span { display: block; }
.goal-card strong, .level-card strong { font-size: 13px; }
.goal-card span, .level-card span { color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 3px; }
.goal-card:hover, .level-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.goal-card.active, .level-card.active { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.level-list { display: grid; gap: 8px; }
.level-card { padding: 10px 12px; }
.selection-note, .quiet-note { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 12px 0 0; }
.two-fields { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.advanced-section { border-bottom: 1px solid var(--line); margin-bottom: 17px; padding-bottom: 17px; }
.advanced-section summary { color: var(--accent); cursor: pointer; font-size: 14px; font-weight: 800; }
.advanced-content { padding-top: 8px; }
.toggle-row { align-items: center; color: #4e554e; display: flex; font-size: 13px; gap: 8px; margin-top: 12px; }
.toggle-row input { height: 0; opacity: 0; position: absolute; width: 0; }
.fake-toggle { background: #d2d6cf; border-radius: 20px; display: inline-block; height: 20px; position: relative; width: 35px; }
.fake-toggle::after { background: white; border-radius: 50%; box-shadow: 0 1px 3px #999; content: ""; height: 16px; left: 2px; position: absolute; top: 2px; transition: transform .15s; width: 16px; }
.toggle-row input:checked + .fake-toggle { background: var(--accent); }
.toggle-row input:checked + .fake-toggle::after { transform: translateX(15px); }
.preview-area { min-width: 0; }
.preview-toolbar { align-items: end; display: flex; justify-content: space-between; margin-bottom: 12px; }
.preview-toolbar h2 { font-size: 20px; margin: 0; }
.preview-navigation { align-items: center; color: var(--muted); display: flex; gap: 10px; }
.icon-button { background: white; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 18px; height: 35px; width: 35px; }
.icon-button:disabled { cursor: default; opacity: .35; }
.preview-page { max-width: 820px; }
.worksheet-page { background: var(--paper); border: 1px solid #e2e0d7; box-shadow: var(--shadow); min-height: 1120px; padding: 50px 55px; }
.worksheet-header { align-items: start; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; padding-bottom: 15px; }
.worksheet-header h1 { font-family: Georgia, serif; font-size: 28px; letter-spacing: -.02em; margin: 0; }
.worksheet-meta { display: grid; gap: 9px; min-width: 190px; }
.meta-line { align-items: end; display: flex; font-size: 12px; gap: 7px; }
.meta-line i { border-bottom: 1px solid #9ca19b; display: block; flex: 1; height: 15px; }
.worksheet-instruction { background: #eef4f1; border-left: 4px solid var(--accent); color: #293c39; font-size: 14px; line-height: 1.45; margin: 19px 0 25px; padding: 11px 13px; }
.questions-grid { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.question { align-items: stretch; border: 1px solid #dbddd5; border-radius: 10px; display: grid; grid-template-columns: 26px 1fr; min-height: 125px; padding: 12px 12px 10px; position: relative; }
.question-number { color: var(--accent); font-weight: 850; }
.question-body { align-items: center; display: flex; flex-wrap: wrap; gap: 9px 14px; line-height: 1.42; min-width: 0; }
.question-body span { font-size: 13px; }
.question-body strong { font-size: 17px; }
.coin-image { height: 57px; max-width: 66px; object-fit: contain; }
.money-image { height: 53px; max-width: 112px; object-fit: contain; }
.money-row { align-items: center; display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.money-row .coin-image { height: 42px; max-width: 48px; }
.money-row .money-image { height: 40px; max-width: 84px; }
.product-image { height: 60px; max-width: 92px; object-fit: contain; }
.money-lines { display: flex; flex-direction: column; gap: 12px; min-width: 130px; }
.money-lines i { border-bottom: 1px solid #7e857e; display: block; height: 17px; }
.money-lines.short { min-width: 110px; }
.answers .questions-grid { display: grid; grid-template-columns: 1fr; }
.answers-heading { font-family: Georgia, serif; font-size: 23px; margin: 20px 0 5px; }
.answer-page-note { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.answer-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: 25px minmax(0, 1fr) auto; min-height: 48px; padding: 5px 3px; }
.answer-row span:not(.question-number) { color: #5f665e; font-size: 13px; }
.answer-row strong { color: var(--accent); font-size: 14px; text-align: right; }
.print-pages { display: none; }
@media (max-width: 900px) {
  .maker-layout { grid-template-columns: 1fr; padding: 16px; }
  .controls-panel { order: 1; }
  .preview-area { order: 2; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 15px; padding: 16px; }
  .topbar-actions { width: 100%; }
  .topbar-actions button { flex: 1; }
  .worksheet-page { min-height: 0; padding: 28px 20px; }
  .worksheet-header { display: block; }
  .worksheet-meta { margin-top: 14px; }
  .questions-grid { grid-template-columns: 1fr; }
}
@media print {
  @page { margin: 0; size: A4 portrait; }
  body { background: white; }
  .no-print { display: none !important; }
  .maker-shell { min-height: 0; }
  .print-pages { display: block; }
  .worksheet-page { border: 0; box-shadow: none; height: 297mm; min-height: 297mm; page-break-after: always; width: 210mm; }
}
