/* WP's first modernised flow. Colours and typography match sm/SMModern.css.
   Rules are scoped to wp-modern; other learning programs keep their layout. */
.wp-modern {
  --wp-ink: #1d2f4f;
  --wp-muted: #52627a;
  --wp-blue: #304fd0;
  --wp-bg: #fbf8ec;
  --wp-surface: #fffefa;
  --wp-line: #e5e0d3;
  --wp-control-line: #d3a8b9;
  --wp-control-line-soft: #dfc4d0;
  --wp-picture-line: #efd6e0;
  --wp-selected: #f6dce7;
  --wp-accent-soft: #bd3c711a;
  --wp-accent-shadow: #bd3c7126;
  --wp-card-shadow: #d3a8b966;
  margin: 0 !important;
  padding: 0;
  min-height: 100vh;
  background: var(--wp-bg) !important;
  color: var(--wp-ink);
  font: 16px/1.65 "Segoe UI", Arial, sans-serif;
}
.wp-modern *, .wp-modern *::before, .wp-modern *::after { box-sizing: border-box; }
.wp-modern form { min-height: 100vh; display: flex; flex-direction: column; }
.wp-modern a { color: var(--wp-blue); text-decoration: none; font-weight: 600; }
.wp-modern a:hover { text-decoration: underline; text-underline-offset: 4px; }
.wp-modern a:focus-visible, .wp-modern input:focus-visible, .wp-modern select:focus-visible {
  outline: 3px solid #c56804; outline-offset: 4px;
}
.wp-modern h1, .wp-modern h2 { color: var(--wp-ink); line-height: 1.2; font-weight: 700; }
.wp-modern .wp-login-layout h1, .wp-modern .wp-page-intro h1 { font-size: clamp(2rem, 3.6vw, 3.25rem); letter-spacing: -.045em; margin: 0 0 20px; }
.wp-modern h2 { font-size: 1.35rem; letter-spacing: -.025em; margin: 0 0 14px; }
.wp-modern p { margin: 0 0 18px; }
.wp-modern img { max-width: 100%; height: auto; }
.wp-modern .wp-eyebrow { color: var(--wp-accent, #3553a4); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 14px; }
.wp-modern .wp-lead { color: var(--wp-muted); font-size: 1.08rem; max-width: 660px; }
.wp-lead br { display: none; }
.wp-page-intro { margin: 0 0 32px; }
.wp-modern .wp-main, .wp-modern .wp-master-main, .wp-modern .wp-abc-main, .wp-modern .wp-img-word-main {
  width: 100%; max-width: 1184px; padding: 44px 32px 64px; margin: 0 auto !important; text-align: left;
}
.wp-modern .SMpage, .wp-modern .RPPage, .wp-modern .BPPage, .wp-modern .GPPage, .wp-modern .WPPage {
  width: 100%; height: auto; min-height: 0; margin: 0 !important; background: transparent; border: 0; font: inherit; text-align: left;
}
.wp-modern .wp-shell { display: flex; flex: 1; flex-direction: column; }
.wp-modern .wp-master-main { flex: 1; }
.wp-modern .wp-master-main > table { width: 100%; border-spacing: 0; }
.wp-modern .wp-master-main > table > tbody > tr > td { width: auto !important; padding: 0; }
.wp-modern .wp-master-main > table > tbody > tr > td:empty { display: none; }
.wp-skip { position: absolute; top: -100px; left: 16px; z-index: 10000; padding: 12px 20px; background: #fff; }
.wp-skip:focus { top: 8px; }
.wp-modern .wp-back { display: inline-block; margin-bottom: 24px; font-size: .9rem; }

/* The existing shared header retains language, account and exercise menus. */
.wp-modern .wp-header { background: #0000ff; text-align: left; }
.wp-modern table[id$="tblPagehead"] { width: min(1120px, calc(100% - 64px)) !important; height: auto !important; margin: 0 auto; background: transparent !important; border-spacing: 0; }
.wp-modern table[id$="tblPagehead"] td { padding: 18px 0; }
.wp-modern table[id$="tblPagehead"] td:first-child { width: 220px !important; }
.wp-modern table[id$="tblPagehead"] td:nth-child(2) { text-align: center; padding-left: 0; }
.wp-modern table[id$="tblPagehead"] td:nth-child(3) { display: none; }
.wp-modern table[id$="tblPagehead"] td:last-child { width: 220px !important; text-align: right; white-space: nowrap; }
.wp-modern img[id$="imgSundMed"] { display: block; width: auto; height: 50px; }
.wp-modern table[id$="tblPagehead"] span { color: #ffff00 !important; font: 600 1.65rem/1.35 "Segoe UI", Arial, sans-serif !important; }
.wp-modern table[id$="tblPagehead"] input[type="image"], .wp-modern table[id$="tblPagehead"] a img { max-height: 40px; width: auto; vertical-align: middle; }
.wp-modern table[id$="tblPagehead"] input[id$="imbFlag"] { width: 26px; height: auto; }
.wp-modern select { min-height: 40px; max-width: 100%; border: 1px solid #b7c3d6; border-radius: 8px; padding: 8px; background: #fff !important; color: var(--wp-ink) !important; font: inherit !important; }
.wp-modern select[id$="ddlLang1"] { width: 108px !important; font-size: .875rem !important; margin-top: 6px; }
.wp-modern table[id$="tblPageMenu"] { background: var(--wp-bg); border-bottom: 1px solid var(--wp-line); padding: 8px max(16px, calc((100% - 1120px) / 2)); }
.wp-modern table[id$="tblPageMenu"] > tbody > tr > td { background: transparent !important; }
.wp-modern input[type="submit"], .wp-modern button {
  min-height: 46px; max-width: 100%; padding: 11px 18px; border: 1px solid var(--wp-blue); border-radius: 8px;
  background: var(--wp-blue); color: #fff; font: 600 .95rem/1.4 "Segoe UI", Arial, sans-serif; cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}
.wp-modern input[type="submit"]:hover { background: #223ba7; }
.wp-modern input[type="submit"]:disabled { opacity: .55; cursor: default; }
.wp-modern input[type="text"], .wp-modern input[type="password"] { min-height: 48px; max-width: 100%; border: 1px solid #b7c3d6; border-radius: 8px; background: #fff; color: var(--wp-ink); padding: 10px 12px; font: inherit; }
.wp-modern input[id$="btnLogout"] { min-height: 38px; padding: 8px 14px; font-size: .85rem; background: var(--wp-ink); border-color: var(--wp-ink); }
.wp-modern [id$="lblUserName"] { color: var(--wp-muted); font-size: .85rem; }
.wp-modern table[id$="tblBottom"] { width: 100%; margin-top: auto; border: 0; background: var(--wp-ink) !important; color: #fff; padding: 16px 24px; font-size: .875rem; }
.wp-modern table[id$="tblBottom"] a, .wp-modern table[id$="tblBottom"] span { color: #fff !important; }
.wp-modern [id$="lblMobileVersion"] { display: none; }
.wp-modern .wp-footer { margin-top: auto; }
.wp-modern .wp-message { display: block; margin: 18px 0; color: #a5283b !important; font-weight: 600; }

/* Sign in. */
.wp-login-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 80px; align-items: center; padding: 24px 0 40px; }
.wp-login-copy { max-width: 480px; }
.wp-login-card { padding: 36px; border: 1px solid var(--wp-line); border-radius: 18px; background: var(--wp-surface); box-shadow: 0 18px 45px -30px #34457355; }
.wp-login-card h2 { margin-bottom: 28px; font-size: 1.55rem; }
.wp-field { margin-bottom: 20px; }
.wp-field label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 8px; }
.wp-field input { width: 100%; }
.wp-modern .wp-login-submit { display: block; width: 100%; margin-top: 26px; }
.wp-forgot { display: block; margin-top: 20px; text-align: center; font-size: .9rem; }

/* Account menu and program cards. */
.wp-modern .wp-account-nav { margin-bottom: 36px; }
.wp-modern table[id$="tblMainMenu"] { width: auto !important; background: transparent !important; border-spacing: 0; }
.wp-modern table[id$="tblMainMenu"] > tbody { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-modern table[id$="tblMainMenu"] tr { display: flex; height: auto; }
.wp-modern table[id$="tblMainMenu"] tr:first-child, .wp-modern table[id$="tblMainMenu"] tr:last-child { display: none; }
.wp-modern table[id$="tblMainMenu"] td { width: auto !important; background: transparent !important; padding: 0; font-size: 0; }
.wp-modern table[id$="tblMainMenu"] a { display: inline-block; padding: 8px 16px; background: var(--wp-surface); border: 1px solid var(--wp-line); border-radius: 8px; font-size: .9rem; }
.wp-modern table[id$="tblMainMenu"] a:hover { background: #f1ead8; text-decoration: none; }
.wp-modern table[id$="tblMainMenu"] a[aria-current="page"] { background: var(--wp-ink); border-color: var(--wp-ink); color: #fff; font-weight: 700; }
.wp-program-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.wp-pink { --wp-accent: #bd3c71; --wp-tint: #fbeaf1; }
.wp-blue {
  --wp-accent: #335cc7; --wp-tint: #ebf0fe;
  --wp-line: #d5e0f7;
  --wp-control-line: #b4c4eb;
  --wp-control-line-soft: #cbd6ef;
  --wp-picture-line: #d5e0f7;
  --wp-selected: #dce5fb;
  --wp-accent-soft: #335cc71a;
  --wp-accent-shadow: #335cc726;
  --wp-card-shadow: #b4c4eb66;
}
.wp-green {
  --wp-accent: #24745b; --wp-tint: #e7f4ee;
  --wp-line: #cfe4d9;
  --wp-control-line: #a4c7b6;
  --wp-control-line-soft: #c4ddcf;
  --wp-picture-line: #cfe4d9;
  --wp-selected: #d7ebdf;
  --wp-accent-soft: #24745b1a;
  --wp-accent-shadow: #24745b26;
  --wp-card-shadow: #a4c7b666;
}
.wp-math { --wp-accent: #7350b8; --wp-tint: #f0ebfa; }
.wp-program-card { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 0; min-width: 0; padding: 24px; border: 1px solid #dfe5ef; border-top: 4px solid var(--wp-accent); border-radius: 14px; background: var(--wp-tint); }
.wp-program-symbol { display: grid; place-items: center; align-self: start; min-width: 52px; height: 52px; padding: 0 10px; margin-bottom: 22px; background: #ffffffbb; color: var(--wp-accent); border-radius: 12px; font-size: 1.4rem; font-weight: 650; }
.wp-program-card h2 { font-size: 1.15rem; }
.wp-program-card > p { color: var(--wp-muted); font-size: .94rem; margin-bottom: 26px; }
.wp-program-card .wp-program-symbol { justify-self: start; }
/* Share the content rows across cards; extra book buttons stay below the primary program. */
.wp-modern .wp-card-actions { align-self: start; margin-top: 0; width: 100%; border-spacing: 0; }
.wp-modern div.wp-card-actions { padding-top: 8px; }
.wp-card-actions td { padding: 8px 0 0; }
.wp-modern .wp-card-actions input { width: 100%; background: var(--wp-accent); border-color: var(--wp-accent); white-space: normal; }
.wp-modern .wp-card-actions tr:not(:first-child) input { background: transparent; color: var(--wp-accent); }
.wp-modern .wp-card-actions input:hover:enabled { box-shadow: 0 0 0 3px #ffffff99; }

/* Program exercise menus. */
.wp-modern.wp-pink-menu, .wp-modern.wp-pink.wp-abc, .wp-modern.wp-pink.wp-img-word, .wp-modern.wp-pink.wp-spell, .wp-modern.wp-pink.wp-img-text { --wp-bg: var(--wp-tint); }
.wp-modern.wp-blue-menu, .wp-modern.wp-blue:is(.wp-abc, .wp-img-word, .wp-img-text, .wp-spell) { --wp-bg: #e3f2fd; }
.wp-modern.wp-green-menu, .wp-modern.wp-green-exercise, .wp-modern.wp-green-mixed { --wp-bg: #deefdc; }
.wp-exercise-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; max-width: 900px; margin: 0 auto; }
.wp-exercise-card { min-width: 0; padding: 12px 6px; text-align: center; }
.wp-exercise-number { color: var(--wp-accent); }
.wp-exercise-card h2 { display: flex; align-items: baseline; justify-content: center; gap: .6em; font-size: 1.1rem; min-height: 1.4em; margin: 0 0 16px; }
.wp-exercise-card input[type="image"] { display: block; width: 192px !important; height: auto !important; aspect-ratio: 1; max-width: 100%; margin: 0 auto; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.wp-exercise-card input[type="image"]:hover { filter: brightness(1.04); }
.wp-exercise-card input[type="image"]:active { transform: scale(.97); }
.wp-exercise-card:focus-within { outline: 3px solid #c56804; outline-offset: 4px; }
.wp-exercise-card:hover h2 { color: var(--wp-accent); }
.wp-grammar { display: none; }
.wp-grammar:has(input) { display: block; width: 204px; max-width: 100%; margin: 28px auto 0; padding: 12px 6px; text-align: center; }
.wp-grammar h2 { font-size: 1.1rem; margin: 0 0 16px; }
.wp-grammar input { display: block; width: 192px !important; height: auto !important; aspect-ratio: 1; max-width: 100%; margin: 0 auto; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.wp-pink-menu .wp-exercise-card input[type="image"],
.wp-pink-menu .wp-grammar input[type="image"],
.wp-blue-menu .wp-exercise-card input[type="image"],
.wp-blue-menu .wp-grammar input[type="image"] {
  box-sizing: border-box;
  border: 2px solid var(--wp-control-line) !important;
  border-radius: 12px;
  padding: 8px;
  background: transparent;
}
.wp-green-menu .wp-exercise-card input[type="image"], .wp-green-menu .wp-grammar input[type="image"] {
  border: 2px solid var(--wp-control-line) !important; border-radius: 12px; padding: 8px; background: transparent;
}
.wp-blue-menu .wp-exercise-card input[type="image"], .wp-blue-menu .wp-grammar input[type="image"] { border-color: #b4c4eb !important; }
.wp-grammar input:hover { filter: brightness(1.04); }
.wp-grammar input:active { transform: scale(.97); }
.wp-grammar:hover h2 { color: var(--wp-accent); }
.wp-grammar:focus-within { outline: 3px solid #c56804; outline-offset: 4px; }

/* Green sound controls retain the current selection rules and postback controls. */
.wp-green-menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 152px; gap: 24px; align-items: start; }
.wp-green-sound-summary { position: sticky; top: 24px; padding-top: 56px; }
.wp-modern.wp-green .wp-sound-summary { width: 100% !important; height: auto !important; padding: 14px 10px; border: 2px solid var(--wp-control-line) !important; border-radius: 14px; background: var(--wp-surface) !important; border-spacing: 0; }
.wp-modern.wp-green .wp-sound-summary td { padding: 4px; }
.wp-modern.wp-green .wp-sound-summary input { width: 100%; padding: 8px; background: var(--wp-accent); border-color: var(--wp-accent); }
.wp-modern.wp-green .wp-sound-summary table { width: auto; margin: 0 auto; border-spacing: 0; }
.wp-modern.wp-green .wp-sound-summary table td { padding: 0 3px; }
.wp-modern.wp-green .wp-sound-summary font { font-size: 1.05rem; }
.wp-modern.wp-green .wp-sound-summary font[color="blue"] { color: #0000ff !important; }
.wp-modern.wp-green .wp-sound-summary font[color="red"] { color: #ff0000 !important; }
.wp-modern.wp-green .wp-sound-icon { display: inline-block; width: 42px !important; height: 42px !important; object-fit: contain; cursor: pointer; }
.wp-modern.wp-green .wp-green-selection { max-width: 900px; margin: 0 auto; }
.wp-modern.wp-green .wp-sound-picker > table { display: block; width: 100%; padding: 24px; border: 2px solid var(--wp-control-line) !important; border-radius: 18px; background: var(--wp-surface) !important; border-spacing: 0; }
.wp-modern.wp-green .wp-sound-picker > table > tbody { display: block; }
.wp-modern.wp-green .wp-sound-spacer { display: none; }
.wp-modern.wp-green .wp-sound-heading { display: block; margin-bottom: 20px; height: auto !important; }
.wp-modern.wp-green .wp-sound-heading td { display: block; width: auto !important; padding: 0; }
.wp-modern.wp-green .wp-sound-heading td:empty { display: none; }
.wp-modern.wp-green .wp-sound-heading span { font: 650 1.35rem/1.4 "Segoe UI", Arial, sans-serif !important; color: var(--wp-ink); }
.wp-modern.wp-green .wp-sound-option-row { display: grid; grid-template-columns: 120px repeat(7, minmax(42px, 1fr)) 46px; gap: 8px; align-items: center; padding: 12px 0; border-top: 1px solid var(--wp-line); }
.wp-modern.wp-green .wp-sound-option-row > td { width: auto !important; padding: 0; }
.wp-modern.wp-green .wp-sound-option-row > td:empty { display: none; }
.wp-modern.wp-green .wp-sound-option-row > td:nth-child(2) { grid-column: 1; text-align: left; white-space: nowrap; }
.wp-modern.wp-green .wp-sound-option-row > td:nth-child(2) span { font: 650 1rem/1.4 "Segoe UI", Arial, sans-serif !important; color: #000000 !important; }
.wp-modern.wp-green .wp-sound-option-row > td:nth-child(2) span:first-child { color: #0000ff !important; }
.wp-modern.wp-green .wp-sound-option-row > td:last-child { grid-column: 9; }
.wp-modern.wp-green .wp-sound-option-row > td > span:has(input) { display: block; position: relative; }
.wp-modern.wp-green .wp-sound-option-row input { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; margin: 0; accent-color: var(--wp-accent); }
.wp-modern.wp-green .wp-sound-option-row label { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 7px 5px 7px 28px; border: 1px solid var(--wp-control-line-soft); border-radius: 9px; background: var(--wp-tint); color: #ff0000; font: 600 1rem/1.4 "Segoe UI", Arial, sans-serif; cursor: pointer; }
.wp-modern.wp-green .wp-sound-option-row input:checked + label { background: var(--wp-selected); border-color: var(--wp-accent); box-shadow: 0 0 0 1px var(--wp-accent); }
.wp-modern.wp-green .wp-sound-option-row input:focus-visible + label { outline: 3px solid #c56804; outline-offset: 3px; }
.wp-modern.wp-green .wp-sound-option-row input:disabled + label { opacity: .6; cursor: default; }
.wp-modern.wp-green .wp-sound-picker [role="status"] { display: block; margin-top: 16px; color: var(--wp-accent) !important; width: auto !important; }
.wp-modern.wp-green .wp-sound-actions-row { display: block; height: auto !important; margin-top: 24px; }
.wp-modern.wp-green .wp-sound-actions-row > td { display: block; text-align: right; }
.wp-modern.wp-green .wp-sound-actions-row input, .wp-modern.wp-green .wp-sound-actions input { width: auto !important; min-width: 100px; background: var(--wp-accent); border-color: var(--wp-accent); }
.wp-modern.wp-green input.wp-secondary { background: transparent; color: var(--wp-accent); border-color: var(--wp-control-line); }
.wp-modern.wp-green .wp-sound-settings { max-width: 760px; margin: 0 auto; padding: 28px; border: 2px solid var(--wp-control-line); border-radius: 18px; background: var(--wp-surface); }
.wp-modern.wp-green .wp-sound-settings fieldset { margin: 0 0 28px; padding: 0; border: 0; }
.wp-modern.wp-green .wp-sound-settings legend { margin: 0 0 14px; font-size: 1.2rem; font-weight: 650; }
.wp-modern.wp-green .wp-setting-option { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; margin-top: 10px; padding: 14px; border: 1px solid var(--wp-control-line-soft); border-radius: 10px; }
.wp-modern.wp-green .wp-setting-option:has(input:checked) { border-color: var(--wp-accent); background: var(--wp-tint); }
.wp-modern.wp-green .wp-setting-option input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--wp-accent); }
.wp-modern.wp-green .wp-setting-option label { cursor: pointer; }
.wp-modern.wp-green .wp-setting-choice { display: flex; align-items: center; gap: 10px; font-weight: 650; white-space: nowrap; }
.wp-modern.wp-green .wp-setting-option > label { min-width: 0; }
.wp-modern.wp-green .wp-sound-actions { display: flex; justify-content: flex-end; gap: 12px; }
.wp-green-progress { padding-top: 16px; text-align: center; color: var(--wp-muted); }
@media (max-width: 960px) {
  .wp-green-menu-layout { grid-template-columns: minmax(0, 1fr); }
  .wp-green-sound-summary { grid-row: 1; position: static; padding: 0; width: 220px; justify-self: center; }
  .wp-modern.wp-green .wp-sound-option-row { grid-template-columns: 100px repeat(7, minmax(34px, 1fr)) 42px; gap: 4px; }
  .wp-modern.wp-green .wp-sound-option-row input { position: static; transform: none; margin: 0 auto 4px; display: block; }
  .wp-modern.wp-green .wp-sound-option-row label { padding: 7px 3px; min-height: 36px; }
}
@media (max-width: 700px) {
  .wp-modern.wp-green .wp-sound-picker > table, .wp-modern.wp-green .wp-sound-settings { padding: 18px; }
  .wp-modern.wp-green .wp-sound-option-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .wp-modern.wp-green .wp-sound-option-row > td:nth-child(2) { grid-column: 1 / -2; }
  .wp-modern.wp-green .wp-sound-option-row > td:last-child { grid-column: 4; grid-row: 1; }
  .wp-modern.wp-green .wp-sound-option-row > td:has(input) { grid-row: auto; }
  .wp-modern.wp-green .wp-setting-option { grid-template-columns: 1fr; gap: 4px; }
}

/* The ABC table keeps its server controls and AJAX update boundaries. */
.wp-modern .wp-abc-board { width: 100%; padding: 0; border: 0 !important; background: transparent; }
.wp-abc-board > tbody { display: grid; grid-template-columns: 80px 140px 90px minmax(210px, 1fr); grid-template-areas: "sound letter . picture" "hand answer feedback picture" "audio input input picture" "alphabet alphabet alphabet alphabet" "progress progress progress progress"; justify-content: center; gap: 20px 16px; max-width: 850px; margin: 0 auto; align-items: center; }
.wp-abc-board > tbody > tr { display: contents; height: auto !important; }
.wp-abc-board > tbody > tr > td { display: none; width: auto !important; height: auto !important; padding: 0; }
.wp-abc-board > tbody > tr > td[class^="wp-abc-"] { display: flex; justify-content: center; align-items: center; min-width: 0; }
.wp-abc-board .wp-abc-sound { grid-area: sound; }
.wp-abc-board .wp-abc-letter { grid-area: letter; }
.wp-abc-board .wp-abc-picture { grid-area: picture; min-height: 230px; background: var(--wp-tint); border: 1px solid var(--wp-picture-line); border-radius: 16px; padding: 20px; }
.wp-abc-picture > div { width: 100%; text-align: center; }
.wp-modern #imgTypingHint { display: block; width: 100%; max-width: 400px; height: auto; margin: 0 auto; }
.wp-modern .wp-abc-board .wp-abc-hand { display: none; }
.wp-abc-board .wp-abc-answer { grid-area: answer; }
.wp-abc-board .wp-abc-feedback { grid-area: feedback; }
.wp-abc-board .wp-abc-audio { grid-area: audio; }
.wp-abc-board .wp-abc-input { grid-area: input; }
.wp-abc-board .wp-abc-alphabet { grid-area: alphabet; border: 1px solid var(--wp-line) !important; border-radius: 12px; background: var(--wp-bg); padding: 20px !important; margin-top: 12px; }
.wp-abc-board .wp-abc-progress > td { display: block; grid-area: progress; text-align: center; }
.wp-abc-board .wp-abc-capture { display: block; position: absolute; width: 1px; height: 1px !important; overflow: hidden; clip-path: inset(50%); }
.wp-modern input[id="btnDefault"] { min-height: 1px; padding: 0; border: 0; }
.wp-modern #lblLetter { width: auto !important; font: 700 5rem/1.15 "Segoe UI", Arial, sans-serif !important; }
.wp-modern #txtTypedLetter { width: 112px !important; height: 92px; padding: 0; text-align: center; font: 600 4rem/1 "Segoe UI", Arial, sans-serif !important; background: #fff !important; border: 2px solid var(--wp-control-line) !important; border-radius: 14px; }
.wp-modern #txtInput { width: 64px !important; height: 58px !important; text-align: center; font-size: 2rem !important; }
.wp-modern #imgPict { width: 210px; max-width: 100%; height: auto; border: 0 !important; border-radius: 10px; }
.wp-abc-board input[type="image"], .wp-abc-board #imgPlayABC, .wp-abc-board #imgStopABC { max-width: 64px; max-height: 64px; width: auto; height: auto; }
.wp-modern .wp-abc-board .wp-sound-icon,
.wp-modern .wp-abc-board .wp-feedback-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  padding: 0;
  border: 0 !important;
  border-radius: 12px;
  background: transparent;
  vertical-align: middle;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.wp-modern .wp-sound-icon:hover, .wp-modern .wp-feedback-icon:hover { filter: brightness(1.05); }
.wp-modern .wp-sound-icon:active, .wp-modern .wp-feedback-icon:active { transform: scale(.94); }
.wp-abc-alphabet > div { width: 100%; }
.wp-abc-alphabet table { width: 100%; }
.wp-abc-alphabet td { font-size: 2.5rem; font-weight: 600; line-height: 1.4; padding: 6px 4px; }
.wp-modern #pnlFinished { padding: 20px 0; border: 0; background: transparent; }
.wp-modern #pnlFinished > table > tbody > tr:first-child { display: none; }
.wp-modern .wp-done-card {
  width: min(100%, 340px);
  margin: 0 auto;
  padding: 20px;
  border: 2px solid var(--wp-control-line);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 12px;
  background: transparent;
}
.wp-modern .wp-done-card tr { height: auto !important; border: 0 !important; }
.wp-modern .wp-done-card td { width: auto !important; padding: 8px; border: 0 !important; vertical-align: middle; text-align: center; }
.wp-modern .wp-done-card input[type="image"] {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 0 !important;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s ease;
}
.wp-modern .wp-done-card input[type="image"]:active { transform: scale(.94); }

/* Picture + word: preserve each picture/slot pair across responsive rows. */
.wp-img-word .wp-match-board { border-spacing: 0; }
.wp-img-word .wp-match-board > tbody {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "picture1 picture2 picture3" "slot1 slot2 slot3" ". . ." "picture4 picture5 picture6" "slot4 slot5 slot6" "prompt prompt prompt" "wait wait wait";
  grid-template-rows: auto auto 8px auto auto auto auto;
  gap: 12px 24px;
  max-width: 900px;
  margin: 0 auto;
}
.wp-img-word .wp-match-board > tbody > tr { display: contents; height: auto !important; }
.wp-img-word .wp-match-board > tbody > tr > td { display: none; width: auto !important; padding: 0; }
.wp-img-word .wp-match-board td.wp-match-picture,
.wp-img-word .wp-match-board td.wp-match-slot,
.wp-img-word .wp-match-board td.wp-match-prompt,
.wp-img-word .wp-match-board td.wp-match-wait { display: flex; align-items: center; justify-content: center; min-width: 0; }
.wp-img-word .wp-match-picture {
  padding: 12px !important;
  border: 0;
  background: transparent;
}
.wp-match-picture-1 { grid-area: picture1; }
.wp-match-picture-2 { grid-area: picture2; }
.wp-match-picture-3 { grid-area: picture3; }
.wp-match-picture-4 { grid-area: picture4; }
.wp-match-picture-5 { grid-area: picture5; }
.wp-match-picture-6 { grid-area: picture6; }
.wp-match-slot-1 { grid-area: slot1; }
.wp-match-slot-2 { grid-area: slot2; }
.wp-match-slot-3 { grid-area: slot3; }
.wp-match-slot-4 { grid-area: slot4; }
.wp-match-slot-5 { grid-area: slot5; }
.wp-match-slot-6 { grid-area: slot6; }
.wp-img-word .wp-match-picture > div { position: relative; width: 100%; max-width: 210px; aspect-ratio: 210 / 170; min-height: 0; }
.wp-img-word .wp-match-picture > div::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 2px 2px 3px #1d2f4f55, inset -2px -2px 2px #ffffffbb;
  pointer-events: none;
}
.wp-img-word .wp-match-picture img { display: block; width: 100% !important; height: 100% !important; max-height: 100%; object-fit: fill; border: 0 !important; border-radius: 8px; }
.wp-img-word .wp-match-slot { align-self: start; }
.wp-img-word .wp-match-slot > div { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: calc(100% - 24px); max-width: 210px; align-items: center; }
.wp-modern.wp-img-word .wp-match-choice {
  grid-column: 1 / -1;
  width: 100% !important;
  height: 64px !important;
  min-height: 64px;
  padding: 8px 12px;
  border: 2px dashed var(--wp-control-line);
  border-radius: 12px;
  background: transparent !important;
  color: var(--wp-accent);
  font: 600 1.5rem/1.3 "Segoe UI", Arial, sans-serif !important;
}
.wp-modern.wp-img-word .wp-match-choice:hover { border-style: solid; background: var(--wp-surface) !important; }
.wp-img-word .wp-match-slot table, .wp-img-word .wp-match-prompt table {
  width: 100% !important;
  height: 64px !important;
  border: 2px solid var(--wp-control-line) !important;
  border-radius: 12px;
  border-spacing: 0;
  background: var(--wp-surface) !important;
  table-layout: fixed;
}
.wp-img-word .wp-match-slot table td, .wp-img-word .wp-match-prompt table td { padding: 4px 8px; }
.wp-img-word .wp-match-slot table span, .wp-img-word .wp-match-prompt table span { color: var(--wp-ink); font: 600 2rem/1.35 "Segoe UI", Arial, sans-serif !important; overflow-wrap: anywhere; }
.wp-modern.wp-img-word .wp-match-undo {
  position: absolute;
  left: calc(100% + 8px);
  top: 10px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 1px solid var(--wp-control-line) !important;
  border-radius: 10px;
  background: var(--wp-surface);
  cursor: pointer;
}
.wp-modern.wp-img-word .wp-match-undo:hover { background: #fff; }
.wp-img-word .wp-match-board td.wp-match-prompt {
  grid-area: prompt;
  position: sticky;
  bottom: 16px;
  z-index: 2;
  justify-self: center;
  width: min(210px, calc((100% - 48px) / 3 - 24px)) !important;
  margin-top: 8px;
  padding: 10px 0 !important;
  border-radius: 16px;
  background: var(--wp-bg);
}
.wp-img-word .wp-match-prompt > div { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.wp-img-word .wp-match-prompt table { border-color: var(--wp-accent) !important; box-shadow: 0 0 0 3px var(--wp-accent-soft); }
.wp-img-word .wp-match-prompt table span { font-size: 2.25rem !important; }
.wp-img-word .wp-match-prompt .wp-feedback-icon { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; cursor: pointer; }
.wp-img-word .wp-match-wait { grid-area: wait; min-height: 22px; }
.wp-img-word #upnDoneCapture { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Pink exercise 4: three picture/sentence pairs with room to read. */
.wp-modern .wp-img-text-main { width: 100%; max-width: 1184px; margin: 0 auto !important; padding: 28px 32px 40px; text-align: left; }
.wp-img-text .wp-text-legacy-break { display: none; }
.wp-img-text .wp-text-board { border: 0 !important; border-spacing: 0; }
.wp-img-text .wp-text-board > tbody {
  display: grid;
  grid-template-columns: 210px minmax(0, 530px);
  grid-template-areas: "picture1 slot1" "picture2 slot2" "picture3 slot3" ". prompt";
  grid-template-rows: repeat(3, minmax(170px, auto)) minmax(104px, auto);
  gap: 20px 32px;
  width: 100%; max-width: 828px;
  margin: 0 auto; padding-right: 56px;
}
.wp-img-text .wp-text-board > tbody > tr { display: contents; height: auto !important; }
.wp-img-text .wp-text-board > tbody > tr > td { display: none; width: auto !important; min-width: 0; padding: 0; }
.wp-img-text .wp-text-board td.wp-text-picture,
.wp-img-text .wp-text-board td.wp-text-slot,
.wp-img-text .wp-text-board td.wp-text-prompt { display: flex; justify-content: center; align-items: center; }
.wp-img-text .wp-text-picture-1 { grid-area: picture1; }
.wp-img-text .wp-text-picture-2 { grid-area: picture2; }
.wp-img-text .wp-text-picture-3 { grid-area: picture3; }
.wp-img-text .wp-text-slot-1 { grid-area: slot1; }
.wp-img-text .wp-text-slot-2 { grid-area: slot2; }
.wp-img-text .wp-text-slot-3 { grid-area: slot3; }
.wp-img-text .wp-text-picture > div { position: relative; width: 210px; aspect-ratio: 210 / 170; }
.wp-img-text .wp-text-picture > div::after { content: ""; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 2px 2px 3px #1d2f4f55, inset -2px -2px 2px #ffffffbb; pointer-events: none; }
.wp-img-text .wp-text-picture img { display: block; width: 100% !important; height: 100% !important; border: 0 !important; border-radius: 8px; object-fit: fill; }
.wp-img-text .wp-text-slot { position: relative; }
.wp-img-text .wp-text-slot > div { position: relative; width: 100%; }
.wp-modern.wp-img-text .wp-text-choice {
  width: 100% !important; height: 104px !important; min-height: 104px;
  padding: 12px 20px; border: 2px dashed var(--wp-control-line); border-radius: 12px;
  background: transparent !important; color: var(--wp-accent);
  font: 600 1.5rem/1.4 "Segoe UI", Arial, sans-serif !important;
}
.wp-modern.wp-img-text .wp-text-choice:hover { border-style: solid; background: var(--wp-surface) !important; }
.wp-img-text .wp-text-slot table, .wp-img-text .wp-text-prompt table {
  width: 100% !important; height: 104px !important;
  border: 2px solid var(--wp-control-line) !important; border-radius: 12px;
  border-spacing: 0; table-layout: fixed; background: var(--wp-surface) !important;
}
.wp-img-text .wp-text-slot table td, .wp-img-text .wp-text-prompt table td { padding: 12px 20px; }
.wp-img-text .wp-text-slot table span, .wp-img-text .wp-text-prompt table span { color: var(--wp-ink); font: 600 1.65rem/1.4 "Segoe UI", Arial, sans-serif !important; overflow-wrap: break-word; }
.wp-modern.wp-img-text .wp-text-undo { position: absolute; left: calc(100% + 8px); top: 30px; width: 44px; height: 44px; padding: 8px; border: 1px solid var(--wp-control-line) !important; border-radius: 10px; background: var(--wp-surface); cursor: pointer; }
.wp-modern.wp-img-text .wp-text-undo:hover { background: #fff; }
.wp-img-text .wp-text-slot > img { display: none; }
.wp-img-text #UpdateProgress1 { position: absolute; top: calc(100% + 8px); left: 0; width: 100%; text-align: center; }
.wp-img-text .wp-text-board td.wp-text-prompt { grid-area: prompt; position: sticky; bottom: 12px; min-height: 104px; border-radius: 14px; background: var(--wp-bg); z-index: 2; }
.wp-img-text .wp-text-prompt > div { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 104px; }
.wp-img-text .wp-text-prompt table { border-color: var(--wp-accent) !important; box-shadow: 0 0 0 3px var(--wp-accent-soft); }
.wp-img-text .wp-feedback-icon { display: block; width: 64px; height: 64px; object-fit: contain; cursor: pointer; }
.wp-img-text #upnDoneCapture { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 1000px) {
  .wp-program-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wp-login-layout { gap: 36px; }
  .wp-abc-board > tbody { grid-template-columns: 64px 112px 64px minmax(180px, 1fr); gap: 18px 10px; }
  .wp-modern.wp-img-word .wp-match-undo { position: static; justify-self: center; }
}
@media (max-width: 700px) {
  .wp-modern .wp-main, .wp-modern .wp-master-main, .wp-modern .wp-abc-main, .wp-modern .wp-img-word-main { padding: 28px 20px 44px; }
  .wp-modern table[id$="tblPagehead"] span { font-size: clamp(1.1rem, 3.5vw, 1.65rem) !important; }
  .wp-modern table[id$="tblPagehead"] { width: calc(100% - 32px) !important; }
  .wp-modern table[id$="tblPagehead"] > tbody > tr { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; }
  .wp-modern table[id$="tblPagehead"] td { padding: 0; }
  .wp-modern table[id$="tblPagehead"] td:first-child,
  .wp-modern table[id$="tblPagehead"] td:last-child { width: auto !important; }
  .wp-modern table[id$="tblPagehead"] td:nth-child(2) { order: 3; flex-basis: 100%; padding-left: 0; }
  .wp-modern img[id$="imgSundMed"] { height: 38px; }
  .wp-modern table[id$="tblPageMenu"] > tbody > tr { display: flex; flex-wrap: wrap; gap: 8px; }
  .wp-modern table[id$="tblPageMenu"] > tbody > tr > td { width: 100%; text-align: left; padding: 0; }
  .wp-modern [id$="lblUserName"] { display: inline-block; max-width: 65vw; overflow-wrap: anywhere; }
  .wp-login-layout { grid-template-columns: 1fr; gap: 28px; padding: 0; }
  .wp-login-copy { max-width: none; }
  .wp-login-card { padding: 26px; }
  .wp-exercise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .wp-abc-board > tbody { grid-template-columns: 64px 112px 64px; grid-template-areas: "sound letter ." "hand answer feedback" "audio input input" "picture picture picture" "alphabet alphabet alphabet" "progress progress progress"; gap: 18px 8px; }
  .wp-abc-board .wp-abc-picture { min-height: 100px; }
  .wp-abc-alphabet table > tbody { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .wp-abc-alphabet table tr { display: contents; }
  .wp-abc-alphabet td { width: auto !important; font-size: 2rem; padding: 4px 2px; }
  .wp-img-word .wp-match-board > tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "picture1 picture2" "slot1 slot2" ". ." "picture3 picture4" "slot3 slot4" ". ." "picture5 picture6" "slot5 slot6" "prompt prompt" "wait wait";
    grid-template-rows: auto auto 8px auto auto 8px auto auto auto auto;
    gap: 10px 16px;
  }
  .wp-img-word .wp-match-picture { padding: 8px !important; }
  .wp-img-word .wp-match-slot > div { gap: 4px; width: calc(100% - 16px); }
  .wp-modern.wp-img-word .wp-match-choice { height: 56px !important; min-height: 56px; }
  .wp-img-word .wp-match-slot table { height: 56px !important; }
  .wp-img-word .wp-match-slot table span { font-size: 1.5rem !important; }
  .wp-modern.wp-img-word .wp-match-undo { justify-self: center; }
  .wp-img-word .wp-match-board td.wp-match-prompt { bottom: 8px; width: min(210px, calc((100% - 16px) / 2 - 16px)) !important; }
  .wp-img-word .wp-match-prompt table span { font-size: 1.5rem !important; }
}
@media (max-width: 420px) {
  .wp-program-grid { grid-template-columns: 1fr; }
  .wp-exercise-card h2 { font-size: 1rem; }
  .wp-program-card { padding: 24px; }
  .wp-modern .wp-abc-main, .wp-modern .wp-img-word-main { padding-left: 14px; padding-right: 14px; }
  .wp-modern .wp-abc-board { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .wp-modern input { transition: none; }
}

/* Pink exercise 3: keep the existing keyboard and level controls. */
.wp-modern .wp-spell-main { width: 100%; max-width: 960px; margin: 0 auto !important; padding: 28px 32px 48px; text-align: left; }
.wp-spell .wp-spell-legacy-break { display: none; }
.wp-spell .wp-spell-board { border: 0; border-spacing: 0; }
.wp-spell .wp-spell-board > tbody {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "levels levels levels" "picture picture picture" "answer answer answer" "choice1 choice2 choice3" "shortcut1 shortcut2 shortcut3" "wait wait wait";
  gap: 14px 24px;
  max-width: 720px;
  margin: 0 auto;
}
.wp-spell .wp-spell-level-1 .wp-spell-board > tbody { grid-template-rows: auto auto minmax(66px, auto) 62px 28px 20px; }
.wp-spell .wp-spell-level-1, .wp-spell .wp-spell-level-2 { --wp-spell-answer-width: 210px; }
.wp-spell .wp-spell-board > tbody > tr { display: contents; height: auto !important; }
.wp-spell .wp-spell-board > tbody > tr > td { display: none; width: auto !important; min-width: 0; padding: 0; }
.wp-spell .wp-spell-board td.wp-spell-levels { grid-area: levels; display: flex; justify-content: center; gap: 12px; margin-bottom: 12px; }
.wp-spell .wp-spell-levels br { display: none; }
.wp-spell .wp-spell-level {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 66px; width: 172px; padding: 7px 16px;
  border: 2px solid var(--wp-control-line); border-radius: 14px;
  background: var(--wp-surface); color: var(--wp-ink); cursor: pointer;
}
.wp-spell .wp-spell-level[data-level="1"] { order: 1; }
.wp-spell .wp-spell-level[data-level="2"] { order: 2; }
.wp-spell .wp-spell-level[data-level="3"] { order: 3; }
.wp-spell .wp-spell-level input { width: 48px; height: 48px; object-fit: contain; padding: 0; border: 0; background: transparent; cursor: pointer; }
.wp-spell .wp-spell-level-label { font-size: 1rem; font-weight: 650; white-space: nowrap; }
.wp-spell .wp-spell-level:has(input[aria-pressed="true"]) { border-color: var(--wp-accent); background: var(--wp-selected); box-shadow: 0 2px 0 var(--wp-accent-shadow); }
.wp-spell .wp-spell-level:hover { border-color: var(--wp-accent); }
.wp-spell .wp-spell-level:focus-within { outline: 3px solid #c56804; outline-offset: 3px; }
.wp-spell .wp-spell-level input:focus-visible { outline: none; }
.wp-spell .wp-spell-level:not(:has(input)),
.wp-spell .wp-spell-board td.wp-spell-levels:not(:has(input)) { display: none; }
.wp-spell .wp-spell-board td.wp-spell-picture { grid-area: picture; display: flex; justify-content: center; }
.wp-spell .wp-spell-picture > div { position: relative; width: 210px; max-width: 100%; aspect-ratio: 210 / 170; }
.wp-spell .wp-spell-picture > div::after { content: ""; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 2px 2px 3px #1d2f4f55, inset -2px -2px 2px #ffffffbb; pointer-events: none; }
.wp-spell .wp-spell-picture img { display: block; width: 100% !important; height: 100% !important; border: 0 !important; border-radius: 8px; object-fit: fill; }
.wp-spell .wp-spell-board td.wp-spell-answer { grid-area: answer; position: relative; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.wp-spell .wp-write-cue { position: absolute; left: calc(50% - var(--wp-spell-answer-width, 300px) / 2 - 64px); top: 50%; transform: translateY(-50%); display: block; width: 48px; height: 48px; }
.wp-spell .wp-spell-answer > div { max-width: 100%; }
.wp-spell .wp-spell-answer table { width: var(--wp-spell-answer-width, 300px) !important; max-width: 100%; height: 66px !important; border: 2px solid var(--wp-control-line) !important; border-radius: 12px; background: var(--wp-surface) !important; border-spacing: 0; }
.wp-spell .wp-spell-answer table span { font-size: 2.25rem !important; color: var(--wp-ink); }
.wp-spell .wp-spell-level-1 .wp-spell-answer table:has(#txcCard0_lblText:empty) { border-style: dashed !important; background: transparent !important; }
.wp-spell .wp-spell-level-2 .wp-spell-answer td:has(#txcCard0_lblText:empty)::after { content: ""; display: inline-block; height: 32px; border-left: 2px solid var(--wp-accent); vertical-align: middle; }
.wp-modern.wp-spell #txtInput { width: var(--wp-spell-answer-width, 300px) !important; max-width: 100%; height: 66px !important; padding: 8px 12px; border: 2px solid var(--wp-control-line); border-radius: 12px; background: var(--wp-surface); font-size: 2.25rem !important; text-align: center; }
.wp-spell .wp-spell-board td.wp-spell-input-ok:has(input) { grid-area: answer; display: flex; align-items: flex-end; padding-bottom: 9px; justify-self: center; transform: translateX(calc(var(--wp-spell-answer-width, 300px) / 2 + 32px)); }
.wp-spell #imbInputOK { width: 48px; height: 48px; }
.wp-spell .wp-spell-board td.wp-spell-feedback:has(#imbDone) { grid-area: answer; display: flex; align-self: center; justify-self: center; justify-content: center; width: 64px !important; transform: translateX(calc(var(--wp-spell-answer-width, 300px) / 2 + 40px)); }
.wp-spell #upnDone { display: flex; justify-content: center; width: 100%; }
.wp-spell .wp-spell-feedback > img { display: none; }
.wp-spell #imbDone { display: block; width: 64px; height: 64px; object-fit: contain; cursor: pointer; }
.wp-spell #imgPencil, .wp-spell .wp-spell-shortcut img { display: none; }
.wp-spell .wp-spell-choice-1 { grid-area: choice1; }
.wp-spell .wp-spell-choice-2 { grid-area: choice2; }
.wp-spell .wp-spell-choice-3 { grid-area: choice3; }
.wp-spell .wp-spell-board td.wp-spell-choice:has(input, table) { display: flex; justify-content: center; margin-top: 6px; }
.wp-spell .wp-spell-choice > div { width: 100%; max-width: 210px; }
.wp-modern.wp-spell .wp-spell-word-choice, .wp-spell .wp-spell-choice table {
  width: 100% !important; height: 62px !important; min-height: 62px;
  padding: 6px 8px; border: 2px solid var(--wp-control-line) !important; border-radius: 12px;
  background: var(--wp-surface) !important; color: var(--wp-ink); font: 700 2rem/1.2 "Segoe UI", Arial, sans-serif;
}
.wp-modern.wp-spell .wp-spell-word-choice { cursor: pointer; box-shadow: 0 3px 0 var(--wp-card-shadow); }
.wp-modern.wp-spell .wp-spell-word-choice:hover { background: #fff !important; border-color: var(--wp-accent) !important; }
.wp-modern.wp-spell .wp-spell-word-choice:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wp-card-shadow); }
.wp-spell .wp-spell-choice table { border-color: var(--wp-control-line-soft) !important; background: #fffefa99 !important; border-spacing: 0; }
.wp-spell .wp-spell-choice table span { color: var(--wp-ink); font-size: 2rem !important; }
.wp-spell .wp-spell-shortcut-1 { grid-area: shortcut1; }
.wp-spell .wp-spell-shortcut-2 { grid-area: shortcut2; }
.wp-spell .wp-spell-shortcut-3 { grid-area: shortcut3; }
.wp-spell .wp-spell-board td.wp-spell-shortcut { display: flex; justify-content: center; margin-top: -6px; }
.wp-spell .wp-spell-shortcut table { width: 28px !important; height: 28px !important; border: 1px solid var(--wp-control-line) !important; border-radius: 6px; border-spacing: 0; }
.wp-spell .wp-spell-shortcut table span { font-size: .9rem !important; color: var(--wp-muted); font-weight: 500 !important; }
.wp-spell .wp-spell-board td.wp-spell-wait { grid-area: wait; display: block; min-height: 20px; text-align: center; }
.wp-spell #upnDoneCapture { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Blue exercises 7–9 share Stava's controls with two related word cards. */
.wp-com-syn-opp #pnlPractice { --wp-spell-answer-width: 300px; --wp-com-expression-width: 590px; }
.wp-com-syn-opp .wp-spell-board td.wp-spell-picture:not(:has(img)) { display: none; }
.wp-com-syn-opp .wp-com-compound .wp-spell-board td.wp-spell-picture { display: flex; min-height: 170px; }
.wp-com-syn-opp .wp-spell-picture > div:not(:has(img))::after { display: none; }
.wp-com-syn-opp .wp-spell-board td.wp-com-expression { grid-area: answer; display: flex; justify-content: center; align-items: center; }
.wp-com-syn-opp .wp-com-cards { display: flex; justify-content: center; border-spacing: 0; }
.wp-com-syn-opp .wp-com-cards > tbody, .wp-com-syn-opp .wp-com-cards > tbody > tr { display: contents; }
.wp-com-syn-opp .wp-com-cards > tbody > tr > td { display: none; width: auto !important; padding: 0; }
.wp-com-syn-opp .wp-com-cards td.wp-com-prompt:has(table),
.wp-com-syn-opp .wp-com-cards td.wp-com-sign:has(span, table),
.wp-com-syn-opp .wp-com-cards td.wp-com-answer:has(table, input[type="text"]) { display: flex; align-items: center; justify-content: center; position: relative; }
.wp-com-syn-opp .wp-com-cards td.wp-com-sign:has(span) { width: 90px !important; }
.wp-com-syn-opp #lblSign { font: 700 2rem/1.2 "Segoe UI", Arial, sans-serif !important; color: var(--wp-accent) !important; }
.wp-com-syn-opp .wp-com-cards table, .wp-modern.wp-com-syn-opp #txtInput { width: 250px !important; height: 66px !important; border: 2px solid var(--wp-control-line) !important; border-radius: 12px; background: var(--wp-surface) !important; border-spacing: 0; text-align: center; }
.wp-com-syn-opp .wp-com-cards table td { padding: 6px 12px; text-align: center; }
.wp-com-syn-opp .wp-com-cards table span { font: 700 2rem/1.3 "Segoe UI", Arial, sans-serif !important; color: var(--wp-ink); }
.wp-com-syn-opp #txcCard5_tblFrame { width: 590px !important; }
.wp-com-syn-opp .wp-spell-board td.wp-spell-feedback:has(#imbDone) { transform: translateX(calc(var(--wp-com-expression-width) / 2 + 40px)); }
.wp-com-syn-opp .wp-spell-level-1 #txcCard4_tblFrame:has(#txcCard4_lblText:empty) { border-style: dashed !important; background: transparent !important; }
.wp-com-syn-opp .wp-spell-level-2 #txcCard4_tbcContent:has(#txcCard4_lblText:empty)::after { content: ""; display: inline-block; height: 32px; border-left: 2px solid var(--wp-accent); vertical-align: middle; }
.wp-com-syn-opp .wp-write-cue { width: 48px; height: 48px; left: calc(100% + 16px); }
.wp-com-syn-opp .wp-com-cards td.wp-com-input-ok:has(input) { display: flex; position: absolute; margin-left: 650px; }
.wp-com-syn-opp .wp-com-answer > div { display: flex; align-items: center; }
@media (max-width: 700px) {
  .wp-com-syn-opp .wp-com-cards table, .wp-modern.wp-com-syn-opp #txtInput { width: 200px !important; }
  .wp-com-syn-opp #txcCard5_tblFrame { width: 460px !important; }
  .wp-com-syn-opp .wp-com-cards td.wp-com-sign:has(span) { width: 60px !important; }
  .wp-com-syn-opp .wp-com-cards table span { font-size: 1.6rem !important; }
  .wp-com-syn-opp .wp-write-cue { width: 40px; height: 40px; left: calc(100% + 12px); }
  .wp-com-syn-opp #pnlPractice { --wp-spell-answer-width: 210px; --wp-com-expression-width: 460px; }
}
@media (max-width: 540px) {
  .wp-com-syn-opp .wp-com-cards { flex-wrap: wrap; gap: 12px; padding-right: 56px; }
  .wp-com-syn-opp .wp-com-cards td.wp-com-sign:has(span) { width: 32px !important; }
  .wp-com-syn-opp .wp-com-cards td.wp-com-answer { flex-basis: 100%; }
  .wp-com-syn-opp #txcCard5_tblFrame { width: 250px !important; }
  .wp-com-syn-opp .wp-com-cards td.wp-com-input-ok:has(input) { margin-left: 240px; bottom: 0; }
  .wp-com-syn-opp .wp-com-expression { position: relative; }
  .wp-com-syn-opp .wp-spell-board td.wp-spell-feedback:has(#imbDone) { align-self: end; transform: translateX(133px); }
}

/* Pink exercise 5 reuses Stava's levels, choices and stable feedback row. */
.wp-what-word #pnlPractice { --wp-spell-answer-width: 530px; }
.wp-what-word #upnCard0 { display: flex; flex-direction: column; align-items: center; width: 100%; }
.wp-what-word .wp-what-word-entry,
.wp-what-word .wp-what-word-entry > tbody,
.wp-what-word .wp-what-word-entry > tbody > tr:first-child,
.wp-what-word .wp-what-word-entry > tbody > tr:first-child > td { display: contents; }
.wp-what-word .wp-what-word-entry > tbody > tr:first-child > td:has(#imgHand),
.wp-what-word .wp-what-word-entry > tbody > tr:nth-child(2),
.wp-what-word #tbrInputMobile:not(:has(#txtInput)) { display: none; }
.wp-what-word #imgHand, .wp-what-word #imgHandM { display: none; }
.wp-what-word #txcCard0_tblFrame { height: 88px !important; table-layout: fixed; }
.wp-what-word #txcCard0_tbcContent { padding: 12px 20px; }
.wp-what-word #txcCard0_lblText { color: var(--wp-ink); font-size: 2rem !important; line-height: 1.5; overflow-wrap: break-word; }
.wp-what-word #tbrInputMobile:has(#txtInput) { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.wp-what-word #tbrInputMobile > td { width: auto !important; padding: 0; }
.wp-what-word #tbrInputMobile > td:has(#imgHandM) { display: none; }
.wp-modern.wp-what-word #txtInput { width: 250px !important; }

/* Pink exercise 6: rhyme prompt, writing area and optional picture clue. */
.wp-rhyme .wp-spell-board > tbody {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "prompt" "answer" "picture" "mistakes" "wait";
  grid-template-rows: 72px minmax(66px, auto) 170px 64px 20px;
  gap: 20px;
}
.wp-rhyme .wp-spell-board > tbody > tr > th { display: none; }
.wp-rhyme .wp-spell-board > tbody > tr > td { height: auto !important; }
.wp-rhyme .wp-spell-board td.wp-rhyme-prompt { grid-area: prompt; display: flex; align-items: center; justify-content: center; }
.wp-rhyme #txcCard1_tblFrame { width: auto !important; height: auto !important; border: 0 !important; background: transparent !important; }
.wp-rhyme #txcCard1_tbcContent { text-align: center; }
.wp-rhyme #txcCard1_lblText { color: var(--wp-ink); font: 700 2.5rem/1.3 "Segoe UI", Arial, sans-serif !important; }
.wp-rhyme #upnCard0 { display: flex; align-items: center; justify-content: center; }
.wp-rhyme #txcCard0_tbcContent { text-align: center; }
.wp-rhyme .wp-spell-picture > div:not(:has(img))::after { display: none; }
.wp-rhyme .wp-spell-board td.wp-rhyme-mistakes { grid-area: mistakes; display: flex; justify-content: center; align-items: center; }
.wp-rhyme #txcWrongChar_tblFrame { max-width: 100%; height: 56px !important; border-color: var(--wp-control-line) !important; border-radius: 12px; border-spacing: 0; background: transparent !important; }
.wp-rhyme #txcWrongChar_lblText { color: var(--wp-accent); font: 600 1.65rem/1.4 "Segoe UI", Arial, sans-serif !important; }
.wp-rhyme #txcWrongChar_tbcContent { text-align: center; padding: 8px 14px; }
.wp-rhyme #imbInputOK { margin-left: 8px; }

@media (max-width: 700px) {
  .wp-spell { --wp-spell-answer-width: 260px; }
  .wp-modern .wp-spell-main { padding: 24px 20px 40px; }
  .wp-spell .wp-spell-board > tbody { gap: 12px; }
  .wp-spell .wp-spell-board td.wp-spell-levels { gap: 8px; margin-bottom: 8px; }
  .wp-spell .wp-spell-level { flex: 1; width: auto; max-width: 160px; flex-direction: column; gap: 2px; padding: 6px; }
  .wp-spell .wp-spell-level input { width: 44px; height: 44px; }
  .wp-spell .wp-spell-level-label { font-size: .95rem; }
  .wp-spell .wp-spell-choice table span, .wp-modern.wp-spell .wp-spell-word-choice { font-size: 1.5rem !important; }
}
@media (max-width: 420px) {
  .wp-spell { --wp-spell-answer-width: 210px; }
  .wp-modern .wp-spell-main { padding-left: 14px; padding-right: 14px; }
  .wp-spell .wp-spell-board > tbody { column-gap: 8px; }
  .wp-spell .wp-spell-board > tbody { grid-template-areas: "levels levels levels" "picture picture picture" "answer answer answer" "choice1 choice1 choice1" "shortcut1 shortcut1 shortcut1" "choice2 choice2 choice2" "shortcut2 shortcut2 shortcut2" "choice3 choice3 choice3" "shortcut3 shortcut3 shortcut3" "wait wait wait"; }
  .wp-spell .wp-spell-level-1 .wp-spell-board > tbody { grid-template-rows: auto auto minmax(66px, auto) 62px 28px 62px 28px 62px 28px 20px; }
  .wp-spell .wp-spell-board td.wp-spell-answer, .wp-spell .wp-spell-board td.wp-spell-picture { padding-right: 56px; }
  .wp-spell .wp-spell-board td.wp-spell-feedback:has(#imbDone) { width: 48px !important; transform: translateX(109px); }
  .wp-spell #imbDone { width: 48px; height: 48px; }
  .wp-spell .wp-spell-board td.wp-spell-input-ok:has(input) { transform: translateX(109px); }
  .wp-spell .wp-spell-choice table span, .wp-modern.wp-spell .wp-spell-word-choice { font-size: 2rem !important; }
}

/* Green exercises share the existing boards; sound selection stays alongside them. */
.wp-modern .wp-exercise-sound { display: none; }
.wp-green-exercise .wp-spell-main { max-width: 1184px; }
.wp-green-exercise #pnlPractice { display: grid; grid-template-columns: minmax(0, 1fr) 152px; gap: 24px; align-items: start; }
.wp-green-exercise #pnlPractice > .wp-exercise-sound:has(table) { display: block; grid-column: 2; grid-row: 1; position: sticky; top: 24px; padding-top: 8px; }
.wp-green-exercise #pnlPractice > .wp-spell-board,
.wp-green-exercise #pnlPractice > .wp-text-board,
.wp-green-exercise #pnlPractice > .wp-match-board,
.wp-green-exercise #pnlPractice > .wp-loose-board,
.wp-green-exercise #pnlPractice > .wp-memory-board,
.wp-green-exercise #pnlPractice > .wp-stories-board,
.wp-green-exercise #pnlPractice > .wp-questions-board { grid-column: 1; grid-row: 1; min-width: 0; }
.wp-green-exercise #pnlSoundGrp { max-width: 900px; margin: 0 auto; }
.wp-green-exercise #pnlSoundGrp > table { border-spacing: 0; }
.wp-green-exercise #pnlSoundGrp > table > tbody > tr:first-child { display: none; }
@media (max-width: 1000px) {
  .wp-green-exercise #pnlPractice { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .wp-green-exercise #pnlPractice > .wp-exercise-sound:has(table) { grid-column: 1; position: static; padding-top: 0; width: 220px; justify-self: end; }
  .wp-green-exercise #pnlPractice > .wp-spell-board,
  .wp-green-exercise #pnlPractice > .wp-text-board,
  .wp-green-exercise #pnlPractice > .wp-match-board,
  .wp-green-exercise #pnlPractice > .wp-loose-board,
  .wp-green-exercise #pnlPractice > .wp-memory-board,
  .wp-green-exercise #pnlPractice > .wp-stories-board,
  .wp-green-exercise #pnlPractice > .wp-questions-board { grid-row: 2; }
}

/* Green B has two rows of two pictures; L keeps the shared six-picture board. */
.wp-img-word-four .wp-match-board > tbody {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "picture1 picture2" "slot1 slot2" ". ." "picture3 picture4" "slot3 slot4" "prompt prompt" "wait wait";
  grid-template-rows: auto auto 8px auto auto auto auto;
  max-width: 600px;
}
.wp-img-word-four .wp-match-board td.wp-match-prompt { width: 210px !important; max-width: 100%; }

/* Green A preserves the original letter positions and red sound-spelling clues. */
.wp-loose-char .wp-loose-levels { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 24px; }
.wp-loose-char .wp-loose-words { display: grid; gap: 24px; max-width: 720px; margin: 0 auto; }
.wp-loose-char .wp-loose-word { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: center; gap: 28px; }
.wp-loose-char .wp-loose-picture { position: relative; width: 210px; height: 170px; }
.wp-loose-char .wp-loose-picture:has(img)::after { content: ""; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 2px 2px 3px #1d2f4f55, inset -2px -2px 2px #ffffffbb; pointer-events: none; }
.wp-loose-char .wp-loose-picture img { display: block; width: 100% !important; height: 100% !important; border: 0 !important; border-radius: 8px; object-fit: fill; }
.wp-loose-char .wp-loose-answer { position: relative; justify-self: start; max-width: 100%; min-width: 210px; min-height: 72px; padding: 10px 18px; border: 2px solid var(--wp-control-line); border-radius: 12px; background: var(--wp-surface); }
.wp-loose-char .wp-loose-slots { display: flex; gap: 6px; align-items: center; justify-content: center; min-height: 48px; }
.wp-loose-char .wp-loose-slots > span { display: inline-block; min-width: 24px; text-align: center; font: 700 2.1rem/1.3 "Segoe UI", Arial, sans-serif; }
.wp-modern.wp-loose-char .wp-loose-undo { position: absolute; left: calc(100% + 10px); top: 13px; width: 44px; height: 44px; padding: 8px; border: 1px solid var(--wp-control-line); border-radius: 10px; background: var(--wp-surface); }
.wp-loose-char .wp-loose-feedback { min-height: 64px; margin: 12px 0; text-align: center; }
.wp-loose-char #imbDone { width: 64px; height: 64px; }
.wp-loose-char #imgPencil { display: inline-block; width: 48px; height: 48px; }
.wp-loose-char .wp-loose-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 680px; min-height: 54px; margin: 0 auto; }
.wp-loose-char .wp-loose-tile:not(:has(span, input)) { display: none; }
.wp-loose-char .wp-loose-tile > span,
.wp-modern.wp-loose-char .wp-loose-tile input { display: inline-flex; justify-content: center; align-items: center; min-width: 42px; min-height: 54px; padding: 4px 10px; border: 1px solid var(--wp-control-line); border-radius: 10px; background: var(--wp-surface); font: 700 1.9rem/1.3 "Segoe UI", Arial, sans-serif; }
.wp-loose-char .wp-loose-tile > span:empty { visibility: hidden; }
.wp-loose-char #UpdateProgress1 { display: block; min-height: 24px; margin-top: 12px; text-align: center; }
@media (max-width: 700px) {
  .wp-loose-char .wp-loose-word { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
  .wp-loose-char .wp-loose-answer { justify-self: center; }
  .wp-loose-char .wp-loose-slots > span { min-width: 18px; font-size: 1.8rem; }
  .wp-loose-char .wp-loose-levels { gap: 8px; }
}

/* Green memory, stories and yes/no retain their original game engines. */
.wp-green-remaining .wp-green-main { max-width: 1184px; }
.wp-green-remaining #tblImages { border-spacing: 0; }
.wp-green-remaining #tblImages > tbody { display: grid; justify-content: center; align-items: start; gap: 24px; }
.wp-green-remaining #tblImages > tbody > tr { display: contents; }
.wp-green-remaining #tblImages > tbody > tr > td { display: none; width: auto !important; height: auto; padding: 0; min-width: 0; }
.wp-green-remaining #tblImages > tbody > tr > td.wp-green-feedback { display: flex; align-items: center; justify-content: center; min-height: 64px; }
.wp-green-remaining #imbDone { width: 64px; height: 64px; object-fit: contain; cursor: pointer; }
.wp-green-remaining #upnDoneCapture { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wp-green-remaining .wp-green-picture-frame { width: 210px; height: 170px; position: relative; margin: auto; }
.wp-green-remaining .wp-green-picture-frame::after { content: ""; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 2px 2px 3px #1d2f4f55, inset -2px -2px 2px #ffffffbb; pointer-events: none; }
.wp-green-remaining .wp-green-picture-frame img { display: block; width: 100% !important; height: 100% !important; object-fit: fill; border: 0 !important; border-radius: 8px; }
.wp-memory #tblImages > tbody { grid-template-columns: repeat(3, 210px); grid-template-areas: "card1 card2 card3" "card4 feedback card5" "card6 card7 card8"; gap: 26px 28px; }
.wp-memory #tblImages td.wp-memory-card { display: block; position: relative; height: 170px; }
.wp-memory .wp-memory-card-1 { grid-area: card1; }
.wp-memory .wp-memory-card-2 { grid-area: card2; }
.wp-memory .wp-memory-card-3 { grid-area: card3; }
.wp-memory .wp-memory-card-4 { grid-area: card4; }
.wp-memory .wp-memory-card-5 { grid-area: card5; }
.wp-memory .wp-memory-card-6 { grid-area: card6; }
.wp-memory .wp-memory-card-7 { grid-area: card7; }
.wp-memory .wp-memory-card-8 { grid-area: card8; }
.wp-memory #tblImages td.wp-green-feedback { grid-area: feedback; align-self: center; }
.wp-memory #upnDone { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wp-memory #upnDone br { display: none; }
.wp-memory #lblClickCount { color: var(--wp-ink) !important; font-size: 1rem; }
.wp-memory .wp-memory-card input { display: block; width: 210px !important; height: 170px !important; border: 0 !important; border-radius: 12px; object-fit: fill; cursor: pointer; }
.wp-memory .wp-memory-card input[data-covered="true"] { border: 2px solid var(--wp-control-line) !important; box-shadow: 0 3px 0 var(--wp-card-shadow); }
.wp-memory .wp-memory-card:has(input:not([data-covered]))::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 2px 2px 3px #1d2f4f55, inset -2px -2px 2px #ffffffbb; pointer-events: none; }
.wp-memory .wp-memory-card input[data-covered="true"]:hover { border-color: var(--wp-accent) !important; }
.wp-memory .wp-memory-card table { width: 210px !important; height: 170px !important; border: 2px solid var(--wp-control-line) !important; border-radius: 12px; background: var(--wp-surface) !important; border-spacing: 0; }
.wp-memory .wp-memory-card table span { font: 700 1.7rem/1.25 "Segoe UI", Arial, sans-serif !important; color: var(--wp-ink); overflow-wrap: anywhere; }
.wp-stories #tblImages > tbody { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "tools tools tools" "picture picture picture" "story story story" "feedback feedback feedback" "choice1 choice2 choice3" "shortcut shortcut shortcut"; gap: 22px; }
.wp-stories #tblImages td.wp-story-tools { grid-area: tools; display: block; }
.wp-stories #tblFirstCell { width: 100% !important; border-spacing: 0; }
.wp-stories #tblFirstCell > tbody > tr { height: auto !important; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px; }
.wp-stories #tblFirstCell > tbody > tr > td { display: flex; align-items: center; gap: 12px; padding: 0; }
.wp-stories #tblFirstCell br { display: none; }
.wp-stories #tblWordSelect { width: 142px !important; height: 68px !important; background: var(--wp-surface) !important; border: 2px solid var(--wp-control-line) !important; border-radius: 12px; border-spacing: 0; }
.wp-stories #tblWordSelect td { padding: 0 5px; }
.wp-stories #tblWordSelect input { accent-color: var(--wp-accent); }
.wp-stories #tblWordSelect span { font-size: .95rem; }
.wp-stories #tblImages td.wp-green-picture { grid-area: picture; display: block; }
.wp-stories #tblImages > tbody > tr > td:has(> #upnCard0) { grid-area: story; display: block; }
.wp-stories #upnCard0 > table { width: 100%; border-spacing: 0; }
.wp-stories #upnCard0 > table > tbody > tr:first-child > td:not(.wp-green-reading) { display: none; }
.wp-stories #upnCard0 > table > tbody > tr:nth-child(2) { display: none; }
.wp-stories td.wp-green-reading { position: relative; padding: 0; }
.wp-stories #txcCard0_tblFrame, .wp-questions #txcCard0_tblFrame { width: 100% !important; height: auto !important; min-height: 96px; border: 2px solid var(--wp-control-line) !important; border-radius: 12px; background: var(--wp-surface) !important; border-spacing: 0; }
.wp-stories #txcCard0_tbcContent, .wp-questions #txcCard0_tbcContent { padding: 18px 24px; text-align: left; }
.wp-stories #txcCard0_lblText, .wp-questions #txcCard0_lblText { font: 500 1.8rem/1.7 "Segoe UI", Arial, sans-serif !important; color: var(--wp-ink); overflow-wrap: anywhere; }
.wp-stories .wp-story-picture-group { display: grid; grid-template-columns: 44px minmax(0, 210px) 44px; gap: 16px; justify-content: center; align-items: end; }
.wp-stories .wp-story-picture-group > .wp-green-picture-frame { grid-column: 2; grid-row: 1; width: 100%; height: auto; aspect-ratio: 210 / 170; margin: 0; }
.wp-stories.wp-spell #imgPencil.wp-story-pencil { display: block; position: static; grid-column: 1; grid-row: 1; width: 44px; height: 44px; transform: none; }
.wp-stories #tblImages td.wp-green-feedback { grid-area: feedback; }
.wp-stories #tblImages td.wp-story-choice { display: block; min-height: 62px; }
.wp-stories .wp-story-choice-1 { grid-area: choice1; }
.wp-stories .wp-story-choice-2 { grid-area: choice2; }
.wp-stories .wp-story-choice-3 { grid-area: choice3; }
.wp-stories .wp-story-choice input, .wp-stories .wp-story-choice table,
.wp-questions #btnCard1, .wp-questions #btnCard2, .wp-questions #txcYes_tblFrame, .wp-questions #txcNo_tblFrame { width: 100% !important; height: 62px !important; border: 2px solid var(--wp-control-line) !important; border-radius: 12px; background: var(--wp-surface) !important; color: var(--wp-ink); font: 700 1.8rem/1.2 "Segoe UI", Arial, sans-serif !important; padding: 6px 8px; border-spacing: 0; }
.wp-stories .wp-story-choice input, .wp-questions #btnCard1, .wp-questions #btnCard2 { box-shadow: 0 3px 0 var(--wp-card-shadow); }
.wp-stories .wp-story-choice input:hover, .wp-questions #btnCard1:hover, .wp-questions #btnCard2:hover { background: #fff !important; border-color: var(--wp-accent) !important; }
.wp-stories .wp-story-choice table span, .wp-questions #txcYes_tblFrame span, .wp-questions #txcNo_tblFrame span { font-size: 1.8rem !important; color: var(--wp-ink); }
.wp-stories #tblImages > tbody > #tbrBottomHands > td { display: block; text-align: center; }
.wp-stories #tbrBottomHands table { width: 28px !important; height: 28px !important; margin: -14px auto 0; border: 1px solid var(--wp-control-line) !important; border-radius: 6px; background: transparent !important; }
.wp-stories #tbrBottomHands table span { font-size: .9rem !important; color: var(--wp-muted); }
.wp-stories #tbrInputMobile > td:not(:last-child) { display: none; }
.wp-stories #txtInput { width: 100% !important; font-size: 1.8rem !important; }
.wp-stories #imbInputOK { width: 44px; height: 44px; }
.wp-questions #tblImages > tbody { max-width: 720px; margin: auto; grid-template-columns: 210px minmax(0, 1fr) 210px; grid-template-areas: ". picture ." "question question question" "yes feedback no" "results results results"; }
.wp-questions #tblImages td.wp-green-picture { grid-area: picture; display: block; }
.wp-questions #tblImages td.wp-green-reading { grid-area: question; display: block; }
.wp-questions #tblImages td.wp-question-yes { grid-area: yes; display: block; min-height: 62px; }
.wp-questions #tblImages td.wp-question-no { grid-area: no; display: block; min-height: 62px; }
.wp-questions #tblImages td.wp-green-feedback { grid-area: feedback; }
.wp-questions #tblImages td.wp-question-results { grid-area: results; display: block; }
.wp-questions #upnTries > table { margin: auto; }
.wp-questions #btnCard1, .wp-questions #txcYes_tblFrame span { color: #24745b !important; }
.wp-questions #btnCard2, .wp-questions #txcNo_tblFrame span { color: #b53450 !important; }
.wp-questions #txcCard0_tbcContent { text-align: center; }
@media (max-width: 760px) {
  .wp-memory #tblImages > tbody { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; }
  .wp-memory #tblImages td.wp-memory-card { height: auto; aspect-ratio: 210 / 170; }
  .wp-memory .wp-memory-card input, .wp-memory .wp-memory-card table { width: 100% !important; height: 100% !important; }
  .wp-memory .wp-memory-card table { aspect-ratio: 210 / 170; }
  .wp-memory .wp-memory-card table span { font-size: clamp(.9rem, 3.5vw, 1.7rem) !important; }
  .wp-stories #txcCard0_lblText, .wp-questions #txcCard0_lblText { font-size: 1.45rem !important; }
  .wp-questions #tblImages > tbody { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); gap: 16px; }
}

/* Keep the original numeric keyboard shortcuts visible. */
.wp-memory #tblImages { counter-reset: memory-card; }
.wp-memory .wp-memory-card { counter-increment: memory-card; }
.wp-memory .wp-memory-card::before,
.wp-questions #tblImages td.wp-question-yes:has(#btnCard1)::after,
.wp-questions #tblImages td.wp-question-no:has(#btnCard2)::after { display: block; width: 28px; height: 24px; border: 1px solid var(--wp-control-line); border-radius: 6px; color: var(--wp-muted); text-align: center; font: 500 .9rem/22px "Segoe UI", Arial, sans-serif; }
.wp-memory .wp-memory-card::before { content: counter(memory-card); position: absolute; top: calc(100% + 3px); left: calc(50% - 14px); }
.wp-questions #tblImages td.wp-question-yes:has(#btnCard1)::after { content: "1"; margin: 8px auto 0; }
.wp-questions #tblImages td.wp-question-no:has(#btnCard2)::after { content: "2"; margin: 8px auto 0; }

/* English Green Program: categories are chosen on the menu, with the original photos. */
.wp-green-english-menu .wp-main { max-width: 1240px; }
.wp-green-english-menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 32px; align-items: start; }
.wp-green-english-menu-layout > .wp-exercise-grid { width: 100%; }
.wp-category-summary { position: sticky; top: 24px; padding-top: 48px; }
.wp-green-english .wp-category-summary-card { width: 100% !important; height: auto !important; padding: 16px; border: 2px solid var(--wp-control-line) !important; border-radius: 16px; border-spacing: 0; background: var(--wp-surface) !important; }
.wp-green-english .wp-category-summary-card > tbody > tr { display: flex; flex-direction: column; gap: 16px; }
.wp-green-english .wp-category-summary-card > tbody > tr > td { display: block; width: 100%; padding: 0; }
.wp-green-english .wp-category-summary-card input { width: 100%; background: var(--wp-accent); border-color: var(--wp-accent); }
.wp-green-english .wp-category-summary-card table { width: 100%; border-spacing: 5px; table-layout: fixed; }
.wp-green-english .wp-category-summary-card table td { padding: 0; }
.wp-green-english .wp-category-summary-card img { display: block; width: 100% !important; height: auto !important; aspect-ratio: 210 / 170; object-fit: contain; border: 1px solid var(--wp-control-line-soft) !important; border-radius: 6px; background: #fff; }
.wp-green-english .wp-category-summary-card img[role="button"] { cursor: pointer; }
.wp-green-english .wp-category-picker { width: min(820px, 100%) !important; margin: 0 auto; padding: 26px; border: 2px solid var(--wp-control-line) !important; border-radius: 18px; background: var(--wp-surface) !important; border-spacing: 0; }
.wp-green-english .wp-category-picker > tbody { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wp-green-english .wp-category-picker > tbody > tr { display: contents; }
.wp-green-english .wp-category-picker > tbody > tr > td { width: auto !important; padding: 0; }
.wp-green-english .wp-category-heading { grid-column: 1 / -1; margin-bottom: 4px; }
.wp-green-english .wp-category-heading span { font: 650 1.25rem/1.5 "Segoe UI", Arial, sans-serif !important; }
.wp-green-english .wp-category-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px !important; border: 1px solid var(--wp-control-line-soft); border-radius: 12px; }
.wp-green-english .wp-category-choice:has(input:checked) { background: var(--wp-selected); border-color: var(--wp-accent); }
.wp-green-english .wp-category-choice:focus-within { outline: 3px solid #c56804; outline-offset: 2px; }
.wp-green-english .wp-category-choice img { position: relative; width: 168px !important; max-width: 100%; height: 136px !important; object-fit: contain; border: 0 !important; border-radius: 8px; }
.wp-green-english .wp-category-choice img[role="button"] { z-index: 1; cursor: pointer; }
.wp-green-english .wp-category-choice span:has(input) { display: flex; align-items: center; gap: 8px; }
.wp-green-english .wp-category-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--wp-accent); }
.wp-green-english .wp-category-choice label { font: 600 1.05rem/1.4 "Segoe UI", Arial, sans-serif; cursor: pointer; }
.wp-green-english .wp-category-choice label::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.wp-green-english .wp-category-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.wp-green-english .wp-category-actions input { width: auto !important; min-width: 100px; background: var(--wp-accent); border-color: var(--wp-accent); }
.wp-green-english .wp-category-actions :is(input[id$="btnSelectAll"],input[id$="btnDeselectAll"],input[id$="btnCancel"]) { background: transparent; color: var(--wp-accent); border-color: var(--wp-control-line); }
.wp-green-english #SetCategory1_lblMessage { display: block; width: auto !important; max-width: 820px; margin: 16px auto; color: #a5283b; text-align: center; }
.wp-green-english.wp-green-exercise #pnlPractice { grid-template-columns: minmax(0, 1fr); }
.wp-green-english.wp-green-exercise .wp-exercise-sound { display: none !important; }
.wp-green-english.wp-green-exercise #pnlPractice > table { grid-column: 1; grid-row: 1; }
.wp-green-english.wp-green-exercise #tblImages :is(img,input[type="image"]) { object-fit: contain; }
@media (max-width: 900px) {
  .wp-green-english-menu-layout { grid-template-columns: minmax(0, 1fr); }
  .wp-category-summary { position: static; padding-top: 0; width: min(440px, 100%); justify-self: center; }
}
@media (max-width: 600px) {
  .wp-green-english .wp-category-picker { padding: 18px; }
  .wp-green-english .wp-category-picker > tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .wp-green-english .wp-category-choice { padding: 8px !important; }
  .wp-green-english .wp-category-choice img { height: 112px !important; }
  .wp-green-english .wp-category-actions { justify-content: center; }
}
