@font-face {
  font-family: "Worksheet Propisi";
  src: url("fonts/propisi-writing.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Caveat";
  src: url("font_asset.php?font=caveat-bold") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Worksheet Cloze Sans";
  src: url("font_asset.php?font=cloze-text") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Worksheet Propisi Dots";
  src: url("fonts/propisi-dots.ttf?v=centerline") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Worksheet Print";
  src: url("fonts/pt-sans-narrow-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Worksheet Print Dots";
  src: url("fonts/mogu-pisat-narrow-dots.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --worksheet-grass: #51ba40;
  --worksheet-moss: #2e9127;
  --worksheet-pine: #2f5626;
  --worksheet-leaf: #6ba33f;
  --worksheet-leaf-soft: #e5efd4;
  --worksheet-mandarin: #e8833a;
  --worksheet-amber-soft: #fbe7cf;
  --worksheet-paper: #fff;
  --worksheet-bg: #f5f7ee;
  --worksheet-ink: #26301f;
  --worksheet-muted: #6b7a5c;
  --worksheet-line: #dfe7ce;
  --worksheet-shadow: 0 2px 4px rgba(30, 70, 53, .06), 0 12px 28px rgba(30, 70, 53, .10);
  --worksheet-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

.worksheet-shell,
.worksheet-shell * { box-sizing: border-box; }

.worksheet-page { margin: 0; }

.worksheet-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  color: var(--worksheet-ink);
  background: var(--worksheet-bg);
  font: 16px/1.5 var(--worksheet-font);
}

.worksheet-shell button,
.worksheet-shell input,
.worksheet-shell select,
.worksheet-shell textarea { font-family: inherit; }

.worksheet-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  color: #f2f7e9;
  background: linear-gradient(180deg, var(--worksheet-grass), var(--worksheet-moss));
  box-shadow: 0 1px 0 rgba(0, 0, 0, .14);
}

.worksheet-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  margin-right: auto;
}

.worksheet-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, .15);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 3px 9px rgba(20, 72, 22, .2);
}

.worksheet-brand b {
  display: block;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: .2px;
  white-space: nowrap;
}

.worksheet-brand small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  opacity: .84;
}

.worksheet-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.worksheet-status {
  max-width: none;
  overflow: visible;
  color: #eaf4ec;
  font-size: 12.5px;
  text-overflow: clip;
  white-space: nowrap;
  opacity: .9;
}

