/* Shared practice UI layer: tokens and common controls only; activity layouts stay specialized. */
.worksheet-practice, .we-sheet {
  --wk-ink: #172544;
  --wk-muted: #687b98;
  --wk-line: #e3ebf5;
  --wk-container-border: #e3ebf5;
  --wk-question-border: #e3ebf5;
  --wk-line-strong: #c9d9ee;
  --wk-field-focus: #8eb4ed;
  --wk-action-focus: #2563eb;
  --wk-surface: #fbfdff;
  --wk-accent: #2563eb;
  --wk-success: #dff3e7;
  --wk-success-ink: #174e33;
  --wk-danger: #fff0f2;
  --wk-danger-ink: #8d3545;
  --wk-radius-card: 14px;
  --wk-container-radius: calc(var(--wk-radius-card) + 2px);
  --wk-question-radius: var(--wk-radius-card);
  --wk-radius-control: 10px;
  --wk-container-border-width: 1px;
  --wk-question-border-width: 1px;
  --wk-question-number-bg: #edf4ff;
  --wk-question-number-text: #4e6f9e;
  --wk-question-action-bg: #dff3e7;
  --wk-question-action-text: #174e33;
  --wk-question-action-border: #7aaf92;
  --wk-word-tree-bg: linear-gradient(115deg,#f5faff,#f1faf5);
  --wk-word-tree-area-bg: linear-gradient(135deg,#e3f7e9,#d8f3e3);
  --wk-word-tree-chip-bg: #fff;
  --wk-word-tree-chip-text: var(--wk-ink);
  --wk-word-tree-chip-border: #d6e6f9;
  --wk-word-tree-chip-radius: 10px;
  --wk-word-tree-used-opacity: .4;
  --wk-space-card: clamp(16px, 2.2vw, 24px);
  --wk-question-padding: var(--wk-space-card);
}

.worksheet-practice .practice-layout > form {
  min-width: 0;
  border-color: var(--wk-container-border);
  border-radius: var(--wk-container-radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 37, 68, .045);
}
.worksheet-practice .practice-head,
.we-sheet .practice-head { margin: 4px 0 24px; }
.worksheet-practice .practice-head h2,
.we-sheet .practice-head h3 { color: var(--wk-ink); font-size: clamp(25px, 3vw, 32px); }
.worksheet-practice .practice-head p,
.we-sheet .practice-head p { color: var(--wk-muted); margin-bottom: 10px; font-size: 14px; font-weight: 650; }
.worksheet-practice progress { accent-color: var(--wk-accent); }
.worksheet-practice .questions { align-items: stretch; }
.worksheet-practice .question,
.we-sheet .we-q {
  min-width: 0;
  border-color: var(--wk-question-border);
  border-width: var(--wk-question-border-width);
  border-radius: var(--wk-question-radius);
  background: var(--wk-surface);
  padding: var(--wk-question-padding);
}
.worksheet-practice .question legend {
  color: var(--wk-ink);
  font-weight: 750;
  line-height: 1.45;
}
.worksheet-practice .question legend span {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  min-height: 23px;
  margin-right: 9px;
  border-radius: 999px;
  background: var(--wk-question-number-bg);
  color: var(--wk-question-number-text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
.worksheet-practice :is(input:not([type=checkbox]):not([type=radio]), select, textarea):focus-visible,
.we-sheet :is(input:not([type=checkbox]):not([type=radio]), select, textarea):focus-visible {
  outline: 3px solid var(--wk-field-focus);
  outline-offset: 2px;
}
.worksheet-practice button:focus-visible,
.we-sheet button:focus-visible {
  outline: 3px solid var(--wk-action-focus);
  outline-offset: 2px;
}
.worksheet-practice .controls,
.worksheet-practice .language-actions {
  align-items: center;
  gap: 10px;
}
.worksheet-practice .controls .button,
.worksheet-practice .language-actions button {
  min-height: 46px;
  border-radius: var(--wk-radius-control);
  font-weight: 750;
}
.worksheet-practice .language-actions button:not([data-language-check]) {
  border-color: var(--wk-line-strong);
  background: #fff;
  color: var(--wk-ink);
}
.worksheet-practice .language-actions [data-language-check] {
  border-color: var(--wk-question-action-border);
  background: var(--wk-question-action-bg);
  color: var(--wk-question-action-text);
}
.worksheet-practice .language-feedback {
  color: var(--wk-muted);
  font-weight: 650;
}
.worksheet-practice .language-correct { border-color: #4ba376; }
.worksheet-practice .language-wrong { border-color: #d86b7c; }

/* Standard short-answer field: one baseline, large readable type. Tracing canvases are excluded. */
.worksheet-practice .language-activity :is(.vocabulary-answer, .vocabulary-scramble, .vocabulary-table-row) input,
.worksheet-practice .language-activity .compound-completion input {
  min-height: var(--wk-editor-field-height, 54px);
  height: var(--wk-editor-field-height, 54px);
  padding: var(--wk-editor-field-padding, 7px 5px 4px);
  border: var(--wk-editor-field-border, 0 0 2px solid #9fb7d4);
  border-radius: var(--wk-editor-field-radius, 0);
  background: var(--wk-editor-field-background, transparent);
  color: var(--wk-editor-text-color, var(--wk-ink));
  font-size: var(--wk-editor-field-font-size, var(--answer-font-size, 28px));
  font-weight: var(--wk-editor-field-font-weight, 700);
  line-height: var(--wk-editor-field-line-height, 1.1);
  box-shadow: none;
}
.worksheet-practice .language-activity .compound-completion input {
  width: var(--wk-editor-word-width, min(100%, calc(var(--answer-chars) * 1.15em + 34px)));
}
.worksheet-practice .language-activity :is(.vocabulary-answer, .vocabulary-scramble, .vocabulary-table-row) input:focus,
.worksheet-practice .language-activity .compound-completion input:focus {
  outline: 2px solid var(--wk-field-focus);
  outline-offset: 3px;
  box-shadow: 0 2px 0 #9fb7d4;
}
.worksheet-practice .vocabulary-shared-bank,
.worksheet-practice .compound-shared-bank {
  margin: 0 0 24px;
}
.worksheet-practice :is(.compound-completion-bank, .word-shape-bank, .compound-word-bank),
.we-sheet :is(.compound-completion-bank, .word-shape-bank, .compound-word-bank) {
  color: var(--wk-ink);
  border-color: var(--wk-line);
  border-radius: var(--wk-radius-card);
  background: #f8fbff;
}
.worksheet-practice .compound-completion-bank button,
.worksheet-practice .compound-word-bank span,
.worksheet-practice .word-shape-bank span,
.we-sheet .compound-completion-bank button,
.we-sheet .compound-word-bank span,
.we-sheet .word-shape-bank span {
  transition: opacity .18s ease, border-color .18s ease, background-color .18s ease;
}
.worksheet-practice [data-word-tree-word].is-used,
.we-sheet [data-word-tree-word].is-used {
  opacity: .4;
}
.worksheet-practice .word-shape-bank [data-shape-bank-word].is-used,
.we-sheet .word-shape-bank [data-shape-bank-word].is-used {
  opacity: .4;
  filter: none;
  text-decoration: none;
}
.worksheet-practice .compound-completion-bank button.is-selected,
.we-sheet .compound-completion-bank button.is-selected {
  border-color: #79a0d8;
  background: #eaf1fc;
  box-shadow: 0 0 0 2px #8eb4ed;
}

/* Shared language for specialized renderer families; their geometry remains local. */
.worksheet-practice :is(.activity-activity, .advanced-activity, .alphabet-activity, .phonics-activity, .math-activity, .spatial-activity, .creative-activity, .drawing-question) {
  color: var(--wk-ink);
}
.worksheet-practice :is(.activity-help, .activity-instruction, .advanced-help, .alphabet-help, .phonics-help, .math-help, .spatial-help, .creative-help, .drawing-help) {
  color: var(--wk-muted);
  line-height: 1.6;
}
.worksheet-practice :is(.activity-card, .advanced-block, .alphabet-target-panel, .word-build-item, .segmented-word, .math-problem, .spatial-row) {
  border-color: var(--wk-line);
  border-radius: var(--wk-radius-card);
  background: var(--wk-surface);
}
.worksheet-practice :is(.activity-check-row, .advanced-actions, .alphabet-actions, .math-actions, .phonics-controls, .spatial-actions, .drawing-bottom, .tracing-check-row) {
  align-items: center;
  gap: 10px;
}
.worksheet-practice :is(.activity-check-row, .advanced-actions, .alphabet-actions, .math-actions, .phonics-controls, .spatial-actions, .drawing-bottom, .tracing-check-row) button {
  min-height: 44px;
  border-radius: var(--wk-radius-control);
  font-weight: 750;
}
.worksheet-practice :is(.activity-feedback, .advanced-feedback, .alphabet-feedback, .math-feedback, .spatial-feedback, .tracing-feedback, .phonics-status) {
  color: var(--wk-muted);
  font-weight: 650;
}

@media (max-width: 767px) {
  .worksheet-practice .practice-layout form { min-width: 0; }
  .worksheet-practice .question,
  .we-sheet .we-q { min-width: 0; }
  .worksheet-practice .language-actions { justify-content: stretch; }
  .worksheet-practice .language-actions button { flex: 1 1 130px; }
}

@media print {
  .worksheet-practice [data-word-tree-word].is-used,
  .we-sheet [data-word-tree-word].is-used { opacity: 1; }
  .worksheet-practice .question { box-shadow: none; }
}

/* Experimental worksheet CSS is limited to the interactive form/editor. */
.worksheet-practice .practice-layout > form.wk-worksheet-editor-theme { min-width:0; overflow:hidden; padding:0 18px 18px; border:1px solid var(--wk-line); border-radius:18px; background:#fff; box-shadow:0 8px 25px #23476b0a; }
.worksheet-practice form.wk-worksheet-editor-theme .questions { min-width:0; }
.worksheet-practice form.wk-worksheet-editor-theme .question,
.worksheet-practice form.wk-worksheet-editor-theme .question > * { min-width:0; max-width:100%; }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head { position:relative; min-height:0; margin:0 -18px 15px; padding:22px 24px 17px; overflow:hidden; border-bottom:1px solid #e5effa; background:#fff; }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head-copy { position:relative; z-index:1; width:min(68%,760px); }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head h2 { margin:0 0 4px; color:var(--wk-ink); font-family:inherit; font-size:27px; font-weight:700; letter-spacing:-.025em; }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head p { margin:0 0 8px; color:var(--wk-muted); font-size:14px; font-weight:600; }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head progress { display:block; width:min(100%,780px); height:10px; border:0; border-radius:999px; background:#dceafa; accent-color:#36ae7a; }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head progress::-webkit-progress-bar { border-radius:999px; background:#dceafa; }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head progress::-webkit-progress-value { border-radius:999px; background:#38b77e; }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head progress::-moz-progress-bar { border-radius:999px; background:#38b77e; }
.worksheet-practice form.wk-worksheet-editor-theme .practice-head-art,
.worksheet-practice form.wk-worksheet-editor-theme .practice-cloud,
.worksheet-practice form.wk-worksheet-editor-theme .practice-leaves { display:none; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme { position:relative; isolation:isolate; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .questions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 14px; margin:12px 0 18px; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .question { min-width:0; margin:0; padding:13px 15px 14px; border:1px solid #e0eaf6; border-radius:14px; background:#fff; box-shadow:0 4px 14px #23476b08; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .question legend { display:flex; align-items:center; gap:9px; width:100%; margin:0 0 11px; padding:0; color:var(--wk-ink); font-size:13px; font-weight:600; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .question legend span { display:inline-flex; flex:0 0 27px; align-items:center; justify-content:center; width:27px; min-width:27px; height:27px; min-height:27px; border-radius:50%; background:#e6f2ff; color:#4286dc; font-size:12px; font-weight:700; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .worksheet-question-kicker { font-weight:600; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer { display:grid; grid-template-columns:auto auto minmax(0,1fr); align-items:center; justify-content:stretch; gap:0 8px; padding:0; border:0; background:transparent; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer strong,
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer span { color:var(--wk-ink); font-family:inherit; font-size:16px; font-weight:650; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer input { grid-column:auto; box-sizing:border-box; width:100%; min-width:0; min-height:0; height:35px; padding:0 8px; border:1px solid #d4e3f5; border-radius:var(--wk-editor-border-radius,7px); background:#f7fbff; box-shadow:none; font-family:inherit; font-size:17px; font-weight:600; line-height:1.2; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"][data-answer-size="small"] .vocabulary-answer input { font-size:15px; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"][data-answer-size="medium"] .vocabulary-answer input { font-size:16px; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"][data-answer-size="extra-large"] .vocabulary-answer input { font-size:18px; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer input:focus { outline:2px solid #8eb4ed; outline-offset:2px; box-shadow:none; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer input::placeholder { color:#8194ad; font-size:13px; font-weight:400; opacity:1; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .language-actions { justify-content:flex-end; gap:7px; margin-top:10px; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-actions button { min-height:35px; padding:7px 11px; border-radius:9px; font-size:12px; font-weight:600; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-actions [data-language-check] { background:#2fb27a; color:#fff; }
.worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-feedback:not([hidden]) { margin-top:9px; padding:8px 10px; border-radius:9px; }
@media(max-width:550px) {
 .worksheet-practice .practice-layout > form.wk-worksheet-editor-theme { padding:0 12px 14px; border-radius:16px; }
 .worksheet-practice form.wk-worksheet-editor-theme .practice-head { margin:0 -12px 12px; padding:17px 15px 13px; }
 .worksheet-practice form.wk-worksheet-editor-theme .practice-head-copy { width:100%; }
 .worksheet-practice form.wk-worksheet-editor-theme .practice-head h2 { font-size:24px; }
 .worksheet-practice form.wk-worksheet-editor-theme .practice-head p { font-size:13px; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .questions { grid-template-columns:1fr; gap:10px; margin:12px 0 15px; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .question { padding:12px; border-radius:12px; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer { grid-template-columns:auto auto minmax(0,1fr); gap:0 7px; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer strong,
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer span { font-size:15px; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer input { height:35px; padding:0 8px; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-actions { justify-content:flex-end; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-actions button { flex:0 1 auto; min-height:38px; }
}
@media(max-width:360px) {
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer { grid-template-columns:auto auto minmax(0,1fr); }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-actions button { padding-right:9px; padding-left:9px; }
}
@media print {
 .worksheet-practice form.wk-worksheet-editor-theme .practice-head,
 .worksheet-practice form.wk-worksheet-editor-theme .language-actions,
 .worksheet-practice form.wk-worksheet-editor-theme .controls { display:none!important; }
 .worksheet-practice form.wk-worksheet-editor-theme { padding:0; border:0; box-shadow:none; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .question { break-inside:avoid; box-shadow:none; }
 .worksheet-practice.practice-word-tree form.wk-worksheet-editor-theme .language-activity[data-language="word-bank-writing"] .vocabulary-answer input { color:transparent!important; -webkit-text-fill-color:transparent; border-color:#888!important; background:#fff!important; box-shadow:none!important; }
}

/* One standalone Word Tree design, shared by worksheet, editor preview and activities. */
.worksheet-practice.practice-word-tree .vocabulary-shared-bank,
.we-sheet .vocabulary-shared-bank { box-sizing:border-box; display:grid; grid-template-columns:minmax(205px,.52fr) minmax(0,1fr); gap:12px; align-items:center; margin:0 0 14px; padding:13px 16px; border:1px solid #d9eaff; border-radius:15px; background:var(--wk-word-tree-bg); }
.worksheet-practice.practice-word-tree .word-tree-instruction,
.we-sheet .word-tree-instruction { display:flex; align-items:center; gap:10px; color:#122a56; }
.worksheet-practice.practice-word-tree .word-tree-instruction>span,
.we-sheet .word-tree-instruction>span { flex:0 0 auto; font-size:24px; }
.worksheet-practice.practice-word-tree .word-tree-instruction strong,
.we-sheet .word-tree-instruction strong { font-size:20px; font-weight:700; }
.worksheet-practice.practice-word-tree .word-tree-instruction p,
.we-sheet .word-tree-instruction p { margin:2px 0 0; color:#637a9d; font-size:13px; line-height:1.45; }
.worksheet-practice.practice-word-tree .vocabulary-shared-bank .word-tree-words,
.we-sheet .vocabulary-shared-bank .word-tree-words { display:flex; flex-wrap:wrap; justify-content:center; gap:7px; min-height:0; margin:0; padding:10px; border:0; border-radius:12px; background:var(--wk-word-tree-area-bg); }
.worksheet-practice.practice-word-tree .word-tree-words>strong,
.we-sheet .word-tree-words>strong { position:static; width:100%; color:#27634f; font-size:12px; font-weight:700; letter-spacing:.08em; text-align:center; }
.worksheet-practice.practice-word-tree .word-tree-words>button,
.worksheet-practice.practice-word-tree .word-tree-words>.word-bank-chip,
.we-sheet .word-tree-words>button,
.we-sheet .word-tree-words>.word-bank-chip { box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; min-width:54px; min-height:34px; padding:6px 11px; border:1px solid #d6e6f9; border-radius:10px; background:#fff; color:var(--wk-ink); box-shadow:0 3px 9px #294d740d; font-family:inherit; font-size:13px; font-weight:600; line-height:1.2; }
.worksheet-practice.practice-word-tree .word-tree-words>button,
.we-sheet .word-tree-words>button { cursor:pointer; transition:opacity .18s ease,border-color .18s ease,background-color .18s ease; }
.worksheet-practice.practice-word-tree .word-tree-words>button:focus-visible,
.we-sheet .word-tree-words>button:focus-visible { outline:3px solid #8eb4ed; outline-offset:2px; }
.worksheet-practice.practice-word-tree [data-word-tree-word].is-used,
.we-sheet [data-word-tree-word].is-used { opacity:var(--wk-word-tree-used-opacity); }
@media(max-width:767px) {
 .worksheet-practice.practice-word-tree .vocabulary-shared-bank,.we-sheet .vocabulary-shared-bank { grid-template-columns:1fr; gap:10px; padding:12px; }
 .worksheet-practice.practice-word-tree .word-tree-instruction p br,.we-sheet .word-tree-instruction p br { display:none; }
 .worksheet-practice.practice-word-tree .vocabulary-shared-bank .word-tree-words,.we-sheet .vocabulary-shared-bank .word-tree-words { justify-content:flex-start; gap:7px; padding:9px; }
 .worksheet-practice.practice-word-tree .word-tree-words>button,.worksheet-practice.practice-word-tree .word-tree-words>.word-bank-chip,.we-sheet .word-tree-words>button,.we-sheet .word-tree-words>.word-bank-chip { flex:1 1 calc(25% - 7px); min-width:54px; min-height:40px; padding:6px; font-size:13px; }
}
@media print {
 .worksheet-practice.practice-word-tree .vocabulary-shared-bank,.we-sheet .vocabulary-shared-bank { break-inside:avoid; background:#fff; }
 .worksheet-practice.practice-word-tree .word-tree-words,.we-sheet .word-tree-words { background:#fff; }
}

/* Large coloring pages use the full question grid; activity CSS only owns its canvas. */
.worksheet-practice .question:has(.creative-activity[data-canvas-size="large"]) { grid-column: 1 / -1; min-width: 0; }

@media print {
 .worksheet-practice:has(.creative-activity[data-canvas-size="large"]) .questions { display:block; }
 .worksheet-practice:has(.creative-activity[data-canvas-size="large"]) .reading-passage { margin:8px 0; padding:10px; font-size:13px; line-height:1.4; break-inside:avoid; }
 .worksheet-practice:has(.creative-activity[data-canvas-size="large"]) .reading-passage p { margin-bottom:0; }
 .worksheet-practice .question:has(.creative-activity[data-canvas-size="large"]) { margin:8px 0; padding:8px; break-inside:avoid; }
}

@media print {
 .worksheet-practice:has(.creative-activity[data-canvas-size="large"]) .reading-passage p { font-size:13px; line-height:1.4; }
 .worksheet-practice:has(.creative-activity[data-canvas-size="large"]) form > p { display:none; }
}
/* Individual image-label feedback, including existing published worksheets. */
.spatial-activity [data-label-select][data-result=wrong]{border:2px solid #b52f47;background:#fff0f3}.spatial-activity [data-label-select][data-result=right]{border:2px solid #17824c;background:#eaf7ef}.spatial-activity .spatial-pin[data-result=wrong]{background:#b52f47}.spatial-activity .spatial-pin[data-result=right]{background:#17824c}.spatial-activity .spatial-label-result{font-size:13px;font-weight:700}