.worksheet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 0;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  color: var(--worksheet-pine);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.worksheet-btn:hover:not(:disabled) { transform: translateY(-1px); }
.worksheet-btn:active:not(:disabled) { transform: translateY(0); }
.worksheet-btn:disabled { cursor: default; opacity: .5; }
.worksheet-btn-ghost { color: #eef7ee; background: rgba(255, 255, 255, .13); }
.worksheet-btn-ghost:hover { background: rgba(255, 255, 255, .21); }
.worksheet-btn-accent { color: #fff; background: var(--worksheet-mandarin); box-shadow: 0 4px 12px rgba(232, 131, 58, .35); }
.worksheet-btn-accent:hover { background: #de7629; }
.worksheet-btn-site { color: #fff; background: #287f22; box-shadow: 0 4px 12px rgba(31, 96, 26, .3); }
.worksheet-btn-site:hover { color: #fff; background: #23731e; }
.worksheet-btn-primary { width: 100%; color: #fff; background: linear-gradient(120deg, var(--worksheet-grass), var(--worksheet-moss)); }
.worksheet-btn-small { min-height: 32px; padding: 6px 10px; border: 1px solid var(--worksheet-line); font-size: 12.5px; }
.worksheet-btn-small:hover { border-color: var(--worksheet-leaf); background: var(--worksheet-leaf-soft); }

.worksheet-app {
  --worksheet-settings-base: 476px;
  --worksheet-settings-width: calc(var(--worksheet-settings-base) * 1.2);
  --worksheet-type-list-width: calc(100% + var(--worksheet-settings-base) - var(--worksheet-settings-width));
  display: grid;
  grid-template-columns: var(--worksheet-settings-width) 0 minmax(460px, 1fr);
  min-height: 0;
  transition: grid-template-columns .52s cubic-bezier(.22, .61, .36, 1);
}

.worksheet-app.is-rules-open {
  grid-template-columns: var(--worksheet-settings-width) 440px minmax(420px, 1fr);
}

.worksheet-app > * { min-width: 0; min-height: 0; }

.worksheet-panel,
.worksheet-rules-pane {
  overflow-y: auto;
  border-right: 1px solid var(--worksheet-line);
  background: #fff;
  scrollbar-color: #c8d8b4 transparent;
  scrollbar-width: thin;
}

.worksheet-panel { padding: 20px 20px 38px; }

.worksheet-section { margin: 0 0 24px; }

.worksheet-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 11px;
  color: var(--worksheet-pine);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.worksheet-section-title i {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--worksheet-mandarin);
}

.worksheet-section-title span {
  margin-left: auto;
  color: var(--worksheet-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.worksheet-field { display: block; }
.worksheet-hide-punctuation-label {
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}
.worksheet-field > span,
.worksheet-shell .s_label,
.worksheet-shell .ss_label {
  display: block;
  width: auto;
  margin: 0 0 6px;
  padding: 0;
  color: var(--worksheet-pine);
  font-size: 13px;
  font-weight: 700;
}

.worksheet-field select,
.worksheet-autofill-controls input,
.worksheet-search input,
.worksheet-shell .field-style,
.worksheet-shell .textarea_input {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 1px solid var(--worksheet-line);
  border-radius: 10px;
  outline: 0;
  color: var(--worksheet-ink);
  background: #fff;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.worksheet-field select,
.worksheet-autofill-controls input,
.worksheet-search input,
.worksheet-shell .field-style { min-height: 40px; padding: 8px 11px; }

.worksheet-field select:focus,
.worksheet-autofill-controls input:focus,
.worksheet-search input:focus,
.worksheet-shell .field-style:focus,
.worksheet-shell .textarea_input:focus {
  border-color: var(--worksheet-leaf);
  box-shadow: 0 0 0 3px rgba(107, 163, 63, .14);
}

.worksheet-hint {
  margin: 8px 0 0;
  color: var(--worksheet-muted);
  font-size: 12px;
  line-height: 1.45;
}

.worksheet-type-section { margin-bottom: 8px; }
.worksheet-type-groups { display: grid; gap: 12px; container-type: inline-size; }
.worksheet-type-group { min-width: 0; }
.worksheet-type-group + .worksheet-type-group { padding-top: 10px; border-top: 1px solid #edf1e7; }
.worksheet-type-group-title {
  margin: 0 0 6px;
  color: var(--worksheet-muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.worksheet_list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: calc(var(--worksheet-type-list-width) - 28px);
  gap: 6px;
  outline: 0;
}

.worksheet_item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 76px;
  margin: 0 !important;
  padding: 3px;
  border: 1.5px solid var(--worksheet-line);
  border-radius: 10px;
  outline: 0;
  color: var(--worksheet-ink);
  background-color: #fcfefc;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}

.worksheet_item:hover { border-color: var(--worksheet-leaf); transform: translateY(-2px); box-shadow: none; }
.worksheet_item.is-active { border-color: var(--worksheet-leaf); background-color: var(--worksheet-leaf-soft); }
.worksheet_item input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.worksheet_item:focus-within { outline: 3px solid rgba(107, 163, 63, .18); outline-offset: 1px; }

.worksheet-type-icon {
  display: block;
  width: 32px;
  height: 32px;
  flex: none;
  margin: 0 0 3px;
  overflow: hidden;
}
.worksheet-type-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }

.worksheet_item_name {
  position: static;
  display: grid;
  width: 100%;
  min-height: 27px;
  place-items: center;
  overflow: visible;
  vertical-align: baseline;
  color: inherit;
  font: 600 11.5px/1.15 var(--worksheet-font);
  text-align: center;
  text-wrap: balance;
  white-space: normal;
}

.worksheet-type-instruction {
  grid-column: 1 / -1;
  width: 100cqw;
  margin: 1px 0 3px;
  padding: 8px 10px;
  border-left: 3px solid var(--worksheet-mandarin);
  border-radius: 8px;
  color: #59452e;
  background: #fff8e8;
  font-size: 12.25px;
  line-height: 1.42;
  text-align: left;
  animation: worksheet-instruction-open .18s ease both;
}
.worksheet-type-instruction[hidden] { display: none; }
@keyframes worksheet-instruction-open {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.worksheet-shell .add-form,
.worksheet-shell .add-form-params { max-width: none; border: 0; border-radius: 0; opacity: 1; }

.worksheet-planned-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 10px;
  padding: 16px;
  border: 1px dashed #b9c9af;
  border-radius: 12px;
  color: var(--worksheet-ink);
  background: #f8fbf6;
}

.worksheet-planned-card img { width: 48px; height: 48px; flex: none; object-fit: contain; opacity: .72; }
.worksheet-planned-card h3 { margin: 0 0 4px; color: var(--worksheet-pine); font-size: 15px; }
.worksheet-planned-card p { margin: 0; color: var(--worksheet-muted); font-size: 12.5px; line-height: 1.45; }

.worksheet-file-input {
  display: block;
  width: 100%;
  margin: 5px 0 0;
  padding: 8px;
  border: 1px solid var(--worksheet-line);
  border-radius: 9px;
  color: var(--worksheet-ink);
  background: #fff;
  font: 12.5px/1.4 var(--worksheet-font);
}
.worksheet-file-input::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--worksheet-pine);
  background: var(--worksheet-leaf-soft);
  font-weight: 650;
  cursor: pointer;
}

.worksheet-photo-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.worksheet-photo-selection {
  margin: 2px 0 8px;
  padding: 9px 11px;
  border: 1px solid #dce7d5;
  border-radius: 9px;
  color: var(--worksheet-pine);
  background: #f7fbf4;
  font-size: 12px;
  line-height: 1.4;
}

.worksheet-photo-random { margin: 0 0 14px; }
.worksheet-photo-questions-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.worksheet-photo-questions-head .ss_label { margin-bottom: 6px; }
.worksheet-photo-questions-head .worksheet-btn { flex: none; margin-bottom: 6px; }
.worksheet-photo-lines-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 2px;
}
.worksheet-inline-check { display: flex; align-items: center; gap: 8px; color: var(--worksheet-pine); font-size: 13px; font-weight: 700; }
.worksheet-inline-check input { width: 17px; height: 17px; accent-color: var(--worksheet-leaf); }
.worksheet-line-count { width: 150px; }
.worksheet-line-count input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--worksheet-line);
  border-radius: 10px;
  color: var(--worksheet-ink);
  background: #fff;
}
.worksheet-sound-image-toggle { margin: 2px 0 10px; }
.worksheet-sound-image-options { margin: 0 0 14px; }
.worksheet-sound-image-options[hidden] { display: none; }

.worksheet-shell .worksheet-instruction {
  display: none !important;
}

.worksheet-shell .textarea_border { margin: 0 0 14px; }

.worksheet-shell .textarea_input {
  display: block;
  min-height: 126px;
  height: 150px !important;
  padding: 10px 11px;
  overflow: auto;
  font-size: 13px !important;
  line-height: 1.45;
  white-space: pre-wrap;
}

.worksheet-shell #write_words_text { height: 190px !important; }
.worksheet-shell #input_letters_text {
  min-height: 180px;
  height: 180px !important;
}
.worksheet-shell #select_words_text,
.worksheet-shell #select_words_words {
  min-height: 486px;
  height: 486px !important;
}

.worksheet-shell .h_container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .42fr); gap: 10px; }
.worksheet-shell .h_container .v_container { display: block !important; width: auto !important; margin: 0 !important; }

.worksheet-shell .submit_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 40px;
  margin: 8px 0 0;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(120deg, var(--worksheet-grass), var(--worksheet-moss));
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.worksheet-shell .submit_button:hover { background: linear-gradient(120deg, #5bc748, #287f22); }
.worksheet-shell #main-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--worksheet-line); }

.worksheet-autofill-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: -4px 0 14px;
  padding: 8px 13px;
  border: 1px solid var(--worksheet-leaf);
  border-radius: 10px;
  color: var(--worksheet-moss);
  background: #fff;
  font: 650 13px/1.2 var(--worksheet-font);
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.worksheet-autofill-trigger:hover,
.worksheet-autofill-trigger.is-active {
  border-color: var(--worksheet-moss);
  color: #fff;
  background: var(--worksheet-moss);
}

.worksheet-shell .Checkbox,
.worksheet-shell .Radiobox { position: relative; display: inline-block; width: 20px; height: 20px; vertical-align: middle; }
.worksheet-shell .Checkbox-visible,
.worksheet-shell .Radiobox-visible { position: absolute; inset: 2px; margin: 0; border: 1px solid var(--worksheet-leaf); background: #fff; }
.worksheet-shell .Checkbox-visible { border-radius: 4px; }
.worksheet-shell .Radiobox-visible { border-radius: 50%; }
.worksheet-shell .Checkbox > input,
.worksheet-shell .Radiobox > input { position: absolute; z-index: 2; inset: 0; width: 20px; height: 20px; margin: 0; opacity: 0; transform: none; cursor: pointer; }
.worksheet-shell .Checkbox > input:checked + .Checkbox-visible,
.worksheet-shell .Radiobox > input:checked + .Radiobox-visible { border-color: var(--worksheet-moss); background: var(--worksheet-grass); box-shadow: inset 0 0 0 3px #fff; }

.worksheet-shell .Checkbox > input:checked + .Checkbox-visible {
  background: var(--worksheet-grass);
  box-shadow: none;
}

.worksheet-shell .Checkbox-visible::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg) scale(.7);
  transform-origin: center;
  transition: opacity .12s ease, transform .12s ease;
}

.worksheet-shell .Checkbox > input:checked + .Checkbox-visible::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.worksheet-font-modes {
  min-width: 0;
  margin: 4px 0 16px;
  padding: 0;
  border: 0;
}

.worksheet-font-modes > legend {
  width: 100%;
  margin-bottom: 7px;
}

.worksheet-font-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.worksheet-ruling-option {
  position: relative;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid var(--worksheet-line);
  border-radius: 10px;
  background: #fff;
  color: var(--worksheet-ink);
  font: 650 12px/1.15 var(--worksheet-font);
  cursor: pointer;
}

.worksheet-ruling-option:hover { border-color: var(--worksheet-leaf); }
.worksheet-ruling-option:has(input:checked) {
  border-color: var(--worksheet-moss);
  background: var(--worksheet-leaf-soft);
  box-shadow: 0 0 0 1px var(--worksheet-moss);
}
.worksheet-ruling-option:has(input:focus-visible) {
  outline: 2px solid var(--worksheet-mandarin);
  outline-offset: 2px;
}
.worksheet-ruling-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.worksheet-ruling-sample {
  --ruling-line: #90b0cc;
  display: block;
  height: 39px;
  background-color: #fff;
}
.worksheet-ruling-sample.is-uneven {
  background-image: repeating-linear-gradient(transparent 0 4px, var(--ruling-line) 4px 5px, transparent 5px 9px, var(--ruling-line) 9px 10px, transparent 10px 17px);
}
.worksheet-ruling-sample.is-even {
  background-image: repeating-linear-gradient(transparent 0 6px, var(--ruling-line) 6px 7px);
}
.worksheet-ruling-sample.is-extra-wide {
  background-image: repeating-linear-gradient(transparent 0 8px, var(--ruling-line) 8px 9px, transparent 9px 21px);
}
.worksheet-ruling-sample.is-grid {
  background-image: linear-gradient(var(--ruling-line) 1px, transparent 1px), linear-gradient(90deg, var(--ruling-line) 1px, transparent 1px);
  background-size: 8px 8px;
}

.worksheet-font-mode {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-height: 70px;
  padding: 7px 8px;
  overflow: hidden;
  border: 1px solid var(--worksheet-line);
  border-radius: 10px;
  color: var(--worksheet-ink);
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.worksheet-font-mode:hover {
  border-color: var(--worksheet-leaf);
  background: #fbfdf8;
}

.worksheet-font-mode:has(input:checked) {
  border-color: var(--worksheet-moss);
  background: var(--worksheet-leaf-soft);
  box-shadow: 0 0 0 1px var(--worksheet-moss);
}

.worksheet-font-mode:has(input:disabled) {
  opacity: .5;
  cursor: default;
  border-color: var(--worksheet-line);
  background: #fff;
}

.worksheet-font-mode input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.worksheet-font-mode input:focus-visible ~ .worksheet-font-mode-sample {
  outline: 2px solid var(--worksheet-mandarin);
  outline-offset: 2px;
}

.worksheet-font-mode-sample {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 52px;
  color: var(--worksheet-pine);
  font-size: 31px;
  font-weight: 400;
  line-height: 1;
}

.worksheet-font-mode-sample.is-script { font-family: "Worksheet Propisi", cursive; }
.worksheet-font-mode-sample.is-script-dotted { font-family: "Worksheet Propisi Dots", cursive; }
.worksheet-font-mode-sample.is-print { font-family: "Worksheet Print", sans-serif; }
.worksheet-font-mode-sample.is-print-dotted { font-family: "Worksheet Print Dots", sans-serif; }

.worksheet-font-mode-title {
  align-self: end;
  min-width: 0;
  font: 650 12px/1.15 var(--worksheet-font);
}

.worksheet-font-mode-note {
  align-self: start;
  min-width: 0;
  color: var(--worksheet-muted);
  font: 500 11px/1.15 var(--worksheet-font);
}

.worksheet-shell .letter_wrap { cursor: pointer; }
.worksheet-shell [data-marked="1"] { color: var(--worksheet-moss); background: var(--worksheet-leaf-soft); }

.worksheet-cloze-autofill { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 10px; }
.worksheet-cloze-autofill button { min-height: 40px; }
.worksheet-shell .worksheet-cloze-task-input { display: block; resize: vertical; margin-bottom: 8px; }
.worksheet-cloze-bank-toggle { margin: 8px 0; }
.worksheet-cloze-overflow { margin: 0 0 8px; color: #8a4b25; }

.worksheet-cloze-choices {
  padding: 9px 10px;
  border: 1px solid var(--worksheet-line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.worksheet-cloze-word {
  display: inline;
  padding: 1px 2px;
  border: 0;
  border-radius: 4px;
  background: var(--worksheet-bg);
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.worksheet-cloze-word[aria-pressed="true"] { background: var(--worksheet-leaf-soft); color: var(--worksheet-pine); text-decoration: line-through; }
.worksheet-cloze-word:focus-visible { outline: 2px solid var(--worksheet-mandarin); }

.worksheet-rules-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  padding: 10px;
  overflow: hidden;
  border-right-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-22px);
  pointer-events: none;
  transition:
    opacity .36s ease,
    transform .52s cubic-bezier(.22, .61, .36, 1),
    visibility 0s linear .52s;
}

.worksheet-app.is-rules-open .worksheet-rules-pane {
  overflow: hidden;
  border-right-width: 1px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.worksheet-rules-head { min-width: 0; }
.worksheet-rules-title-row { display: flex; align-items: flex-start; gap: 10px; }
.worksheet-rules-title-row .worksheet-section-title { min-width: 0; flex: 1; }
.worksheet-rules-close {
  display: grid;
  width: 20px;
  height: 20px;
  margin: -2px 0 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--worksheet-muted);
  background: transparent;
  font: 500 18px/1 var(--worksheet-font);
  cursor: pointer;
}
.worksheet-rules-close:hover { color: var(--worksheet-pine); background: var(--worksheet-leaf-soft); }
.worksheet-rules-target { margin: -2px 0 6px; color: var(--worksheet-pine); font-size: 11px; font-weight: 700; }
.worksheet-autofill-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
.worksheet-autofill-controls .worksheet-field > span { margin-bottom: 2px; font-size: 8.5px; line-height: 1.05; }
.worksheet-autofill-controls select,
.worksheet-autofill-controls input { min-height: 30px; height: 30px; padding: 4px 5px; border-radius: 8px; font-size: 10.5px; }
.worksheet-rules-tools { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(190px, 1.35fr); gap: 4px; align-items: end; }
.worksheet-search { display: block; margin: 0; }
.worksheet-search input { min-height: 30px; height: 30px; padding: 4px 7px; font-size: 10.5px; }

.worksheet-rules-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: min-content;
  gap: 4px;
  align-content: start;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.worksheet-rule {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  padding: 2px 3px;
  border: 1.5px solid var(--worksheet-line);
  border-radius: 9px;
  background: #fcfefc;
  font-size: 10.5px;
  line-height: 1.18;
  cursor: pointer;
}

.worksheet-rule:hover { border-color: var(--worksheet-leaf); }
.worksheet-rule.is-selected { border-color: var(--worksheet-leaf); background: var(--worksheet-leaf-soft); }
.worksheet-rule.is-empty { opacity: .5; cursor: default; }
.worksheet-rule input { width: 14px; height: 14px; flex: none; margin: 0; accent-color: var(--worksheet-moss); }
.worksheet-rule-name { min-width: 0; flex: 1; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.worksheet-rule-count { flex: none; margin-left: auto; padding: 1px 5px; border-radius: 8px; color: var(--worksheet-pine); background: var(--worksheet-leaf-soft); font-size: 10px; }
.worksheet-rule.is-selected .worksheet-rule-count { background: #fff; }
.worksheet-rules-footer { padding-top: 6px; border-top: 1px solid var(--worksheet-line); }
.worksheet-rules-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.worksheet-rules-actions button { min-width: 0; min-height: 30px; padding: 3px 4px; border-radius: 8px; font-size: 9px; line-height: 1.05; white-space: normal; }
.worksheet-variant-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 9px; }
.worksheet-variant-choices[hidden] { display: none; }
.worksheet-variant-choice {
  min-width: 34px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--worksheet-line);
  border-radius: 8px;
  color: var(--worksheet-pine);
  background: #fff;
  font: 650 11.5px/1 var(--worksheet-font);
  cursor: pointer;
}
.worksheet-variant-choice:hover,
.worksheet-variant-choice.is-active { border-color: var(--worksheet-leaf); background: var(--worksheet-leaf-soft); }
.worksheet-empty { margin: 20px 4px; color: var(--worksheet-muted); font-size: 13px; line-height: 1.5; }

.worksheet-preview-pane { display: flex; flex-direction: column; overflow-y: auto; padding: 18px 22px 42px; }
.worksheet-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; width: min(100%, 820px); margin: 0 auto 13px; }
.worksheet-preview-head h2 { margin: 0 0 2px; color: var(--worksheet-pine); font-size: 16px; }
.worksheet-preview-head p { margin: 0; color: var(--worksheet-muted); font-size: 12px; }
.worksheet-preview-tools { display: flex; align-items: center; gap: 9px; }
.worksheet-zoom {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--worksheet-line);
  border-radius: 9px;
  background: #fff;
}
.worksheet-zoom button {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--worksheet-line);
  color: var(--worksheet-pine);
  background: #fff;
  font: 700 14px/1 var(--worksheet-font);
  cursor: pointer;
}
.worksheet-zoom button:last-child { border-right: 0; }
.worksheet-zoom button:hover:not(:disabled) { background: var(--worksheet-leaf-soft); }
.worksheet-zoom button:disabled { color: #aeb8a6; cursor: default; }
#worksheet-zoom-value { min-width: 55px; font-size: 12px; font-weight: 650; }
.worksheet-preview-badge { flex: none; padding: 4px 9px; border: 1px solid var(--worksheet-line); border-radius: 999px; color: var(--worksheet-pine); background: #fff; font-size: 11px; font-weight: 700; }
.worksheet-preview-stage { display: flex; align-items: flex-start; justify-content: flex-start; width: 100%; overflow-x: auto; }

.worksheet-sheet-preview {
  position: relative;
  flex: none;
  width: min(100%, 720px);
  margin: 0 auto;
  aspect-ratio: 210 / 297;
  min-height: 760px;
  padding: 7.2% 7.8%;
  overflow: hidden;
  color: #222;
  background: #fff;
  box-shadow: var(--worksheet-shadow);
  font-family: Arial, sans-serif;
}

.worksheet-sheet-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 40px; color: var(--worksheet-muted); text-align: center; }
.worksheet-sheet-empty strong { color: var(--worksheet-pine); font-size: 17px; }
.worksheet-sheet-empty span { font-size: 13px; }
.worksheet-paper-meta { display: flex; justify-content: flex-end; min-height: 20px; margin-bottom: 24px; color: #555; font-size: 12px; }
.worksheet-paper-meta span { min-width: 48%; padding-bottom: 4px; border-bottom: 1px solid #777; }
.worksheet-paper-title { margin: 0 0 22px; font-size: 21px; line-height: 1.2; text-align: center; }
.worksheet-paper-task { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.worksheet-paper-text { margin: 0 0 18px; font: 14px/1.65 Georgia, serif; white-space: pre-wrap; }
.worksheet-paper-words { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 20px; font-size: 14px; line-height: 1.5; }
.worksheet-paper-words span::after { content: ","; }
.worksheet-paper-words span:last-child::after { content: ""; }
.worksheet-paper-block { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #d9d9d9; border-radius: 3px; }
.worksheet-paper-block h3 { margin: 0 0 8px; font-size: 13px; }
.worksheet-paper-lines { min-height: 88px; background: repeating-linear-gradient(to bottom, transparent 0 23px, #c5c5c5 23px 24px); }
.worksheet-paper-lines.is-writing { min-height: 280px; background: repeating-linear-gradient(to bottom, transparent 0 24px, #c4d2e0 24px 25px, transparent 25px 31px, #dce3ea 31px 32px); }
.worksheet-paper-qr { float: right; display: grid; width: 74px; height: 74px; margin: 0 0 10px 14px; place-items: center; border: 7px double #222; font-size: 9px; font-weight: 800; }
.worksheet-paper-placeholder { color: #8b9581; font-style: italic; }

.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; }
.worksheet-print-frame { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

@media (680px < width <= 1432px) {
  .worksheet-shell:has(.worksheet-app.is-rules-open) {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .worksheet-app.is-rules-open {
    grid-template-columns: var(--worksheet-settings-width) minmax(300px, 1fr);
  }
  .worksheet-app.is-rules-open > :is(.worksheet-panel, .worksheet-rules-pane) { max-height: 760px; }
  .worksheet-app.is-rules-open > .worksheet-preview-pane {
    grid-column: 1 / -1;
    border-top: 1px solid var(--worksheet-line);
  }
}

@media (max-width: 1180px) {
  .worksheet-app {
    --worksheet-settings-base: 434px;
    grid-template-columns: var(--worksheet-settings-width) 0 minmax(420px, 1fr);
  }
  .worksheet-status { display: none; }
}

@media (max-width: 980px) {
  .worksheet-shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .worksheet-topbar { position: relative; align-items: flex-start; }
  .worksheet-header-actions { gap: 7px; }
  .worksheet-app { --worksheet-type-list-width: 100%; grid-template-columns: minmax(406px, 1fr) 0; height: auto; min-height: 0; }
  .worksheet-app.is-rules-open { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); }
  .worksheet-panel,
  .worksheet-rules-pane { max-height: 760px; }
  .worksheet-preview-pane { grid-column: 1 / -1; border-top: 1px solid var(--worksheet-line); }
  .worksheet-sheet-preview { min-height: 0; }
}

@media (680px < width <= 980px) {
  .worksheet-app.is-rules-open {
    --worksheet-type-list-width: calc(100% + max(406px, 50vw) - min(60vw, 100vw - 300px));
  }
}

@media (max-width: 680px) {
  .worksheet-topbar { display: block; padding: 12px 14px; }
  .worksheet-brand { margin-bottom: 11px; }
  .worksheet-brand b { white-space: normal; }
  .worksheet-header-actions { justify-content: flex-start; }
  .worksheet-btn-site { display: none; }
  .worksheet-app { display: block; }
  .worksheet-rules-pane { display: none; }
  .worksheet-app.is-rules-open .worksheet-rules-pane { display: flex; }
  .worksheet-panel,
  .worksheet-rules-pane { max-height: none; overflow: visible; border-right: 0; border-bottom: 1px solid var(--worksheet-line); }
  .worksheet-preview-pane { padding: 18px 10px 30px; }
  .worksheet-preview-head { padding: 0 4px; }
  .worksheet-preview-head p { display: none; }
  .worksheet-sheet-preview { min-height: 560px; padding: 8%; }
  .worksheet-shell .h_container { display: block; }
  .worksheet_list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .worksheet-autofill-controls { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .worksheet_list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .worksheet-shell { display: none !important; }
}

/* В правой колонке показывается не новый макет, а исходный фон,
   который generate_pdf.php использует для выбранного вида листа. */
.worksheet-sheet-preview {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 210 / 297;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#worksheet-template-image {
  display: block;
  width: 100%;
  height: auto;
}

#worksheet-template-image[hidden] { display: none; }

.worksheet-template-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  color: #111;
  font-family: "DejaVu Sans", Arial, sans-serif;
}

.worksheet-template-content[hidden] { display: none; }

.worksheet-preview-cover,
.worksheet-preview-image,
.worksheet-preview-image-empty {
  position: absolute;
  box-sizing: border-box;
}

.worksheet-preview-cover { z-index: 0; background: #fff; }
.worksheet-preview-image,
.worksheet-preview-image-empty { z-index: 1; border: .2cqw solid #c7d0c1; border-radius: .8cqw; background: #f8faf7; }
.worksheet-preview-image { object-fit: contain; }
.worksheet-preview-image-empty { display: grid; place-items: center; color: #8a9683; font-size: 1.8cqw; text-align: center; }
.worksheet-preview-image.is-sound-image { border: 0; border-radius: 0; background: transparent; }

.worksheet-preview-photo,
.worksheet-preview-photo-empty {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.worksheet-preview-photo { object-fit: contain; }
.worksheet-preview-photo-empty { display: grid; place-items: center; color: #8a9683; font-size: 2cqw; }
.worksheet-preview-photo-frame {
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  border: 2px solid #a6a6a6;
  border-radius: 1.4cqw;
  pointer-events: none;
}
.worksheet-preview-field.is-photo-meta { color: #111; line-height: 1.1; }
.worksheet-preview-photo-questions {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  color: #232923;
  font-size: 1.85cqw;
  line-height: 1.35;
}
.worksheet-preview-photo-question { margin-bottom: 1cqw; }
.worksheet-preview-photo-question-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.worksheet-preview-photo-question-lines { display: grid; }
.worksheet-preview-photo-question-lines span { height: 3.333cqw; box-sizing: border-box; border-bottom: .18cqw solid #9eaea0; }

.worksheet-preview-field {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.36;
}

.worksheet-preview-field.font-9 { font-size: 1.5cqw; }
.worksheet-preview-field.font-10 { font-size: 1.68cqw; }
.worksheet-preview-field.font-11 { font-size: 1.85cqw; }
.worksheet-preview-field.font-12 { font-size: 2.02cqw; }
.worksheet-preview-field.font-13 { font-size: 2.18cqw; }
.worksheet-preview-field.font-14 { font-size: 2.35cqw; }
.worksheet-preview-field.font-28 { font-size: 4.7cqw; line-height: .665; }
.worksheet-preview-field.font-32 { font-size: 5.38cqw; line-height: .967; }
.worksheet-preview-field.is-muted { color: #4d4d4d; }
.worksheet-preview-field.is-cloze-bank-title { color: #778679; font-weight: 700; line-height: 1.2; }
.worksheet-preview-field.is-cloze-pupil-field { display: flex; align-items: baseline; gap: .62cqw; line-height: 1.2; }
.worksheet-cloze-pupil-line { flex: 1; border-bottom: .086cqw solid currentColor; }
.worksheet-preview-field.is-cloze-heading { font-family: "Caveat", cursive; font-weight: 700; line-height: 1.06; }
.worksheet-preview-field.is-cloze-task { line-height: 1.23; }
.worksheet-preview-field:is(.is-cloze-text, .is-cloze-bank, .is-cloze-task, .is-cloze-pupil-field) {
  font-family: "Worksheet Cloze Sans", "DejaVu Sans", Arial, sans-serif;
  font-kerning: none;
}
.worksheet-preview-field.is-sound-title {
  overflow: visible;
  font-family: "Caveat", cursive;
  font-size: 7.6cqw;
  font-weight: 700;
  line-height: .92;
  text-align: center;
}
.worksheet-preview-sound-ruling,
.worksheet-preview-sound-bottom { position: absolute; z-index: 0; }
.worksheet-preview-sound-ruling { overflow: hidden; }
.worksheet-preview-sound-ruling img { position: absolute; left: 0; width: 100%; max-width: none; }
.worksheet-preview-sound-bottom { background: #fff; }
.worksheet-preview-field.is-copy { color: #b4b4b4; }
.worksheet-preview-field.is-propisi-task { line-height: 1.2; white-space: normal; }
.worksheet-preview-field.is-propisi {
  font-weight: 400;
  font-kerning: normal;
  font-feature-settings: "kern" 1;
  transform: translateY(1.25cqw);
}
.worksheet-propisi-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: #b4b4b4;
  font-kerning: none;
  white-space: pre;
}
.worksheet-propisi-layer.is-dotted { fill: #969696; }
.worksheet-preview-field.is-propisi-print { font-family: "Worksheet Print", sans-serif; }
.worksheet-preview-field.is-propisi-print-dotted { color: #969696; font-family: "Worksheet Print Dots", sans-serif; }
.worksheet-preview-field.font-28.is-propisi-print,
.worksheet-preview-field.font-28.is-propisi-print-dotted { font-size: 3.02cqw; line-height: 1.034; }
.worksheet-preview-field.font-32.is-propisi-print,
.worksheet-preview-field.font-32.is-propisi-print-dotted { font-size: 3.36cqw; line-height: 1.547; }
.worksheet-preview-field.align-right { text-align: right; }

.worksheet-preview-qr {
  position: absolute;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: .8cqw;
  border: .18cqw solid #98a99b;
  background: #fff;
  color: #526356;
  font: 600 2.05cqw/1.25 var(--worksheet-font);
  text-align: center;
  white-space: pre-line;
}

.worksheet-sheet-preview .worksheet-sheet-empty {
  min-height: 620px;
}

.worksheet-sheet-preview .worksheet-sheet-empty[hidden] { display: none; }

@media (max-width: 680px) {
  .worksheet-photo-controls { grid-template-columns: 1fr; }
  .worksheet-photo-questions-head { display: block; }
  .worksheet-photo-lines-settings { align-items: flex-start; flex-direction: column; }
  .worksheet-sheet-preview { min-height: 0; padding: 0; }
  .worksheet-sheet-preview .worksheet-sheet-empty { min-height: 480px; }
}


