/* Joined by the server from the files named below, in page order (static-delivery.mjs). */

/* Source: css/site.css */
/* Compact library and template picker. These styles are independent of game themes. */
button, input, select, textarea { font: inherit; }
/* The round font in two parts (5.266.0). Its Latin letters, figures and punctuation (assets/fonts/Nunito-Variable-latin.woff2,
   40 KB, made with fontTools from the whole font for the first range below) are all most pages need; the whole font
   (101 KB) is fetched only for a page that shows one of its other characters (the second range: every other character
   it has, such as Vietnamese, Cyrillic or Polish letters). Latin text draws pixel for pixel as with the whole font. */
@font-face { font-family: "ClassPlay Round"; src: url("../assets/fonts/Nunito-Variable-latin.woff2") format("woff2"); font-style: normal; font-weight: 200 1000; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "ClassPlay Round"; src: url("../assets/fonts/Nunito-Variable.woff2") format("woff2"); font-style: normal; font-weight: 200 1000; font-display: swap; unicode-range: U+0100-0130, U+0132, U+0134-0151, U+0154-017E, U+0181, U+018A, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01B3-01B4, U+01C4-01CE, U+01D4, U+01E5-01E7, U+01E9-01EB, U+01EF, U+01FA-021B, U+021F, U+0226-0228, U+022A-022D, U+0230-0233, U+0237, U+0253, U+0257, U+0259, U+0292, U+02B9-02BA, U+02BE-02BF, U+02C7-02CC, U+02D8-02D9, U+02DB, U+02DD, U+0300-0303, U+0306-0307, U+0309-030C, U+030F, U+0311-0312, U+031B, U+0323-0324, U+0326-0328, U+032E, U+0331, U+0335, U+0337-0338, U+0394, U+03A3, U+03A9, U+03BC, U+03C0, U+0400-045F, U+0462-0463, U+046A-046B, U+0472-0475, U+048A-04A5, U+04A8-04FF, U+0510-0513, U+051A-051D, U+0524-0529, U+052E-052F, U+1E08-1E09, U+1E0C-1E0F, U+1E14-1E17, U+1E1C-1E1D, U+1E20-1E21, U+1E24-1E25, U+1E2A-1E2B, U+1E2E-1E2F, U+1E36-1E37, U+1E3A-1E3B, U+1E42-1E49, U+1E4C-1E53, U+1E5A-1E5B, U+1E5E-1E69, U+1E6C-1E6F, U+1E78-1E7B, U+1E80-1E85, U+1E8E-1E8F, U+1E92-1E93, U+1E97, U+1E9E, U+1EA0-1EF9, U+2070, U+2074-2079, U+2080-2089, U+20A1, U+20A3-20A4, U+20A6-20A7, U+20A9, U+20AB, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BC-20BD, U+2113, U+2116, U+2126, U+212E, U+2202, U+2205-2206, U+220F, U+2211, U+2219-221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+27E8-27E9, U+F8FF, U+FB01-FB02; }
@font-face { font-family: "ClassPlay Display"; src: url("../assets/fonts/Baloo2-Variable.woff2") format("woff2"); font-style: normal; font-weight: 400 800; font-display: swap; }
body.site-page { margin: 0; background: linear-gradient(#cce6f3, #e8f5fb 450px); color: #222; font-family: Arial, "Microsoft YaHei", sans-serif; font-size: 14px; font-weight: 400; }
.site-header { background: #fff; border-bottom: 1px solid #dae8ef; }
.site-header-inner { min-height: 50px; display: flex; align-items: center; gap: 22px; padding: 0 30px; max-width: 1600px; margin: auto; }
.site-brand { display: inline-flex; align-items: center; gap: 5px; color: #222; font-size: 24px; font-weight: 700; letter-spacing: -1.1px; line-height: 1; white-space: nowrap; }
.site-brand { font-family: "ClassPlay Round", Arial, sans-serif; font-weight: 900; }
.iq-activity-svg text { font-family: "ClassPlay Round", Nunito, Arial, sans-serif; }
.site-logo { display: grid; grid-template-columns: 9px 9px; grid-template-rows: 9px 9px; gap: 2px; margin-right: 1px; }
.site-logo i { display: block; width: 9px; height: 9px; background: #33a4e4; }
.site-logo i:nth-child(2) { opacity: .58; }.site-logo i:nth-child(3) { opacity: .72; }
.site-nav { display: flex; align-items: center; gap: 25px; margin-left: auto; align-self: stretch; }
.site-nav a { display: flex; align-items: center; border-bottom: 2px solid transparent; font-size: 13px; color: #222; padding: 0 2px; }
.site-nav a:hover, .site-nav a[aria-current] { border-bottom-color: #39a4e5; color: #1573ad; }
/* Tool navigation uses the same soft sage pill as every other teacher page. */
.site-page:is(.tools-page, .tracing-page) .site-header .site-nav a[aria-current="page"] { color: #155f69; border-bottom: 0; background: #e6efe9; box-shadow: none; }
.site-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #bbb; background: linear-gradient(#fff, #f6f6f6); color: #222; font: inherit; font-size: 13px; font-weight: 400; padding: 7px 12px; border-radius: 0; min-height: 34px; line-height: 1.25; cursor: pointer; white-space: nowrap; }
.site-button:hover { background: #eef6fc; border-color: #7cb9dd; }
.site-button.primary { color: #fff; background: #39a5e8; border-color: #339add; font-weight: 600; }
.site-button.primary:hover { background: #268ecb; }
.site-create { min-height: 32px; font-size: 13px; padding: 6px 13px; }
.site-main { width: calc(100% - 72px); max-width: 1280px; min-height: calc(100vh - 136px); margin: 24px auto 0; background: #fff; box-shadow: 0 1px 5px rgba(70,95,110,.08); }
.site-page .site-input, .site-page .site-select { font-family: inherit; font-size: 13px; font-weight: 400; color: #333; height: 35px; min-width: 0; border: 1px solid #c6c6c6; border-radius: 0; background: #fff; outline: none; padding: 7px 10px; box-shadow: none; }
.site-page .site-input:focus, .site-page .site-select:focus { border-color: #40a6e0; box-shadow: 0 0 0 1px #40a6e0; }
.site-input::placeholder { color: #aaa; }
.site-input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.site-page button:focus-visible, .site-page a:focus-visible { outline: 2px solid #267fb6; outline-offset: 3px; }
.picker-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 25px; border-bottom: 1px solid #e4e4e4; padding: 27px 32px 24px; }
.picker-steps { display: flex; align-items: center; gap: 16px; font-size: 20px; color: #898989; line-height: 1.2; white-space: nowrap; }
.picker-steps h1 { font-size: 20px; font-weight: 400; color: #111; line-height: inherit; margin: 0; letter-spacing: 0; }
.step-chevron { color: #8e8e8e; font-size: 30px; font-weight: 300; line-height: .6; }
.compact-search { position: relative; flex: 0 1 250px; }
.compact-search .site-input { width: 100%; padding-right: 34px; text-overflow: ellipsis; }
.compact-search > span { display: grid; place-items: center; position: absolute; right: 10px; top: 0; height: 35px; color: #444; pointer-events: none; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; padding: 26px 32px 40px; }
.template-card { display: flex; min-width: 0; min-height: 122px; border: 1px solid #d7d7d7; background: #fff; color: #111; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: background .15s, border-color .15s; overflow: hidden; }
.template-card:hover { border-color: #72bce9; background: #f3faff; }
.template-thumb { flex: 0 0 120px; width: 120px; min-height: 120px; align-self: stretch; display: grid; place-items: center; background: #f5f2e9; }
.template-thumb > .iq-template-svg { width: 120px; height: 120px; }
.iq-template-svg { display: block; width: 100%; height: 100%; }
.template-card .template-copy { display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; min-width: 0; padding: 18px 14px 16px 18px; }
.template-copy h2 { font-size: 16px; font-weight: 400; line-height: 1.15; margin: 0; }
.template-copy p { margin: 0; font-size: 13px; font-weight: 400; line-height: 1.35; color: #696969; }
.site-empty { grid-column: 1 / -1; padding: 50px 20px; text-align: center; color: #777; }
.site-empty h2 { font-weight: 400; color: #333; font-size: 20px; }
.site-empty p { font-size: 14px; }
.library-heading { display: flex; align-items: center; gap: 22px; min-height: 75px; padding: 19px 27px; border-bottom: 4px solid #d4e8f2; }
.library-heading h1 { font-size: 25px; font-weight: 600; letter-spacing: 0; margin: 0 auto 0 0; line-height: 1.25; }
.library-title { margin-right: auto; min-width: 0; }
.library-title h1 { overflow-wrap: anywhere; }
.library-tools { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.library-view-controls { display: flex; gap: 3px; }
.library-view-controls .site-button { width: 34px; padding: 0; color: #7895a6; }
.library-view-controls .site-button[aria-pressed=true] { color: #258fc9; border-color: #83b9da; background: #eaf6fc; }
.library-search { position: relative; width: 240px; }
.library-search .site-input { width: 100%; padding-right: 37px; }
.library-search > span { display: grid; place-items: center; position: absolute; right: 0; top: 0; width: 35px; height: 35px; border-left: 1px solid #c6c6c6; font-size: 24px; color: #333; pointer-events: none; }
.library-order-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 50px; padding: 12px 27px 7px; color: #555; font-size: 12px; }
.library-sort-options { display: flex; align-items: center; gap: 17px; }
.library-sort-options button { font: inherit; font-size: 12px; font-weight: 400; padding: 2px 0; border: none; background: none; color: #666; }
.library-sort-options button[aria-pressed=true] { color: #111; }
.library-sort-options button[aria-pressed=true]::after { content: " ▴"; }
.library-order-row .site-select { height: 29px; padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.library-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 19px 15px; padding: 16px 27px 40px; align-content: start; }
.library-card { position: relative; min-width: 0; border: 1px solid #ccc; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.library-card:hover { border-color: #79bde5; }
.activity-thumb { display: block; width: 100%; aspect-ratio: 4/3; background: #d4eaf7; overflow: hidden; }
.activity-thumb svg, .activity-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.activity-details { padding: 8px 9px 28px; min-height: 81px; }
.activity-details h2 { margin: 0 0 5px; font-size: 15px; font-weight: 400; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-details h2 a { color: #111; }
.activity-details h2 a:hover { color: #197cba; }
.activity-template-name { margin: 0; font-size: 11px; color: #888; line-height: 1.25; }
.activity-meta { position: absolute; bottom: 7px; left: 9px; right: 40px; margin: 0; font-size: 10px; font-weight: 400; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-menu { position: absolute; right: 3px; bottom: 4px; }
.activity-menu > summary { list-style: none; display: grid; place-items: center; width: 32px; height: 28px; border-left: 1px solid #eee; color: #555; cursor: pointer; font-size: 21px; line-height: 1; }
.activity-menu > summary::-webkit-details-marker { display: none; }
.activity-menu[open] > summary { color: #1887c8; background: #eef8ff; }
.activity-actions { position: absolute; z-index: 15; right: 0; top: 32px; width: 150px; display: flex; flex-direction: column; background: #fff; padding: 4px 0; border: 1px solid #bbb; box-shadow: 0 3px 12px rgba(0,0,0,.14); }
.activity-action { display: block; text-align: left; width: 100%; border: 0; background: #fff; font: inherit; font-size: 13px; font-weight: 400; color: #333; padding: 9px 14px; cursor: pointer; }
.activity-action:hover { color: #147bb9; background: #edf8ff; }
.activity-action.delete-action { color: #a04e49; border-top: 1px solid #eee; }
.folder-card { position: relative; align-self: start; min-height: 112px; margin-top: 8px; padding: 21px 18px 32px; border-radius: 0 4px 4px 4px; background: #8cc7e9; border-top: 7px solid #6dafd5; color: #111; box-shadow: inset 6px 0 #67afd8; }
.folder-card::before { content: ""; position: absolute; width: 38%; height: 9px; left: 0; top: -15px; border-radius: 6px 8px 0 0; background: #6dafd5; }
.folder-card h2 { font-size: 15px; font-weight: 400; margin: 0 0 7px; line-height: 1.2; overflow-wrap: anywhere; }
.folder-card p { margin: 0; font-size: 11px; color: #557c93; }
.folder-card .activity-menu > summary { border-left: 1px solid rgba(43,104,141,.2); }
.folder-open::after { content: ""; position: absolute; inset: 0; }
.folder-card .activity-menu { z-index: 3; }
.library-breadcrumb { color: #777; font-size: 12px; margin: 0 0 7px; }
.library-breadcrumb a { color: #333; }.library-breadcrumb span { padding: 0 10px; }
.folder-up { display: grid; place-items: center; min-height: 112px; padding: 14px; font-size: 35px; width: 145px; color: #579bbb; border: 0; font-weight: 400; }
.library-notice { padding: 16px 27px 0; font-size: 12px; color: #888; }
.library-notice a { color: #1789cb; }
.site-dialog { width: min(460px, calc(100vw - 32px)); border: 1px solid #bbb; background: #fff; color: #333; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.site-dialog::backdrop { background: rgba(30,55,75,.4); }
.site-dialog h2 { font-size: 21px; font-weight: 400; margin: 0 0 22px; }
.site-dialog label { display: block; color: #555; font-size: 13px; margin-bottom: 8px; }
.site-dialog .site-input, .site-dialog .site-select { width: 100%; }
.site-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.site-page .toast-msg { bottom: 25px; font-family: Arial, sans-serif; }
.library-list[data-view=list] { grid-template-columns: minmax(0, 1fr); }
.library-list[data-view=list] .library-card { display: grid; grid-template-columns: 128px minmax(0, 1fr); max-width: none; }
.library-list[data-view=list] .activity-thumb { height: 96px; }
.library-list[data-view=list] .activity-details { padding: 17px 50px 27px 20px; min-height: 96px; }
.library-list[data-view=list] .activity-meta { left: 148px; bottom: 14px; }
.library-list[data-view=list] .folder-card { max-width: none; min-height: 90px; }
.site-footer { max-width: 1280px; margin: 0 auto; padding: 17px 0 24px; color: #7490a2; font-size: 10px; text-align: center; line-height: 1.5; }
.site-footer p { margin: 3px 0; }
@media (max-width: 1100px) {
  .template-grid { gap: 17px; padding: 24px; }.picker-toolbar { padding-left: 24px; padding-right: 24px; }
  .template-thumb { flex-basis: 105px; width: 105px; }.template-thumb > .iq-template-svg { width: 105px; height: 105px; }.template-copy p { font-size: 12px; }.template-card .template-copy { padding-left: 13px; }
  .library-heading { flex-wrap: wrap; }.library-tools { flex: 1; }.library-heading h1 { font-size: 24px; }
  .library-search { width: 210px; }
}
@media (max-width: 900px) {
  .site-main { width: calc(100% - 40px); margin-top: 20px; }.template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-thumb { flex-basis: 120px; width: 120px; }.picker-steps, .picker-steps h1 { font-size: 18px; }.picker-steps { gap: 12px; }.compact-search { flex-basis: 180px; }
  .library-list { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }.library-search { width: 180px; }.library-heading { gap: 15px; }
}
@media (max-width: 650px) {
  .site-header-inner { padding: 0 15px; gap: 12px; min-height: 51px; }.site-brand { font-size: 21px; }.site-nav { gap: 13px; }.site-nav a { font-size: 11px; }.site-create { font-size: 11px; padding: 6px 9px; }
  .site-main { width: calc(100% - 24px); margin-top: 14px; }.picker-toolbar { padding: 23px 17px 19px; flex-wrap: wrap; gap: 18px; }.picker-steps { gap: 11px; font-size: 16px; }.picker-steps h1 { font-size: 16px; }.step-chevron { font-size: 24px; }.compact-search { flex-basis: 100%; }
  .template-grid { padding: 19px 17px 30px; gap: 13px; grid-template-columns: minmax(0, 1fr); }.template-card .template-copy { padding-left: 18px; }.template-copy p { font-size: 13px; }
  .library-heading { padding: 17px; }.library-heading h1 { font-size: 23px; }.library-tools { justify-content: flex-start; flex-basis: 100%; }.library-search { flex: 1; width: auto; min-width: 130px; }
  .library-order-row { padding: 12px 17px; gap: 12px; flex-wrap: wrap; }.library-sort-options { gap: 11px; margin-left: auto; font-size: 11px; }.library-sort-options button { font-size: 11px; }
  .library-list { padding: 10px 17px 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }.activity-details { padding: 8px 8px 29px; }.activity-details h2 { font-size: 13px; }.activity-template-name { font-size: 10px; }.activity-meta { font-size: 9px; left: 8px; }
  .folder-card { min-height: 100px; padding: 16px 12px 30px; }.folder-card h2 { font-size: 13px; }.folder-card p { font-size: 10px; }.folder-up { width: 100%; }
  .site-footer { padding: 15px 20px 20px; }
}
@media (max-width: 420px) {
  .site-nav a#templatesNav { display: none; }.site-header-inner { gap: 8px; }.site-nav { gap: 0; }
  .picker-steps, .picker-steps h1 { font-size: 14px; }.picker-steps { gap: 7px; }.step-chevron { font-size: 20px; }
  .template-thumb { flex-basis: 100px; width: 100px; }.template-thumb > .iq-template-svg { width: 100px; height: 100px; }.template-card .template-copy { padding: 11px 10px 11px 12px; }.template-copy p { font-size: 12px; }
  .library-list { grid-template-columns: minmax(0, 1fr); }.library-card { max-width: 260px; width: 100%; }.folder-card { max-width: 260px; }.folder-up { width: 130px; }
}
@media (prefers-reduced-motion: reduce) { :where(:root:not([data-motion-managed])) .template-card { transition: none; } }/* The player's own "No movement" choice (html[data-reduce-motion], js/motion-preference.js) applies the same rules. */:where(:root[data-reduce-motion]) .template-card { transition: none; }

/* A game being tested (js/store.js isTestingGame): its badge in the picker, and the notice that covers
   the editor for everyone but the site's administrator. */
.template-testing, .testing-pill { display: inline-block; align-self: flex-start; padding: 2px 9px; border: 1px solid #8fb7d6; border-radius: 999px; background: #e7f3fb; color: #17466b; font-size: 12px; font-weight: 800; line-height: 1.5; letter-spacing: .03em; }
.template-testing { margin-top: -2px; }
.testing-gate { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: #f4f7f6; }
.testing-gate-card { display: grid; justify-items: center; gap: 12px; width: min(100%, 460px); padding: 28px 24px; border: 1px solid #d5e2e6; border-radius: 16px; background: #fff; text-align: center; box-shadow: 0 10px 30px rgba(23, 73, 75, .1); }
.testing-gate-card h1 { margin: 0; font-size: 24px; line-height: 1.2; color: #17494b; text-wrap: balance; }
.testing-gate-card p { margin: 0; color: #4d6466; }
.testing-gate-card .testing-pill { align-self: center; }

/* Source: css/quality.css */
/* Phones must not enlarge text on their own: sizes stay the same on every page and orientation. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* ClassPlay's teacher surfaces. Game scenery and authored content keep their own styles. */
:root {
  --cp-ink: #173b43;
  --cp-muted: #526976;
  --cp-action: #155f69;
  --cp-action-hover: #114e57;
  --cp-teal: #087b72;
  --cp-line: #dfe6dc;
  --cp-paper: #fff;
  --cp-radius: 14px;
  --cp-shadow: 0 4px 20px #163d5010;
}
body.site-page:not(.welcome-page), body.resource-page {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 8% 0%, #e7f4ef 0, transparent 46%) no-repeat, #f7f6ef;
  color: var(--cp-ink);
  font-family: "ClassPlay Round", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
html:not([data-community=on]) [data-classroom-nav=community] { display: none !important; }
.site-page .site-header, .resource-page .site-header { background: #fffdf9; border-bottom: 1px solid var(--cp-line); }
.site-header .site-header-inner { box-sizing: border-box; min-height: 72px; gap: 22px; padding: 10px 28px; }
.site-header .site-brand { color: var(--cp-ink); gap: 9px; font-size: 26px; letter-spacing: -.9px; text-decoration: none; }
.site-logo { position: relative; display: block; width: 33px; height: 33px; flex: 0 0 33px; transform: none; }
.site-logo i { position: absolute; display: block; width: 17px; height: 27px; left: 5px; bottom: 3px; opacity: 1; border-radius: 5px 5px 2px 5px; transform-origin: 8px 24px; background: var(--cp-teal); }
.site-logo i:nth-child(1) { transform: rotate(-30deg); background: #a6d9c6; }
.site-logo i:nth-child(2) { transform: rotate(-9deg); background: #eeb697; }
.site-logo i:nth-child(3) { transform: rotate(14deg); background: #247d74; }
.site-logo i:nth-child(4) { width: 8px; height: 9px; left: 12px; bottom: 13px; border-radius: 0; background: #f2c861; clip-path: polygon(0 0,100% 50%,0 100%); transform: rotate(14deg); }
.site-header .site-nav { align-items: center; gap: 8px; }
.site-header .site-nav a, .resource-page .site-header nav a {
  box-sizing: border-box; min-height: 44px; padding: 10px 13px; border: 0; border-radius: 9px; text-decoration: none;
  font: 700 14px/1.35 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--cp-muted); white-space: nowrap;
}
.site-header .site-nav a:hover { color: var(--cp-action); background: #eef3e8; }
.site-header .site-nav a[aria-current] { color: var(--cp-action); background: #e6efe9; }
.site-page .site-button, .resource-page .site-button {
  min-height: 44px; padding: 10px 16px; border-radius: 9px; border-color: #c5d6d3; text-decoration: none;
  background: #fff; color: var(--cp-ink); font-size: 14px; font-weight: 700; line-height: 1.3;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
.site-page .site-button:hover:not(:disabled), .resource-page .site-button:hover:not(:disabled) { background: #eef3e8; border-color: #8fb3a6; }
.site-page:not(.welcome-page) .site-button.primary, .resource-page .site-button.primary,
.resource-page .resource-primary, .resource-page .site-header .site-create {
  color: #fff !important; background: var(--cp-action) !important; border-color: var(--cp-action) !important;
  border-radius: 9px; box-shadow: 0 3px 8px #155f691c;
}
.site-page:not(.welcome-page) .site-button.primary:hover:not(:disabled), .resource-page .site-button.primary:hover:not(:disabled),
.resource-page .resource-primary:hover:not(:disabled) { background: var(--cp-action-hover) !important; border-color: var(--cp-action-hover) !important; }
.site-page :is(button, a, input, select, textarea, summary):focus-visible,
.resource-page :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #155f69; outline-offset: 3px; }
.site-page .site-input, .site-page .site-select { height: 44px; border-color: #c5d6d3; border-radius: 9px; font-size: 15px; }
.site-page .site-input::placeholder { color: #637581; opacity: 1; }
.site-page .site-input:focus, .site-page .site-select:focus { border-color: var(--cp-action); box-shadow: 0 0 0 3px #155f6918; }
.cp-account-nav .cp-account-button, .cp-account-nav .cp-account-signin { min-height: 44px; border-radius: 10px; font-size: 14px; }
.cp-account-nav .cp-account-avatar { border-radius: 8px; background: var(--cp-action); }
.cp-account-nav .cp-account-menu, .lib-context-menu { border-color: var(--cp-line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px #15374724; }
.cp-account-nav .cp-account-menu button, .lib-context-menu button { min-height: 44px; border-radius: 7px; }
.site-header :is(.cp-language-switch, .account-language, .admin-language) { border-radius: 9px; border-color: #c5d6d3; }
.site-header :is(.cp-language-switch, .account-language, .admin-language) button { min-height: 40px; min-width: 42px; font-size: 13px; }
.site-header :is(.cp-language-switch, .account-language, .admin-language) button[aria-pressed=true] { background: #e6efe9; color: var(--cp-action); font-weight: 800; }
.site-page .site-footer { color: var(--cp-muted); font-size: 12px; padding: 24px 20px 28px; }
.site-page .site-dialog { border: 1px solid var(--cp-line); border-radius: 18px; padding: 28px; }
.site-page .site-dialog h2 { color: var(--cp-ink); font-weight: 800; }
.site-page .site-dialog::backdrop { background: #102d4963; }
.site-page .cloud-status { border-radius: 12px; font-size: 14px; padding: 12px 16px; }
.cloud-status .cloud-action { min-height: 40px; padding: 8px 12px; border-radius: 7px; }

/* A calm, legible workbench with the owner's folder colours preserved. */
.activity-library-page .site-main { margin-top: 28px; max-width: 1280px; }
.activity-library-page .library-page .library-heading { border-radius: var(--cp-radius); padding: 26px 28px; box-shadow: var(--cp-shadow); align-items: center; }
.activity-library-page .library-page h1 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.2; color: var(--cp-ink); letter-spacing: -.7px; }
.activity-library-page .library-page .library-tools .site-button { min-height: 44px; border-radius: 9px; border-color: #c5d6d3; color: var(--cp-ink); }
.activity-library-page .library-page .library-search .site-input { height: 44px; border-radius: 9px 0 0 9px; font-size: 15px; }
.activity-library-page .library-page .library-search .site-button { border-radius: 0 9px 9px 0; }
.activity-library-page .library-page .library-view-controls .site-button { min-width: 44px; }
.activity-library-page .library-page .library-view-controls .site-button:first-child { border-radius: 9px 0 0 9px; }
.activity-library-page .library-page .library-view-controls .site-button:last-child { border-radius: 0 9px 9px 0; }
.activity-library-page .library-page .library-view-controls .site-button[aria-pressed=true] { background: #e6efe9; color: var(--cp-action); box-shadow: inset 0 -3px var(--cp-action); }
.activity-library-page .library-page .library-body { margin-top: 18px; padding: 20px 28px 32px; border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); }
.activity-library-page .library-page .library-order-row { gap: 16px; flex-wrap: wrap; font-size: 14px; padding-bottom: 16px; }
.activity-library-page .library-page .library-order-row button { min-height: 40px; padding: 8px 10px; border-radius: 8px; color: var(--cp-muted); }
.activity-library-page .library-page .library-order-row button[aria-pressed=true] { color: var(--cp-action); background: #eef3e8; }
.activity-library-page .library-count { margin: 0 auto 0 0; color: var(--cp-muted); font-size: 13px; line-height: 1.5; }
.activity-library-page .library-page .library-list { gap: 22px 20px; }
.activity-library-page .lib-folder .folder-shape { width: 100%; min-width: 0; aspect-ratio: auto; height: 128px; min-height: 0; }
.activity-library-page .folder-back { border-radius: 9px 13px 12px 12px; }
.activity-library-page .folder-front { border-radius: 9px 9px 12px 12px; box-shadow: inset 0 1px #ffffff45, 0 2px 6px #1537470a; }
.activity-library-page .lib-folder-link { transition: transform .2s ease; }
.activity-library-page .lib-folder-link:hover { transform: translateY(-4px); }
.activity-library-page .lib-folder .lib-name { font-size: 17px; line-height: 1.35; }
.activity-library-page .lib-folder .lib-sub { font-size: 13px; color: #173b43; }
.activity-library-page .lib-activity { border-color: var(--cp-line); border-radius: 12px; overflow: hidden; box-shadow: 0 3px 9px #15374709; transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.activity-library-page .lib-activity:hover { transform: translateY(-3px); box-shadow: 0 8px 22px #15374716; border-color: #9dbcae; }
.activity-library-page .lib-thumb { border-bottom-color: var(--cp-line); }
.activity-library-page .lib-info { min-height: 92px; padding: 13px 58px 14px 14px; gap: 7px; }
.activity-library-page .lib-activity .lib-name { font-size: 15px; line-height: 1.35; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.activity-library-page .lib-activity .lib-sub { color: var(--cp-muted); font-size: 13px; }
.activity-library-page .lib-menu-button { width: 44px; height: 44px; border-radius: 8px; border-color: #b5c7bf; }
.activity-library-page .lib-activity .lib-menu-button { bottom: 14px; right: 10px; }
.activity-library-page .library-list[data-view=small] .folder-shape { height: 112px; min-height: 0; }
.activity-library-page .library-list[data-view=small] .lib-info { min-height: 88px; padding-right: 54px; }
.activity-library-page .library-list[data-view=small] .lib-menu-button { width: 40px; height: 40px; }
.activity-library-page .library-list[data-view=small] .lib-folder .lib-name { font-size: 14px; }
.activity-library-page .library-list[data-view=small] .lib-folder .lib-sub { font-size: 12px; }
.activity-library-page .library-list[data-view=small] .folder-front { padding-right: 48px; }
.site-page .template-card { border-color: var(--cp-line); border-radius: 12px; box-shadow: 0 3px 9px #15374709; }
.site-page .template-card:hover { border-color: #9dbcae; box-shadow: 0 7px 20px #15374712; }
.site-page .template-copy h2 { color: var(--cp-ink); font-weight: 800; }
.site-page .template-copy p { color: var(--cp-muted); }
.site-page .picker-toolbar { padding-top: 28px; }
.site-page .picker-steps h1 { font-weight: 800; color: var(--cp-ink); }

/* Authoring uses the same type and controls; learning content itself is untouched. */
.site-page.editor-page :is(button, input, textarea, select) { font-family: inherit; }
.site-page.editor-page .editor-main, .site-page.editor-page .editor-sheet { background: #fffdf9; border: 1px solid var(--cp-line); border-radius: 18px; box-shadow: var(--cp-shadow); }
.editor-page .item-panel, .editor-page .group-editor { background: #f5f6ef; border: 1px solid #e3e8de; border-radius: 14px; padding: 16px; }
.editor-page .editor-input-box { border-color: #c5d6d3; border-radius: 8px; overflow: hidden; }
.editor-page .editor-input-box:focus-within { border-color: var(--cp-action); box-shadow: 0 0 0 3px #155f6916; }
.editor-page .field-media-btn { width: 44px; height: 44px; border-radius: 7px; }
.editor-page .field-media-btn:hover, .editor-page .field-media-btn.attached { color: var(--cp-action); background: #e6efe9; }
.editor-page #previewBtn { color: var(--cp-ink); }
.editor-page .answer-state { min-width: 36px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #c2d1ca; background: #fff; color: #738680; font-size: 16px; font-weight: 900; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.editor-page .answer-state:hover { border-color: #1e7a52; background: #edf6f0; color: #1e7a52; }
.editor-page .answer-correct .answer-state { background: #1e7a52; border-color: #1e7a52; color: #fff; box-shadow: 0 2px 0 #135337; }
.editor-page .answer-wrong .answer-state { background: #fff6f5; border-color: #e0bab6; color: #b54b43; }
.editor-page .editor-footer .editor-done { border-radius: 10px; min-height: 44px; font-weight: 800; }
.editor-page .answer-remove { width: 36px; height: 36px; min-width: 36px; display: grid; place-items: center; }
.editor-page .field-picture { background: #faf8f3; border-right: 1px solid #dfe6dc; padding: 5px 34px 5px 5px; min-height: 72px; box-sizing: border-box; gap: 4px; }
.editor-page .field-picture img { width: 72px; height: 62px; max-width: 100%; max-height: 62px; object-fit: contain; border-radius: 6px; background: #fff; }
.editor-page .field-picture button { width: 26px; height: 26px; min-width: 26px; min-height: 26px; top: 4px; right: 4px; padding: 0; display: grid; place-items: center; border-radius: 6px; background: #fff; border: 1px solid #d5e0da; color: #52696d; }
.editor-page .field-picture button:hover { background: #edf4ef; color: #155f69; border-color: #9dbcae; }
.editor-page .field-picture .adjust-picture { top: auto; bottom: 4px; right: 4px; font-size: 16px; color: #155f69; }
.editor-page .group-remove, .editor-page .group-image-button { min-width: 36px; min-height: 36px; }
.editor-page .add-content, .editor-page .add-answer { min-height: 44px; border-radius: 8px; color: var(--cp-action); }
.editor-page .field-format { border-radius: 7px; overflow: hidden; }
.site-page.account-page { min-height: 100dvh; background: radial-gradient(ellipse at 15% 5%, #e4f3ec, transparent 55%) no-repeat, #f7f6ef; }
.account-page .account-layout { box-shadow: 0 12px 45px #163d5010; border-color: var(--cp-line); }
.account-page .account-explainer { background: linear-gradient(155deg, #e6f3ef, #eef3ec); }
.resource-page .resource-info, .resource-page .resource-settings, .resource-page .resource-sidebar>section { border-radius: 12px; border-color: var(--cp-line); }
.resource-page .resource-info h1, .resource-page .resource-details h1 { font-family: "ClassPlay Round", "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 800; color: var(--cp-ink); }
.resource-page .resource-details, .resource-page .resource-options { border-radius: 16px; border-color: var(--cp-line); background: #fffdf9; box-shadow: 0 4px 20px #163d5008; }
.resource-page .resource-details { min-height: 0; padding: 18px 22px; align-items: center; }
.resource-page .resource-details > div:first-child { flex: 1 1 220px; min-width: 0; }
.resource-page .resource-details h1 { margin: 0 0 4px; font-size: clamp(20px, 2vw, 24px); line-height: 1.25; }
.resource-page .resource-actions { gap: 6px; }
.resource-page .resource-actions :is(a, button) { min-height: 40px; }
.resource-page .resource-actions a, .resource-page .resource-actions button:not(.resource-primary) { font: 700 13.5px/1.3 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--cp-action); padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.resource-page .resource-actions a:hover, .resource-page .resource-actions button:not(.resource-primary):hover { background: #eef3e8; }
.resource-page .resource-tabs { border-bottom-color: var(--cp-line); gap: 20px; }
.resource-page .resource-tabs button { font: 700 15px/1.3 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--cp-muted); }
.resource-page .resource-tabs [aria-selected=true] { border-bottom-color: var(--cp-action); color: var(--cp-action); font-weight: 800; }
.resource-page .resource-options > [role=tabpanel] > h2 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.resource-page #settingsBody { margin-top: 14px; }
.resource-page #leaderboardPanel { padding-top: 14px; }
.resource-page .setting-row input[type=range], .resource-page .setting-row input[type=checkbox] { accent-color: var(--cp-action); }
.resource-page .setting-row select { min-height: 40px; min-width: 170px; padding: 7px 10px; border-radius: 8px; border-color: #c5d6d3; font-family: inherit; color: var(--cp-ink); }
.resource-page .settings-actions button:not(.resource-primary) { min-height: 44px; padding: 10px 16px; border-radius: 9px; border: 1px solid #c5d6d3; background: #fff; color: var(--cp-ink); font: 700 14px/1.3 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", sans-serif; }
.resource-page .settings-actions button:not(.resource-primary):hover { background: #eef3e8; border-color: #8fb3a6; }
.resource-page .resource-sidebar section[hidden] { display: none !important; }
.resource-page .resource-sidebar section:has(#visualStyles[hidden]) .font-label { margin-top: 0; }
.resource-page .font-label { color: var(--cp-muted); font-weight: 800; letter-spacing: .06em; }
.resource-page .resource-more-menu { border-radius: 12px; border-color: var(--cp-line); padding: 6px; box-shadow: 0 10px 30px #15374720; }
.resource-page .resource-actions .resource-more-menu button { border-radius: 7px; font: 600 14px/1.3 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", sans-serif !important; color: var(--cp-ink) !important; }
.resource-page .resource-actions .resource-more-menu button:hover { background: #eef3e8; color: var(--cp-action) !important; }
.resource-page .resource-sidebar .template-switch { border-radius: 8px; }
.resource-page .resource-main>.activity-player { border-radius: 14px; box-shadow: 0 8px 28px #13364b1c; }
.resource-page .activity-player:fullscreen { border-radius: 0; }
#activityPlayer #gameStage :is(.pair-face-picture, .quiz-choice-content, .hm-clue-picture, .dt-picture, .fl-face .pair-face-picture) img,
#activityPlayer #gameStage #agImage { border-radius: 10px; }
@media(min-width:760px) {
  .resource-page .resource-details { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; }
  .resource-page .resource-details #imageCredits { grid-column: 1 / -1; width: auto; }
  .resource-page .resource-actions { flex-wrap: nowrap; flex-shrink: 0; }
  .resource-page #settingsBody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; align-items: center; }
  .resource-page #settingsBody > .set-sec,
  .resource-page #settingsBody > .setting-note { grid-column: 1 / -1; }
  .resource-page #settingsBody > .set-sec { margin-top: 6px; padding-top: 12px; }
  .resource-page #settingsBody > .set-sec:first-child { margin-top: 0; padding-top: 4px; }
  .resource-page #settingsBody > .setting-row { max-width: none; gap: 12px; justify-content: space-between; }
  .resource-page #settingsBody > .setting-row > label:first-child { width: auto; flex: 1 1 140px; }
  .resource-page #settingsBody > .setting-note { max-width: none; margin: 2px 0 8px; }
}

@media(max-width:1100px) {
  .site-header .site-header-inner { gap: 12px; padding-inline: 20px; flex-wrap: wrap; }
  .site-header .site-nav { gap: 3px; }
  .site-header .site-nav a { padding-inline: 9px; }
  .activity-library-page .library-page .library-tools { justify-content: flex-start; }
}
@media(max-width:760px) {
  .site-header .site-header-inner { min-height: 64px; padding: 12px 16px; gap: 10px; }
  .site-header .site-brand { font-size: 24px; }
  .site-header .site-nav { order: 5; flex-basis: 100%; min-height: 44px; flex-wrap: wrap; justify-content: space-between; margin: 0; gap: 2px; }
  .site-header .site-nav a, .resource-page .site-header nav a { font-size: 13px; padding-inline: 10px; }
  .site-header .site-create { margin-left: auto; }
  .site-header .cp-account-nav { margin-left: 0; }
  .site-header .cp-language-switch { margin-left: auto; }
  .activity-library-page .site-main { width: calc(100% - 24px); margin-top: 18px; }
  .activity-library-page .library-page .library-heading { padding: 22px 18px; }
  .activity-library-page .library-page .library-body { padding: 16px 18px 24px; }
  .activity-library-page .library-page .library-tools { gap: 10px; }
  .activity-library-page .library-page .library-search { flex: 1 1 100%; order: 3; }
  .activity-library-page .library-page .library-search .site-input { width: 100%; }
  .activity-library-page .library-page .library-order-row { gap: 4px; }
  .activity-library-page .library-order-label { flex-basis: 100%; margin: 0 0 2px; }
  .activity-library-page .library-count { flex-basis: 100%; margin-bottom: 8px; }
  .activity-library-page .library-page .library-list { gap: 18px 14px; }
  .editor-page .editor-input-box { grid-template-columns: minmax(0,1fr) 44px; }
  .editor-page .field-format { height: 42px; }
  .editor-page .field-format button { width: 40px; height: 40px; line-height: 40px; }
  .editor-page .answer-state { width: 40px; min-width: 40px; height: 40px; }
  .editor-page .answer-remove { width: 36px; min-width: 36px; }
  .editor-page .answer-grid { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:420px) {
  .site-header .site-create { font-size: 13px; padding: 10px 12px; }
  .cp-account-nav .cp-account-label { max-width: 96px; }
  .activity-library-page .library-page .library-order-row { justify-content: space-between; }
  .activity-library-page .library-page .library-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 10px; }
  .activity-library-page .lib-folder .lib-name { font-size: 14px; }
  .activity-library-page .folder-front { padding: 12px 48px 10px 11px; }
  .activity-library-page .lib-folder .lib-sub { font-size: 12px; }
  .activity-library-page .lib-info { min-height: 108px; padding: 11px 12px 52px; }
  .activity-library-page .lib-activity .lib-name { font-size: 14px; }
  .activity-library-page .lib-menu-button { width: 40px; height: 40px; }
  .activity-library-page .lib-activity .lib-menu-button { bottom: 8px; right: 8px; }
  .activity-library-page .library-list[data-view=small] .lib-info { padding: 10px 10px 50px; }
  .editor-page .item-panel { padding: 12px 10px; }
}
@media(prefers-reduced-motion:reduce) {
  :where(:root:not([data-motion-managed])) .site-page .site-button, :where(:root:not([data-motion-managed])) .site-page .template-card, :where(:root:not([data-motion-managed])) .activity-library-page .lib-activity, :where(:root:not([data-motion-managed])) .activity-library-page .lib-folder-link { transition: none; }
  :where(:root:not([data-motion-managed])) .activity-library-page .lib-activity:hover, :where(:root:not([data-motion-managed])) .activity-library-page .lib-folder-link:hover { transform: none; }
}
/* The player's own "No movement" choice (html[data-reduce-motion], js/motion-preference.js) applies the same rules. */
:where(:root[data-reduce-motion]) .site-page .site-button, :where(:root[data-reduce-motion]) .site-page .template-card, :where(:root[data-reduce-motion]) .activity-library-page .lib-activity, :where(:root[data-reduce-motion]) .activity-library-page .lib-folder-link { transition: none; }
:where(:root[data-reduce-motion]) .activity-library-page .lib-activity:hover, :where(:root[data-reduce-motion]) .activity-library-page .lib-folder-link:hover { transform: none; }
@media(forced-colors:active) {
  .site-page .site-button.primary, .resource-page .resource-primary { border: 2px solid ButtonText !important; }
  .site-header .site-nav a[aria-current] { outline: 2px solid LinkText; }
  .folder-front, .folder-back { border: 1px solid CanvasText; }
}
/* Footer links to the privacy notice, terms and contact address on every teacher page. */
.site-footer .site-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 6px; }
.site-footer .site-footer-links a { color: var(--cp-ink); font-weight: 700; text-decoration: none; }
.site-footer .site-footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Source: css/i18n.css */
.cp-language-switch{display:flex;align-items:center;flex:0 0 auto;border:1px solid #b8c6d0;border-radius:5px;overflow:hidden;background:#fff;margin-left:8px;align-self:center}
.cp-language-switch button{appearance:none;min-width:38px;border:0;background:transparent;color:#405766;padding:6px 8px;font:600 12px/1.25 "ClassPlay Round","PingFang SC","Microsoft YaHei",sans-serif;cursor:pointer;white-space:nowrap;border-radius:0}
.cp-language-switch button+button{border-left:1px solid #d9e2e8}
.cp-language-switch button[aria-pressed=true]{background:#e6efe9;color:#155f69;font-weight:800}
.cp-language-switch button:focus-visible{outline:2px solid #155f69;outline-offset:-3px}
/* The worksheet's language selector stays secondary to its print action. */
.site-page:is(.tools-page,.tracing-page) .cp-language-switch{border-color:#c5d6d3;background:#fff}
.site-page:is(.tools-page,.tracing-page) .cp-language-switch button{color:#52696d;font-family:inherit}
.site-page:is(.tools-page,.tracing-page) .cp-language-switch button[aria-pressed=true]{background:#e6efe9;color:#155f69}
.site-page:is(.tools-page,.tracing-page) .cp-language-switch button:focus-visible{outline-color:#155f69}
html[lang=zh-CN] body{font-family:"ClassPlay Round","PingFang SC","Microsoft YaHei",system-ui,sans-serif}
html[lang=zh-CN] .site-nav{gap:16px}
html[lang=zh-CN] .template-copy h2{line-height:1.5}
html[lang=zh-CN] .template-copy p{line-height:1.65}
html[lang=zh-CN] .editor-steps h1,html[lang=zh-CN] .picker-steps h1{white-space:nowrap}
html[lang=zh-CN] .setting-row label{line-height:1.6}
html[lang=zh-CN] .buzz-hint{line-height:1.65}
html[lang=zh-CN] .launch-button{letter-spacing:0}
@media(max-width:700px){.cp-language-switch{margin-left:auto}.cp-language-switch button{min-width:32px;padding:6px}.site-header-inner{flex-wrap:wrap}.site-header .site-nav{flex-shrink:1}html[lang=zh-CN] .site-nav{gap:12px}}
@media(max-width:400px){.site-header .site-create{padding:6px 8px}.cp-language-switch{margin-left:2px}.site-header-inner{gap:8px}}

/* Source: css/tracing.css */
/* Tracing fonts are registered by js/tracing-engine.js from the bytes it already
   downloaded, so the browser does not fetch each font a second time. */
body.site-page.tracing-page{--studio-accent:#155f69;--studio-accent-hover:#114e57;--studio-ink:#173b43;--studio-muted:#52696d;--studio-line:#dfe6dc;--studio-tint:#edf4ef;--studio-mat:#e6eee4;--studio-radius:16px;margin:0;min-height:100dvh;background:radial-gradient(ellipse at 8% 0%,#e7f4ef 0,transparent 46%) no-repeat,#f7f6ef;color:var(--studio-ink);font-size:14px;line-height:1.5}
.tracing-page *{box-sizing:border-box}
.tracing-page .ui-icon{width:18px;height:18px;flex-shrink:0;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tracing-page .site-header{position:sticky;top:0;z-index:30;background:#fffdf9;border-bottom:1px solid var(--studio-line)}
.tracing-page .site-header-inner{max-width:1264px;min-height:72px;margin:auto;display:flex;align-items:center;gap:24px;padding:12px 24px}
.tracing-page .site-brand{font:800 27px "ClassPlay Round",sans-serif;letter-spacing:-1px;color:var(--studio-ink);text-decoration:none}
.tracing-page .site-header nav{margin-left:auto;display:flex;align-items:center;gap:6px}
.tracing-page .site-header nav a{color:var(--studio-muted);font-weight:700;font-size:14px;text-decoration:none;padding:10px 12px;border-bottom:0;border-radius:9px}
.tracing-page .site-header nav a:hover{color:var(--studio-accent);background:#eef3e8}
.tracing-page .site-header nav a[aria-current]{color:var(--studio-accent);border-bottom:0;background:#e6efe9;border-radius:9px;box-shadow:none}
.tracing-page .cp-language-switch{margin-left:0}
.tracing-page .tracing-main{width:100%;max-width:1264px;margin:0 auto;padding:16px 24px 40px;background:transparent;box-shadow:none;min-height:0}
.studio-topline{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.lw-studio-switch{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px;max-width:100%;padding:3px;border:1px solid #d5e1d9;border-radius:14px;background:#edf4ef}
.lw-studio-switch a{display:inline-flex;align-items:center;padding:4px 9px;border-radius:999px;font-size:11.5px;font-weight:700;color:var(--studio-muted);text-decoration:none;white-space:nowrap;transition:background .14s,color .14s}
.lw-studio-switch a:hover{color:var(--studio-accent);background:#ffffff99}
.lw-studio-switch a[aria-current=page]{background:#fff;color:var(--studio-accent);box-shadow:0 1px 3px #155f691f}
.studio-back{display:inline-flex;align-items:center;gap:7px;min-height:26px;color:var(--studio-muted);font-size:13px;text-decoration:none}
.studio-back:hover{color:var(--studio-accent)}
.studio-heading{margin-bottom:18px}.studio-heading h1{font-size:28px;line-height:1.25;letter-spacing:-.65px;font-weight:800;margin:0 0 6px}.studio-heading p{font-size:14px;line-height:1.5;color:var(--studio-muted);margin:0}
.tracing-workspace{display:grid;grid-template-columns:clamp(380px,29vw,420px) minmax(0,1fr);gap:24px;align-items:start}
.tracing-controls,.tracing-preview{min-width:0;background:#fffdf9;border:1px solid var(--studio-line);border-radius:var(--studio-radius);box-shadow:0 4px 20px #163d500d}
.tracing-controls{padding:24px}.tracing-controls fieldset{min-width:0;margin:0;padding:0;border:0}
.tracing-essentials{display:flex;flex-direction:column;gap:24px;min-width:0}.studio-section{min-width:0;padding:0 0 24px;margin:0;border:0;border-bottom:1px solid #e5ebe1}.studio-section:last-child{padding-bottom:0;border-bottom:0}
.tracing-controls h2{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:800;line-height:1.4;margin:0 0 14px}.section-number{display:inline-grid;place-items:center;padding:2px 8px;border-radius:999px;background:#eaf2ec;color:var(--studio-accent);font-size:11px;font-weight:800;letter-spacing:.3px;font-variant-numeric:tabular-nums}
.tracing-controls label:not(.sr-only){display:block;font-size:12px;font-weight:700;line-height:1.4;margin:14px 0 7px}.tracing-controls .tracing-help{font-size:11px;line-height:1.6;color:var(--studio-muted);margin:7px 0 0}
.tracing-page select,.tracing-controls textarea,.tracing-controls input[type=text],.tracing-controls input[type=number]{font:inherit;min-width:0;border:1px solid #c6d5ce;border-radius:7px;background:#fff;color:var(--studio-ink)}
.tracing-controls textarea,.tracing-controls select,.tracing-controls input[type=text],.tracing-controls input[type=number]{width:100%;min-height:38px;font-size:14px;padding:8px 10px}.tracing-controls textarea{display:block;min-height:104px;max-height:400px;resize:vertical;font-size:16px;line-height:1.6;background:#fafaf5}
.words-section #tracingTitle{margin-bottom:14px}
.tracing-page select{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2352696d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;padding-right:33px}
.tracing-page select::-ms-expand{display:none}
.tracing-page select::picker-icon{display:none!important}
.tracing-controls input[type=checkbox]{width:19px;height:19px;accent-color:var(--studio-accent);flex-shrink:0;cursor:pointer}.tracing-controls input[type=range]{width:100%;min-height:30px;accent-color:var(--studio-accent)}
.tracing-controls [hidden],.tracing-preview [hidden]{display:none!important}.repeat-across{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:14px}.repeat-across label{margin:0!important}
.row-stepper{display:flex;align-items:center;flex-shrink:0;width:100px;height:36px;border:1px solid #c6d5ce;border-radius:7px;background:#fff;overflow:hidden}.row-stepper button{display:grid;place-items:center;flex-shrink:0;width:31px;min-width:0;height:34px;border:0;background:transparent;padding:0;color:var(--studio-accent);cursor:pointer;font:inherit}.row-stepper button:hover:not(:disabled){background:var(--studio-tint)}.row-stepper button:disabled{opacity:.3;cursor:default}
.row-stepper input[type=number]{width:36px;min-height:34px;height:34px;border:0;border-radius:0;padding:0;text-align:center;background:transparent;font-size:14px;font-weight:700;appearance:textfield;-moz-appearance:textfield}.row-stepper input::-webkit-inner-spin-button,.picture-width-input input::-webkit-inner-spin-button{display:none}
.compact-style-row{display:grid;grid-template-columns:minmax(0,1fr) 124px;gap:14px}.compact-style-row label{margin-top:0!important}.writing-size-stepper{width:124px;height:38px}.writing-size-stepper button{width:31px;height:36px}.stepper-value{display:flex;align-items:center;justify-content:center;gap:2px;width:60px;font-weight:700}.stepper-value input[type=number]{width:29px;height:36px;min-height:36px}.stepper-value>span{color:var(--studio-muted);font-size:11px;font-weight:600;padding-right:3px}
.setting-label-with-help{display:flex;align-items:center;justify-content:space-between;margin-top:15px;margin-bottom:7px;position:relative}.setting-label-with-help label{margin:0!important}.guide-help{position:relative;z-index:6}.guide-help summary{display:grid;place-items:center;list-style:none;cursor:pointer;color:var(--studio-muted);min-width:24px;min-height:24px;border-radius:5px}.guide-help summary:hover{color:var(--studio-accent);background:var(--studio-tint)}.guide-help summary::-webkit-details-marker{display:none}.guide-help-content{position:absolute;right:0;top:34px;width:270px;max-width:calc(100vw - 80px);border:1px solid var(--studio-line);border-radius:10px;background:white;box-shadow:0 5px 24px #163d5018;padding:14px}
.guide-key{display:flex;align-items:flex-start;gap:10px;color:var(--studio-muted);font-size:12px;line-height:1.5}.guide-key p{margin:0}.guide-example{width:26px;height:15px;margin-top:2px;flex-shrink:0;border-top:1px solid #83b6d4;border-bottom:2px solid #ce7474;position:relative}.guide-example:after{content:"";position:absolute;inset:6px 0 auto;border-top:1px dashed #83b6d4}.is-mono .guide-example{filter:grayscale(1)}
.practice-rows{border:1px solid var(--studio-line);border-radius:9px;overflow:hidden;--practice-font:"CP Tracing Book"}.practice-row{display:flex;align-items:center;gap:9px;min-height:52px;padding:9px 10px;background:#fafaf5}.practice-row+.practice-row{border-top:1px solid #e5ebe1}.practice-row label{flex:1;font-size:12px!important;font-weight:600!important;line-height:1.35!important;margin:0!important}.practice-row>input[type=checkbox]{margin:0}
.tracing-notes,.tracing-settings{margin-top:14px;border-top:1px solid #e5ebe1}.tracing-controls summary{display:flex;justify-content:space-between;align-items:center;gap:12px;list-style:none;min-height:40px;padding:9px 0;cursor:pointer;font-family:inherit;font-size:12px;font-weight:700;line-height:1.5;color:var(--studio-muted)}.tracing-controls summary::-webkit-details-marker,.tracing-files summary::-webkit-details-marker{display:none}.tracing-controls details[open]>summary{color:var(--studio-accent)}.tracing-controls details[open]>summary>.ui-icon{transform:rotate(180deg)}
.tracing-settings-body{padding:2px 0 0}.tracing-settings h3{font-size:12px;font-weight:800;line-height:1.5;color:var(--studio-muted);margin:20px 0 0}.tracing-option-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.tracing-checkbox{display:flex!important;align-items:center;gap:9px;font-weight:600!important}.tracing-range-label{display:flex!important;align-items:center;justify-content:space-between;gap:10px}.tracing-range-label output{color:var(--studio-muted);font-weight:400}.tracing-settings-save{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:20px}.tracing-settings-save .site-button{font-size:11px;min-height:36px;padding:8px 10px}.tracing-retry{font:inherit;font-size:12px;line-height:1.5;color:var(--studio-accent);border:0;background:transparent;padding:8px 0;text-decoration:underline;cursor:pointer}.tracing-notes textarea{min-height:88px;font-size:14px;margin-top:10px}.tracing-note-size{display:flex;align-items:center;justify-content:space-between;gap:12px}.tracing-note-size input{max-width:80px;margin-top:10px}.tracing-note-size label{margin:0!important}.tracing-privacy{font-size:10px;line-height:1.6;color:var(--studio-muted);margin:20px 0 0}.tracing-error{font-size:12px;line-height:1.5;color:#a13e27;margin:10px 0 0}.tracing-controls [aria-invalid=true]{border-color:#b34429!important}#fileStatus:empty,#settingsStatus:empty{display:none}

/* Actions stay outside the independently scrolling page mat. */
.tracing-preview{position:sticky;top:calc(var(--site-header-height,72px) + 16px);height:auto;padding:18px;display:flex;flex-direction:column;scroll-margin-top:calc(var(--site-header-height,72px) + 16px)}
.tracing-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:38px;margin:0 0 12px;flex-shrink:0}.worksheet-title{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0}.worksheet-title h2{font-size:14px;font-weight:800;line-height:1.4;margin:0}.worksheet-title p{font-size:11px;line-height:1.5;color:var(--studio-muted);margin:0}.tracing-actions{display:flex;align-items:center;gap:7px;flex-shrink:0}
.tracing-page .site-button,.tracing-picture-bar button,.tracing-picture-tools summary,.icon-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;border:1px solid #c6d5ce;border-radius:7px;background:#fff;color:var(--studio-ink);padding:8px 10px;font:inherit;font-weight:700;font-size:12px;line-height:1.3;cursor:pointer;text-decoration:none;white-space:nowrap;box-shadow:none}.tracing-page .site-button:hover:not(:disabled),.tracing-picture-bar button:hover:not(:disabled),.tracing-picture-tools summary:hover,.icon-button:hover{border-color:#8fb3a6;background:var(--studio-tint);color:var(--studio-accent)}
.tracing-page .tracing-actions .site-button.primary{background:var(--studio-accent);border-color:var(--studio-accent);color:#fff;box-shadow:none}.tracing-page .tracing-actions .site-button.primary:hover:not(:disabled){background:var(--studio-accent-hover);border-color:var(--studio-accent-hover)}.tracing-page button:disabled{opacity:.45;cursor:default}.worksheet-save-group{display:flex}.worksheet-save-group #saveTracingFile{border-radius:7px 0 0 7px}.worksheet-save-group .file-options-trigger{width:24px;min-width:24px;border-left:0;border-radius:0 7px 7px 0;padding:0}.file-options-trigger .ui-icon{width:18px}
/* Saving an editable copy is a quieter secondary action; PDF remains primary. */
.tracing-page .worksheet-save-group .site-button{border-color:transparent;background:transparent;color:var(--studio-muted);font-weight:500}
.tracing-page .worksheet-save-group .site-button:hover:not(:disabled){border-color:transparent;background:var(--studio-tint);color:var(--studio-accent)}
.worksheet-save-group #saveTracingFile .ui-icon{width:16px;height:16px}
.tracing-picture-bar{display:flex;align-items:center;gap:8px;min-height:36px;margin:0 0 14px;flex-shrink:0}.tracing-picture-bar button{font-size:12px;padding:7px 9px}.preview-scale{display:flex;align-items:center;gap:8px;flex-shrink:0;font-size:12px;color:var(--studio-muted)}.preview-scale select{font:inherit;font-size:12px;min-height:36px;padding:7px 31px 7px 10px;color:var(--studio-ink);border-radius:7px}.preview-scale output{font-size:11px;font-variant-numeric:tabular-nums;min-width:4ch;color:var(--studio-muted)}.toolbar-separator{width:1px;height:22px;background:var(--studio-line);flex-shrink:0;margin:0 2px}
.tracing-picture-tools{position:relative;z-index:8;min-width:0}.tracing-picture-tools summary{list-style:none;padding:7px 9px}.tracing-picture-tools summary::-webkit-details-marker{display:none}.tracing-picture-tools[open] summary{background:var(--studio-tint);border-color:#8fb3a6;color:var(--studio-accent)}.picture-options{position:absolute;top:44px;right:0;width:220px;padding:14px;background:#fff;border:1px solid var(--studio-line);box-shadow:0 7px 24px #163d5018;border-radius:10px;display:flex;flex-direction:column;gap:12px}.picture-options label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;font-size:12px;color:var(--studio-muted)}.picture-options select{font-size:12px;width:90px;min-height:34px;padding:5px 32px 5px 8px}.picture-width-input{display:flex;align-items:center;gap:5px;width:90px;min-height:34px;border:1px solid #c6d5ce;border-radius:6px;background:#fff;padding:0 8px}.picture-width-input input{font:inherit;font-size:13px;color:var(--studio-ink);width:44px;min-width:0;border:0;background:transparent;appearance:textfield;-moz-appearance:textfield;padding:5px 0}.picture-width-input>span{font-size:11px;color:var(--studio-muted)}.picture-options #removeTracingPicture{align-self:flex-start;min-height:32px;font-size:12px;padding:6px 10px}
.tracing-picture-status{position:fixed;z-index:80;left:50%;bottom:22px;max-width:min(560px,calc(100vw - 32px));width:max-content;margin:0;padding:12px 18px;border:1px solid #c5d8cf;border-radius:10px;background:#fff;color:var(--studio-ink);box-shadow:0 5px 24px #163d5024;font-size:13px;line-height:1.5;transform:translate(-50%,12px);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s,transform .15s,visibility .15s}.tracing-picture-status[data-visible=true]{opacity:1;visibility:visible;transform:translate(-50%,0)}
.tracing-pages{flex:none;min-height:0;display:flex;flex-direction:column;align-items:flex-start;gap:24px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:22px;background:var(--studio-mat);border:1px solid #d5e0d3;border-radius:12px}.tracing-sheet{display:block;flex:none;width:var(--preview-paper-width,100%);height:auto;max-width:none;margin:0 auto;background:white;box-shadow:0 2px 5px #163d500d,0 10px 28px #163d5012}.tracing-sheet text{font-kerning:normal;font-variant-ligatures:none}.tracing-empty{margin:90px 24px;text-align:center;color:var(--studio-muted);font-size:14px;line-height:1.7;align-self:center}
.worksheet-picture{cursor:grab;touch-action:none;outline:none}.worksheet-picture:active{cursor:grabbing}.picture-selection{stroke:var(--studio-accent);stroke-width:1.5;vector-effect:non-scaling-stroke;pointer-events:none;visibility:hidden}.picture-handle{fill:#fff;stroke:var(--studio-accent);stroke-width:1.5;vector-effect:non-scaling-stroke;visibility:hidden;cursor:nwse-resize}.picture-handle[data-picture-handle=ne],.picture-handle[data-picture-handle=sw]{cursor:nesw-resize}.worksheet-picture.is-selected .picture-selection,.worksheet-picture.is-selected .picture-handle,.worksheet-picture:focus-visible .picture-selection{visibility:visible}

.background-current{display:flex;align-items:center;gap:12px;width:100%;min-height:66px;padding:10px 12px;background:#fff;border:1px solid #c6d5ce;border-radius:8px;text-align:left;cursor:pointer;color:var(--studio-ink);font:inherit}.background-current:hover{background:var(--studio-tint);border-color:#8fb3a6}.background-current>span:nth-child(2){flex:1;min-width:0}.background-current strong{display:block;font-family:inherit;font-weight:800;font-size:14px;line-height:1.4}.background-change{display:block;font-size:11px;color:var(--studio-muted);margin-top:3px}#currentBackgroundSwatch{display:block;width:31px;height:44px;flex-shrink:0;border:1px solid var(--studio-line);overflow:hidden;box-shadow:0 1px 4px #163d5008}#currentBackgroundSwatch svg{width:100%;height:100%;display:block}
.background-dialog,.worksheet-file-dialog{width:min(860px,calc(100vw - 32px));max-height:calc(100dvh - 40px);border:1px solid var(--studio-line);border-radius:16px;padding:24px;background:#fff;color:var(--studio-ink);box-shadow:0 16px 60px #23364b30;overflow:auto}.background-dialog::backdrop,.worksheet-file-dialog::backdrop{background:#24394b60}.background-dialog-heading,.file-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.background-dialog-heading{position:sticky;top:-24px;background:white;padding-block:6px;z-index:2}.background-dialog-heading h2,.file-dialog-heading h2{font-size:22px;line-height:1.3;margin:0;font-weight:800}.background-dialog-heading button{display:grid;place-items:center;width:36px;height:36px;padding:8px;background:#fff;border:1px solid var(--studio-line);border-radius:7px;color:var(--studio-muted);cursor:pointer}.background-dialog-intro{font-size:13px;color:var(--studio-muted);line-height:1.6;margin:14px 0 18px}.background-dialog h3{font-size:12px;font-weight:800;line-height:1.5;color:var(--studio-muted);margin:24px 0 10px}
.background-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.background-choice{position:relative;display:flex;flex-direction:column;align-items:center;gap:7px;min-width:0;padding:8px 6px;border:1px solid var(--studio-line);border-radius:8px;background:#fff;color:var(--studio-ink);cursor:pointer;font:inherit}.background-choice:hover{border-color:#9fb8c8;background:var(--studio-tint)}.background-choice[aria-pressed=true]{border-color:var(--studio-accent);box-shadow:0 0 0 1px var(--studio-accent);background:var(--studio-tint)}.background-choice[aria-pressed=true]:after{content:'✓';position:absolute;right:5px;top:5px;background:var(--studio-accent);color:#fff;font-size:10px;width:17px;height:17px;display:grid;place-items:center;border-radius:50%}.background-choice>span{font-size:11px;line-height:1.4;min-height:16px;text-align:center}.background-choice>svg{display:block;width:100%;height:72px;border-radius:3px;background:#fff;border:0;box-shadow:none}#themeBackgrounds .background-choice>svg{height:158px;box-shadow:0 1px 4px #23364b12}#plainBackgrounds .background-choice>svg{height:38px}
.worksheet-file-dialog{width:min(480px,calc(100vw - 32px))}.tracing-files{margin-top:16px}.tracing-files>summary{display:none}.tracing-files .tracing-help{font-size:13px;color:var(--studio-muted);line-height:1.6;margin:0 0 16px}.tracing-file-actions{display:flex;gap:10px;flex-wrap:wrap}.tracing-files #fileStatus{font-size:12px;line-height:1.5;margin-top:14px}
.tracing-page :is(button,a,input,textarea,select,summary):focus-visible,.tracing-page #tracingPages:focus-visible{outline:2px solid var(--studio-accent);outline-offset:3px}.tracing-page .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.tracing-page .skip-link{position:fixed;top:-100px;left:16px;z-index:100;padding:12px 18px;background:white;border-radius:8px}.tracing-page .skip-link:focus{top:12px}.tracing-page .skip-link:not(:focus){clip-path:inset(50%)}
/* The title belongs to the editing rail; the worksheet uses the otherwise empty
   space beside it. Matching the bottom and sticky gaps prevents the grid boundary
   from pushing the worksheet upward when the controls reach the end of the page. */
@media (min-width:900px){.tracing-page .tracing-main{display:grid;grid-template-columns:clamp(380px,29vw,420px) minmax(0,1fr);column-gap:24px;align-items:start;padding-bottom:16px}.studio-topline{grid-column:1;grid-row:1}.studio-heading{grid-column:1;grid-row:2}.tracing-workspace{display:contents}.tracing-controls{grid-column:1;grid-row:3}.tracing-preview{grid-column:2;grid-row:1 / span 3}}
@media (min-width:900px) and (max-width:1100px){.tracing-actions .action-label,.tracing-picture-bar .toolbar-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.tracing-actions .site-button{width:36px;padding:8px}.worksheet-save-group .file-options-trigger{width:24px;padding:0}}
/* In a very short window the complete panel cannot fit below the header; let it
   scroll normally so its page controls remain reachable. */
@media screen and (min-width:900px) and (max-height:539px){.tracing-preview{position:relative;top:auto}}
@media (max-width:899px){.tracing-page .tracing-main{padding-inline:20px}.tracing-workspace{grid-template-columns:minmax(0,1fr);gap:24px}.tracing-preview{position:relative;top:auto;height:auto}.tracing-controls{padding:24px}}
@media (max-width:620px){.tracing-page .site-header-inner{padding:12px 16px;gap:12px;flex-wrap:wrap;min-height:0}.tracing-page .site-header nav{order:3;width:100%;margin:0;gap:22px}.tracing-page .site-header nav a{font-size:12px;padding:7px 0}.tracing-page .cp-language-switch{margin-left:auto}.tracing-page .tracing-main{padding:16px 12px 32px}.studio-heading{margin-bottom:20px}.studio-heading h1{font-size:26px}.studio-heading p{font-size:13px;max-width:32em}.tracing-controls{padding:20px}.tracing-preview{padding:12px;height:auto}.tracing-preview-heading{gap:8px;min-height:42px}.worksheet-title{display:block;flex:1}.worksheet-title h2{font-size:13px}.worksheet-title p{font-size:10px;margin-top:3px}.heading-divider{display:none}.tracing-actions{gap:6px}.tracing-actions .action-label,.tracing-picture-bar .toolbar-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.tracing-actions .site-button{width:34px;min-height:36px;padding:7px}.worksheet-save-group .file-options-trigger{width:24px;padding:0}.tracing-picture-bar{gap:7px}.tracing-picture-bar button,.tracing-picture-tools summary{min-height:36px;padding:7px}.tracing-picture-tools summary>.ui-icon:last-child{display:none}.preview-scale{gap:5px}.preview-scale select{font-size:12px;padding-left:7px;padding-right:28px;max-width:145px}.preview-scale output{display:none}.toolbar-separator{margin:0}.tracing-pages{padding:14px;gap:18px}.picture-options{right:0;width:210px}.background-dialog,.worksheet-file-dialog{padding:18px;width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}.background-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}#themeBackgrounds .background-choice>svg{height:120px}#plainBackgrounds .background-choice>svg{height:32px}.background-dialog-heading{top:-18px}.background-dialog-heading h2,.file-dialog-heading h2{font-size:20px}}
@media (prefers-reduced-motion:reduce){.tracing-picture-status{transition:none}}
@media print{html,body.tracing-page{margin:0!important;padding:0!important;background:#fff!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}.tracing-page .site-header,.tracing-page .skip-link,.studio-topline,.lw-studio-switch,.studio-heading,.tracing-controls,.tracing-preview-heading,.tracing-picture-bar,.tracing-picture-status,.guide-key,.picture-selection,.picture-handle,.tracing-page noscript,.background-dialog,.worksheet-file-dialog{display:none!important}.tracing-page .tracing-main,.tracing-workspace,.tracing-preview,.tracing-pages{position:static!important;display:block!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;max-width:none!important;border:0!important;border-radius:0!important;background:#fff!important;box-shadow:none!important}.tracing-sheet{box-shadow:none!important;break-after:page;page-break-after:always;max-width:none!important;margin:0!important}.tracing-sheet:last-child{break-after:auto;page-break-after:auto}.tracing-empty{display:none!important}}

.tracing-controls .guide-help summary{display:grid;place-items:center;min-height:24px;min-width:24px;padding:0}.tracing-controls .guide-help[open]>summary>.ui-icon{transform:none}
@media(max-width:620px){.tracing-picture-bar{position:relative}.tracing-picture-tools{position:static}.picture-options{right:0;max-width:100%}}
/* An optional uncluttered reading view, with the same page selection as the editor. */
.tracing-picture-bar .expand-preview{margin-left:auto}
.tracing-preview-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;flex-shrink:0}
.paste-reminder{font-size:11px;line-height:1.5;color:var(--studio-muted);margin:0;min-width:0}
.worksheet-page-nav{display:flex;align-items:center;justify-content:center;gap:9px;flex-shrink:0}
.worksheet-page-nav[hidden]{display:none!important}
.worksheet-page-nav output{min-width:48px;text-align:center;font-size:12px;color:var(--studio-ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.worksheet-page-nav .icon-button{padding:7px;min-width:34px}
.expanded-preview-dialog{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#f7f6ef;color:var(--studio-ink);overflow:hidden}
.expanded-preview-dialog[open]{display:flex;flex-direction:column}
.expanded-preview-dialog::backdrop{background:#f7f6ef}
.expanded-preview-header{display:flex;align-items:center;gap:18px;flex-shrink:0;padding:16px 24px;background:#fff;border-bottom:1px solid var(--studio-line)}
.expanded-preview-header h2{margin:0;flex:1;min-width:0;font-size:20px;line-height:1.3}
.expanded-preview-header .icon-button{width:36px;padding:7px}
.expanded-preview-pages{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:24px;display:flex;align-items:flex-start}
.expanded-preview-pages .tracing-sheet{margin:0 auto}
.expanded-preview-footer{flex-shrink:0;padding:12px 24px;background:#fff;border-top:1px solid var(--studio-line)}
.expanded-preview-footer:has(.worksheet-page-nav[hidden]){display:none}
.tracing-page #expandedTracingPages:focus-visible{outline:2px solid var(--studio-accent);outline-offset:-3px}
@media screen{#tracingPages>.tracing-sheet[data-page-active=false]{display:none}}
@media(max-width:620px){.tracing-picture-bar{gap:4px}.tracing-preview-footer{flex-direction:column;align-items:stretch;gap:10px}.paste-reminder{font-size:11px}.worksheet-page-nav{align-self:center}.expanded-preview-header{padding:12px;gap:10px}.expanded-preview-header h2{font-size:16px}.expanded-preview-pages{padding:12px}.expanded-preview-footer{padding:10px 12px}}
@media print{.tracing-preview-footer,.expanded-preview-dialog{display:none!important}#tracingPages>.tracing-sheet{display:block!important}}

/* Copies across now sits with the page options. */
.background-section .repeat-across{margin:0 0 4px}.background-section #repeatHelp{margin:0 0 14px}
/* Phones and tablets: the worksheet sits below the settings, so a bar keeps it one tap away. */
.tracing-jump-bar{display:none}
@media (max-width:899px){
 .tracing-jump-bar:not([hidden]){display:flex;align-items:center;justify-content:space-between;gap:12px;position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:40;padding:8px 8px 8px 16px;background:#fff;border:1px solid var(--studio-line);border-radius:14px;box-shadow:0 10px 30px #1d2f4224}
 .tracing-jump-bar .jump-status{font-size:12px;color:var(--studio-muted);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .tracing-jump-bar .site-button{flex-shrink:0;min-height:40px;display:inline-flex;align-items:center;gap:8px}
 .tracing-page .tracing-main{padding-bottom:88px}
}
@media print{.tracing-jump-bar{display:none!important}}
.tracing-checkbox.is-disabled{opacity:.5}
.age-presets{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:10px 0 2px}
.words-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px}
.words-footer .tracing-help{flex:1;min-width:0;margin:0}
.section-heading-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px;margin:0 0 14px}.section-heading-row h2{margin:0}
/* Reset keeps its place while hidden, so showing it never moves the panel. */
.reset-words{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:12px;font-weight:700;line-height:1;color:#8a4500;background:#fff3df;border:1px solid #f2b35b;border-radius:999px;min-height:32px;padding:5px 12px 5px 10px;cursor:pointer;box-shadow:0 1px 2px #8a450014;transition:background .15s,border-color .15s,opacity .2s}
.reset-words .ui-icon{width:15px;height:15px;stroke-width:2.2}.reset-words:hover{background:#ffe6bf;border-color:#e0952e}.reset-words:focus-visible{outline-color:#c46a00}
.tracing-controls .section-heading-row .reset-words[hidden]{display:inline-flex!important;visibility:hidden;opacity:0}
.quick-start{position:relative;flex:none;z-index:7}
.quick-start summary{display:flex;align-items:center;gap:4px;list-style:none;cursor:pointer;white-space:nowrap;font-size:12px;font-weight:600;line-height:1.3;min-height:32px;padding:6px 10px 6px 12px;border:1px solid #c6d5ce;border-radius:999px;background:#fff;color:var(--studio-ink)}
.quick-start summary::-webkit-details-marker{display:none}.quick-start summary:hover,.quick-start[open] summary{border-color:var(--studio-accent);background:var(--studio-tint)}
.quick-start summary .ui-icon{width:15px;height:15px;transition:transform .15s}.quick-start[open] summary .ui-icon{transform:rotate(180deg)}
.quick-start-menu{position:absolute;right:0;top:calc(100% + 6px);width:220px;max-width:calc(100vw - 48px);display:flex;flex-direction:column;padding:6px;background:#fff;border:1px solid var(--studio-line);border-radius:10px;box-shadow:0 7px 24px #163d501f}
.quick-start-menu button{font:inherit;font-size:13px;display:flex;align-items:baseline;justify-content:space-between;gap:10px;width:100%;min-height:36px;padding:8px 10px;border:0;border-radius:7px;background:transparent;color:var(--studio-ink);text-align:left;cursor:pointer}
.quick-start-menu button:hover,.quick-start-menu button:focus-visible{background:var(--studio-tint)}.quick-start-menu small{font-size:11px;color:var(--studio-muted);white-space:nowrap}
.quick-start-heading{font-size:11px;font-weight:700;color:var(--studio-muted);margin:6px 10px 2px;padding-top:8px;border-top:1px solid #e5ebe1}
.words-footer{min-height:36px}
/* The set changer replaces the help text in the same row, so it appears without moving anything. */
.set-nav{display:flex;align-items:center;gap:6px;flex:1;min-width:0}
.set-nav>span{font-size:12px;font-weight:600;color:var(--studio-ink);white-space:nowrap;font-variant-numeric:tabular-nums}
.set-previous,.set-next{font:inherit;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;gap:3px;min-height:32px;border-radius:999px;cursor:pointer;flex:none}
.set-previous{width:32px;padding:0;border:1px solid #c6d5ce;background:#fff;color:var(--studio-ink)}
.set-next{padding:5px 8px 5px 12px;border:1px solid var(--studio-accent);background:var(--studio-accent);color:#fff;white-space:nowrap}
.set-previous:hover{border-color:var(--studio-accent);background:var(--studio-tint)}.set-next:hover{filter:brightness(1.1)}
.set-previous:disabled,.set-next:disabled{opacity:.45;cursor:default}
.set-previous .ui-icon,.set-next .ui-icon{width:15px;height:15px}
@media (max-width:370px){.set-next{width:32px;padding:0}.set-next span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}}
.tracing-controls #tracingText{tab-size:4;height:calc(9.6em + 18px)}
.chip-label{font-size:11px;font-weight:700;color:var(--studio-muted);margin-right:2px}
.tracing-controls .chip{font:inherit;font-size:12px;font-weight:600;line-height:1.3;min-height:32px;padding:6px 12px;border:1px solid #c6d5ce;border-radius:999px;background:#fff;color:var(--studio-ink);cursor:pointer;transition:background .15s,border-color .15s}
.tracing-controls .chip:hover{border-color:var(--studio-accent);background:var(--studio-tint)}
.tracing-controls .chip:focus-visible{outline:2px solid var(--studio-accent);outline-offset:2px}
.tracing-controls .chip[aria-pressed=true]{background:var(--studio-accent);border-color:var(--studio-accent);color:#fff}

.age-presets{margin:12px 0 4px}
@media (prefers-reduced-motion:reduce){.tracing-controls .chip{transition:none}}
/* Dotted tracing: small previews show a scaled-up copy of the dot pattern; print shows the real one. */
.tracing-sheet .screen-dots{display:none}
@media screen{.tracing-sheet .dots-scaled>.screen-dots{display:inline}.tracing-sheet .dots-scaled>.print-dots{display:none}}
/* 5.243: the whole word list in one PDF, beside Next set. */
.set-all{font:inherit;font-size:11.5px;font-weight:700;min-height:32px;padding:0 10px;border:1px solid #b7d0ca;border-radius:999px;background:#fff;color:var(--studio-accent,#155f69);cursor:pointer;flex:none;white-space:nowrap}
.set-all:hover:not(:disabled){background:#eef7f4}
.set-all[hidden]{display:none}
.set-all:disabled{opacity:.55;cursor:default}
#patternHelp{margin-top:6px}

/* WeChat and other app browsers block printing and downloads (js/print-inapp-note.js). */
.print-inapp-note{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:10px 0 4px;padding:10px 12px;border:1px solid #e8c46a;border-radius:10px;background:#fff8e6;color:#4f3b00;font-size:.92rem;line-height:1.45}
.print-inapp-note .print-inapp-text{flex:1 1 260px}
.print-inapp-note .site-button{min-height:34px;padding:4px 12px}
.print-inapp-note .print-inapp-copied{font-weight:600}
@media print{.print-inapp-note{display:none!important}}

/* Source: css/reading-studio.css */
/* Reading Studio (/reading): calm 2-step printable reading worksheet studio.
   Inherits warm stationery palette and studio primitives from css/tracing.css. */

/* Full-width studio topline so 4 studio tabs never clip beside the preview rail */
@media (min-width: 900px) {
  body.reading-studio-page .tracing-main {
    display: block;
    max-width: 1264px;
    padding-bottom: 36px;
  }
  body.reading-studio-page .studio-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  body.reading-studio-page .studio-heading {
    margin-bottom: 16px;
  }
  body.reading-studio-page .reading-workspace {
    display: grid;
    grid-template-columns: clamp(360px, 31vw, 412px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  /* Override tracing.css grid-row: 3 so the 2-step sidebar always stays flush at top */
  body.reading-studio-page .reading-controls {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }
  body.reading-studio-page .reading-preview {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--site-header-height, 72px) + 14px);
  }
}

.reading-controls .studio-section { padding-bottom: 18px; }
.reading-controls .tracing-essentials { gap: 18px; }
.reading-controls .section-heading-row { margin-bottom: 12px; }
.reading-controls textarea { min-height: 112px; font-size: 13.5px; line-height: 1.55; }

/* Quick start menu */
.rs-quickstart { position: relative; }
.rs-quickstart summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #c6d8d3;
  border-radius: 8px;
  background: #f3faf7;
  color: var(--studio-accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.rs-quickstart summary:hover { background: #e6f3ef; border-color: var(--studio-accent); }
.rs-quickstart .quick-start-menu {
  position: absolute;
  right: 0;
  top: 36px;
  z-index: 25;
  width: 286px;
  max-width: calc(100vw - 44px);
  padding: 6px;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(22, 61, 80, .18);
  display: grid;
  gap: 2px;
}
.rs-quickstart .quick-start-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--studio-ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.rs-quickstart .quick-start-menu button:hover { background: #edf5f2; color: var(--studio-accent); }
.rs-quickstart .quick-start-menu button small {
  font-size: 11px;
  font-weight: 700;
  color: var(--studio-muted);
  white-space: nowrap;
}

/* Segmented tab switcher (Paste or scan | Write with AI) */
.rs-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #e9f1ed;
}
.rs-segmented button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: transparent;
  color: var(--studio-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .14s, color .14s, box-shadow .14s;
}
.rs-segmented button[aria-selected="true"] {
  background: #fff;
  color: var(--studio-accent);
  box-shadow: 0 1px 4px rgba(23, 59, 67, .12);
}

.rs-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
}
.rs-field-head label { margin: 0 !important; }
.rs-field-head-tight { margin-top: 10px; }
.rs-wcount { font-size: 11.5px; font-weight: 700; color: var(--studio-muted); }

.rs-quiet-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid #c2d6d1;
  border-radius: 8px;
  background: #f1f8f6;
  color: var(--studio-accent);
  font: inherit;
  font-size: 11.8px;
  font-weight: 700;
  cursor: pointer;
}
.rs-quiet-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rs-quiet-btn:hover:not(:disabled) { background: #e2f1ed; border-color: var(--studio-accent); }
.rs-quiet-btn:disabled { opacity: .5; cursor: default; }

.rs-chip-row, .rs-refine-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.rs-chip-row { margin: 7px 0 10px; }
.rs-refine-bar { margin-top: 10px; padding-top: 9px; border-top: 1px dashed #dde6e0; }
.rs-refine-label { font-size: 11.5px; font-weight: 700; color: var(--studio-muted); margin-right: 2px; }
.rs-chip {
  padding: 4px 10px;
  border: 1px solid #cbd9d4;
  border-radius: 999px;
  background: #fff;
  color: #2b4a4e;
  font: inherit;
  font-size: 11.8px;
  font-weight: 700;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
}
.rs-chip:hover:not(:disabled) { background: #edf6f3; border-color: var(--studio-accent); color: var(--studio-accent); }
.rs-chip.is-active { background: var(--studio-accent); border-color: var(--studio-accent); color: #fff; }
.rs-undo-link {
  margin-left: auto;
  padding: 2px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--studio-accent);
  font: inherit;
  font-size: 11.8px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* Auto-saved draft indicator + Clear blank link in Step 01 */
.rs-draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  margin: -3px 0 6px;
  font-size: 11px;
  color: var(--studio-muted);
}
.rs-draft-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: #196b59;
}
.rs-draft-dot[hidden] { display: none !important; }
.rs-draft-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22997c;
}
.rs-clear-link {
  margin-left: auto;
  padding: 2px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #8a4a3f;
  font: inherit;
  font-size: 11.2px;
  font-weight: 700;
  cursor: pointer;
}
.rs-clear-link:hover { background: #fceee9; color: #742c21; }

/* Step 02 Questions: compact expandable multi-select dropdown with per-row count */
.rs-type-field { margin-bottom: 10px; }
.rs-type-field > label { margin: 0 0 6px !important; }
.rs-type-menu { position: relative; }
.rs-type-menu > summary { list-style: none; }
.rs-type-menu > summary::-webkit-details-marker { display: none; }
.rs-type-trigger {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 39px !important;
  padding: 6px 10px !important;
  border: 1px solid #c6d5ce;
  border-radius: 8px;
  background: #fff;
  color: var(--studio-ink) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.rs-type-trigger:hover { border-color: #8fb3a6; background: #fbfdfb; }
.rs-type-menu[open] > .rs-type-trigger {
  border-color: var(--studio-accent);
  background: #f5fbf9;
  box-shadow: 0 0 0 2px rgba(21, 95, 105, .14);
}
.rs-type-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #163b42;
}
.rs-type-total {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e6f4f0;
  color: var(--studio-accent);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.rs-type-caret {
  width: 16px !important;
  height: 16px !important;
  color: var(--studio-muted);
  transition: transform .15s;
}
.rs-type-menu[open] .rs-type-caret { transform: rotate(180deg); color: var(--studio-accent); }

.rs-type-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 45;
  max-height: min(440px, calc(100vh - 36px));
  overflow-y: auto;
  border: 1px solid var(--studio-accent);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(22, 61, 80, .18);
}
.rs-type-menu.open-up .rs-type-pop {
  top: auto;
  bottom: calc(100% + 5px);
  box-shadow: 0 -12px 32px rgba(22, 61, 80, .16);
}
.rs-ms-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px 4px;
  background: #f3f7f5;
  border-bottom: 1px solid #e3ece8;
  font-size: 10.5px;
  font-weight: 800;
  color: #5a7478;
}
.rs-ms-group:not(:first-child) { border-top: 1px solid #dde7e2; }
.rs-ms-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 33px;
  padding: 4px 8px 4px 10px;
  border-bottom: 1px solid #edf2ef;
  cursor: pointer;
  user-select: none;
  transition: background .11s;
}
.rs-ms-row:hover { background: #f6fbf9; }
.rs-ms-row.is-on { background: #edf7f4; }
.rs-ms-row input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  margin: 0;
  accent-color: var(--studio-accent);
  cursor: pointer;
}
.rs-ms-row input[type="checkbox"]:disabled { opacity: .65; cursor: default; }
.rs-ms-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.2px;
  font-weight: 600;
  color: #466064;
}
.rs-ms-row.is-on .rs-ms-name { font-weight: 700; color: #143b42; }
.rs-ms-name small {
  margin-left: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #6b8488;
}
.rs-ms-step {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 2px;
  border: 1px solid #bdd4cd;
  border-radius: 6px;
  background: #fff;
}
.rs-ms-step button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #e9f5f1;
  color: var(--studio-accent);
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.rs-ms-step button:hover:not(:disabled) { background: #d4ece4; }
.rs-ms-step button:disabled { opacity: .35; cursor: default; }
.rs-ms-step span {
  min-width: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #143b42;
  font-variant-numeric: tabular-nums;
}
.rs-ms-off {
  padding-right: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #a6b9bb;
}
.rs-ms-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f7faf8;
  border-top: 1px solid #dde7e2;
  font-size: 11px;
  font-weight: 700;
  color: var(--studio-muted);
}
.rs-ms-done {
  padding: 3px 10px;
  border: 1px solid var(--studio-accent);
  border-radius: 6px;
  background: var(--studio-accent);
  color: #fff;
  font: inherit;
  font-size: 11.2px;
  font-weight: 700;
  cursor: pointer;
}
.rs-ms-done:hover { background: #104d55; }

.rs-pop-files {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #e5ebe4;
}
.rs-pop-files .rs-quiet-btn { flex: 1; justify-content: center; }

/* Preview heading flex row + screen-only Answers: On/Off pill */
.rs-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.rs-title-row .rs-preview-badge { margin-left: 0; }
.rs-ans-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1px solid #c3d7d1;
  border-radius: 999px;
  background: #fff;
  color: #466367;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}
.rs-ans-pill:hover { border-color: var(--studio-accent); color: var(--studio-accent); background: #f2f9f7; }
.rs-ans-pill[aria-pressed="true"] {
  border-color: var(--studio-accent);
  background: var(--studio-accent);
  color: #fff;
}
.rs-ans-pill svg { width: 12.5px; height: 12.5px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Screen-only live answers highlight on Student sheet (100% hidden in @media print!) */
.rs-show-answers .rs-opt-circle.is-live-answer,
.rs-show-answers .rs-tf-box.is-live-answer,
.rs-show-answers .rs-ans-box.is-live-answer {
  background: #155f69;
  border-color: #155f69;
  color: #fff;
  box-shadow: 0 0 0 2px #d3ece6;
}
.rs-show-answers.is-exam .rs-opt-circle.is-live-answer,
.rs-show-answers.is-exam .rs-tf-box.is-live-answer,
.rs-show-answers.is-exam .rs-ans-box.is-live-answer {
  background: #111;
  border-color: #111;
  color: #fff;
  box-shadow: 0 0 0 2px #ddd;
}
.rs-live-ans-hint {
  display: inline-block;
  margin-left: 3px;
  padding: 0 5px;
  border-radius: 4px;
  background: #e1f3ec;
  color: #0f525b;
  font-size: 11px;
  font-weight: 800;
}
.rs-live-ans-text { display: inline; }

/* Optional 5-line passage margin numbers (1, 5, 10...) */
.rs-passage-body { position: relative; }
.rs-passage-body.has-line-nums { padding-left: 26px; }
.rs-line-mark {
  position: absolute;
  left: 0;
  width: 20px;
  text-align: right;
  font-size: 9.8px;
  font-weight: 700;
  color: #7c9497;
  font-family: system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.rs-sheet.is-exam .rs-line-mark { color: #555; }

/* Compact Teacher Answer Key with passage evidence notes */
.rs-compact-key-list { display: grid; gap: 10px; }
.rs-ck-part {
  padding: 9px 12px;
  border: 1px solid #d7e4e0;
  border-radius: 8px;
  background: #fafcfa;
}
.rs-ck-part h4 {
  margin: 0 0 6px;
  font-size: 12.6px;
  font-weight: 800;
  color: #155f69;
}
.rs-ck-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  font-size: 12.2px;
}
.rs-ck-chip {
  padding: 2px 8px;
  border: 1px solid #cde0da;
  border-radius: 5px;
  background: #fff;
  color: #163b41;
  font-weight: 700;
}
.rs-ck-rows { display: grid; gap: 5px; font-size: 12.2px; line-height: 1.45; }
.rs-ck-row { display: flex; gap: 7px; align-items: baseline; }
.rs-ck-ans { flex: none; font-weight: 800; color: #155f69; min-width: 44px; }
.rs-ck-ev { color: #476266; font-size: 11.6px; }
.rs-sheet.is-exam .rs-ck-part { background: #fff; border-color: #bbb; border-radius: 2px; }
.rs-sheet.is-exam .rs-ck-part h4, .rs-sheet.is-exam .rs-ck-ans { color: #111; }

/* Optional Student Answer Box strip for fast grading */
.rs-grading-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 7px 11px;
  margin-top: 12px;
  border: 1.3px solid #c5dbd5;
  border-radius: 8px;
  background: #f5faf8;
  font-size: 11.8px;
  font-weight: 700;
  color: #16444a;
}
.rs-sheet.is-exam .rs-grading-strip { background: #fafafa; border-color: #888; border-radius: 2px; color: #111; }

.rs-gen-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  margin-bottom: 10px;
  border-radius: 9px;
  background: #e9f1ed;
}
.rs-gen-mode[hidden] { display: none !important; }
.rs-gen-mode button {
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--studio-muted);
  font: inherit;
  font-size: 11.8px;
  font-weight: 700;
  cursor: pointer;
}
.rs-gen-mode button[aria-checked="true"] {
  background: #fff;
  color: var(--studio-accent);
  box-shadow: 0 1px 3px rgba(23, 59, 67, .12);
}

.rs-inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
}
.rs-inline-checks .tracing-checkbox { margin: 0 !important; }

/* Page & style popover in preview toolbar */
.rs-page-menu { position: relative; }
.rs-page-menu summary { list-style: none; }
.rs-page-menu summary::-webkit-details-marker { display: none; }
.rs-page-menu[open] .rs-page-trigger {
  background: #eaf5f1 !important;
  border-color: var(--studio-accent) !important;
  color: var(--studio-accent) !important;
}
.rs-page-pop {
  position: absolute;
  right: 0;
  top: 42px;
  z-index: 35;
  width: 348px;
  max-width: calc(100vw - 32px);
  padding: 14px 16px;
  border: 1px solid var(--studio-line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(22, 61, 80, .2);
}
.rs-pop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
}
.rs-pop-grid label {
  display: block;
  margin: 0 0 4px !important;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--studio-muted);
}
.rs-pop-grid select {
  width: 100%;
  min-height: 34px;
  padding: 5px 28px 5px 9px;
  font-size: 12.5px;
}
.rs-pop-checks {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #e5ebe4;
}
.rs-pop-checks .tracing-checkbox {
  margin: 0 !important;
  font-size: 12.2px;
}
.rs-pop-checks input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--studio-accent); }

/* Section + Write / +1 AI action pair */
.rs-add-pair { display: inline-flex; align-items: center; gap: 5px; }
.rs-add-ai-btn {
  padding: 2px 8px;
  border: 1px solid #9cc3ba;
  border-radius: 6px;
  background: #e8f5f1;
  color: #11555e;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.rs-add-ai-btn:hover:not(:disabled) { background: #d6ede6; border-color: var(--studio-accent); }
.rs-add-ai-btn:disabled { opacity: .45; cursor: default; }

/* Discrete continuation page header (real Page 2+ card) */
.rs-page-cont-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 7px;
  margin-bottom: 12px;
  border-bottom: 1px solid #dbe4e1;
  font-size: 11.5px;
  font-weight: 700;
  color: #5d767a;
}
.rs-sheet.is-exam .rs-page-cont-head { border-bottom-color: #999; color: #333; }

.rs-level-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 0 0 11px; }
.rs-level-row label { margin: 0 !important; white-space: nowrap; }
.rs-stale-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border: 1px solid #e6cfa1;
  border-radius: 10px;
  background: #fff9ec;
  color: #78500b;
  font-size: 12.2px;
  font-weight: 600;
}
.rs-stale-banner[hidden] { display: none !important; }

.rs-gen-row { display: flex; align-items: center; gap: 8px; }
.rs-mt { margin-top: 12px; }
.rs-primary-btn {
  flex: 1;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--studio-accent);
  border-radius: 10px;
  background: linear-gradient(180deg, #1b7682 0%, #155f69 100%);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(21, 95, 105, .2);
}
.rs-primary-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rs-primary-btn:hover:not(:disabled) { background: #104d55; border-color: #104d55; }
.rs-primary-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.rs-primary-btn.is-secondary {
  background: #f2f8f6;
  color: var(--studio-accent);
  border-color: #b7d0ca;
  box-shadow: none;
}
.rs-primary-btn.is-secondary:hover:not(:disabled) { background: #e3f2ee; border-color: var(--studio-accent); }
.rs-ai-after-note { margin: 7px 0 0 !important; font-size: 11.5px !important; }
.rs-check.is-dimmed { opacity: .52; }

.rs-status {
  margin: 9px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef7f4;
  border: 1px solid #c5ddd6;
  color: #154f56;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}
.rs-status[data-tone="error"] { background: #fdf1ef; border-color: #e6c2bc; color: #9c2f24; }
.rs-status[data-tone="ok"] { background: #eaf7ef; border-color: #badfc7; color: #16603c; }
.rs-status a { color: inherit; font-weight: 800; text-decoration: underline; }
.rs-plan-note { margin-top: 6px !important; }
.rs-check { margin-top: 10px !important; }

/* Preview header & Play as game menu */
.rs-preview-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e6f4f0;
  color: var(--studio-accent);
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}
.rs-game-menu { position: relative; }
.rs-game-menu summary { list-style: none; }
.rs-game-menu summary::-webkit-details-marker { display: none; }
.rs-game-trigger {
  border-color: #9ec0b7 !important;
  background: #eef7f4 !important;
  color: var(--studio-accent) !important;
}
.rs-game-trigger:hover { background: #dff0eb !important; border-color: var(--studio-accent) !important; }
.rs-game-pop {
  position: absolute;
  right: 0;
  top: 42px;
  z-index: 30;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--studio-line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(22, 61, 80, .18);
  display: grid;
  gap: 2px;
}
.rs-game-pop button {
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--studio-ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.rs-game-pop button:hover { background: #edf6f3; color: var(--studio-accent); }

/* Sub-toolbar above sheet */
.rs-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.rs-copy-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rs-copy-tabs button[role="tab"] {
  padding: 5px 12px;
  border: 1px solid #c4d7d2;
  border-radius: 999px;
  background: #fff;
  color: #3d5a5e;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.rs-copy-tabs button[aria-selected="true"] {
  background: var(--studio-accent);
  border-color: var(--studio-accent);
  color: #fff;
}
.rs-cloze-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--studio-muted);
}

/* Printable sheet surface inside preview mat */
.rs-sheet-host {
  max-height: calc(100dvh - 205px);
  align-items: center;
}
.rs-sheet {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: #fff;
  color: #182b30;
  border: 1px solid #d5dfdb;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(22, 61, 80, .08), 0 12px 30px rgba(22, 61, 80, .09);
  padding: 28px 34px 26px;
  font-family: "ClassPlay Round", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.rs-sheet.is-mono { filter: grayscale(1); }
.rs-sheet.rs-sheet-cont { padding-top: 22px; }

/* Cambridge Exam paper (B&W editorial style) */
.rs-sheet.is-exam {
  color: #111;
  font-family: Georgia, "Times New Roman", "PingFang SC", serif;
}
.rs-sheet.is-exam .rs-sheet-title,
.rs-sheet.is-exam .rs-instruction,
.rs-sheet.is-exam .rs-section h4,
.rs-sheet.is-exam .rs-passage-card-head,
.rs-sheet.is-exam .rs-q-num,
.rs-sheet.is-exam .rs-wf-caps-col,
.rs-sheet.is-exam .rs-wf-example strong,
.rs-sheet.is-exam .rs-blank-num { color: #111; }
.rs-sheet.is-exam .rs-sheet-top { border-bottom-color: #222; }
.rs-sheet.is-exam .rs-passage-card {
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 2px;
}
.rs-sheet.is-exam .rs-para { font-size: 13.4px; line-height: 1.62; color: #111; }
.rs-sheet.is-exam .rs-tf-item,
.rs-sheet.is-exam .rs-match-row,
.rs-sheet.is-exam .rs-mc-cloze-item,
.rs-sheet.is-exam .rs-sent-item,
.rs-sheet.is-exam .rs-vocab-row {
  background: #fff;
  border-color: #d4d4d4;
  border-radius: 2px;
}
.rs-sheet.is-exam .rs-wordbank,
.rs-sheet.is-exam .rs-answer-strip,
.rs-sheet.is-exam .rs-wf-example {
  background: #fafafa;
  border-color: #888;
  border-radius: 2px;
}
.rs-sheet.is-exam .rs-opt-circle,
.rs-sheet.is-exam .rs-tf-box,
.rs-sheet.is-exam .rs-ans-box,
.rs-sheet.is-exam .rs-para-letter,
.rs-sheet.is-exam .rs-sent-letter,
.rs-sheet.is-exam .rs-gap-slot {
  background: #fff;
  border-color: #333;
  color: #111;
  font-family: system-ui, -apple-system, sans-serif;
}
.rs-sheet.is-exam .rs-opt-circle.is-answer-key,
.rs-sheet.is-exam .rs-tf-box.is-answer-key,
.rs-sheet.is-exam .rs-ans-box.is-answer-key,
.rs-sheet.is-exam .rs-key-banner,
.rs-sheet.is-exam .rs-gap-tag {
  background: #111;
  border-color: #111;
  color: #fff;
}
.rs-sheet.is-exam .rs-blank-token { background: #fff; border-bottom-color: #111; color: #111; }
.rs-sheet.is-exam .rs-blank-key,
.rs-sheet.is-exam .rs-gap-filled,
.rs-sheet.is-exam .rs-wf-ex-ans { background: #efefef; border-bottom-color: #111; color: #111; }
.rs-sheet.is-exam .rs-sa-key { background: #f4f4f4; border-left-color: #111; color: #111; }

/* Compact spacing mode (fits borderline 1.1-page worksheets cleanly on 1 page) */
.rs-sheet.is-compact { padding: 20px 26px 18px; }
.rs-sheet.is-compact .rs-sheet-top { padding-bottom: 7px; margin-bottom: 9px; }
.rs-sheet.is-compact .rs-sheet-title { font-size: 18.5px; margin-bottom: 5px; }
.rs-sheet.is-compact .rs-instruction { margin-bottom: 7px; font-size: 12px; }
.rs-sheet.is-compact .rs-passage-card { padding: 9px 13px; margin-bottom: 8px; }
.rs-sheet.is-compact .rs-para { font-size: 12.4px; line-height: 1.5; margin-bottom: 5px; }
.rs-sheet.is-compact .rs-glossary,
.rs-sheet.is-compact .rs-wordbank { padding: 5px 9px; margin-bottom: 8px; }
.rs-sheet.is-compact .rs-section { margin-bottom: 9px; }
.rs-sheet.is-compact .rs-section-head { margin-bottom: 5px; }
.rs-sheet.is-compact .rs-mc-list { gap: 6px 16px; }
.rs-sheet.is-compact .rs-mc-opts { gap: 3px; }
.rs-sheet.is-compact .rs-tf-list,
.rs-sheet.is-compact .rs-match-list,
.rs-sheet.is-compact .rs-sent-list { gap: 4px; }
.rs-sheet.is-compact .rs-tf-item,
.rs-sheet.is-compact .rs-match-row,
.rs-sheet.is-compact .rs-sent-item { padding: 4px 8px; font-size: 12px; }
.rs-sheet.is-compact .rs-sa-list { gap: 6px; }
.rs-sheet.is-compact .rs-line-single { height: 19px; }
.rs-sheet-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 11px;
  margin-bottom: 13px;
  border-bottom: 1.5px solid #d7e2de;
}
.rs-sheet-head-main { flex: 1; min-width: 0; }
.rs-sheet-title {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.25;
  color: #14373e;
  letter-spacing: -.3px;
}
.rs-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  font-size: 12.5px;
  color: #3f585c;
}
.rs-meta-field {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.rs-fill-line {
  display: inline-block;
  width: 118px;
  border-bottom: 1.2px solid #8ea6a9;
  height: 1px;
  transform: translateY(-1px);
}
.rs-fill-line.is-short { width: 72px; }
.rs-fill-line.is-mid { width: 88px; }

.rs-score-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 78px;
  height: 46px;
  padding: 5px 9px;
  border: 1.4px solid #7d9699;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: #556e72;
  flex: none;
  box-sizing: border-box;
}
.rs-score-total {
  display: block;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: #5f7a7e;
  line-height: 1;
}
.rs-instruction {
  margin: 0 0 10px;
  font-size: 12.8px;
  font-weight: 700;
  color: #155f69;
  line-height: 1.45;
}

/* Passage box on sheet */
.rs-passage-card {
  padding: 13px 16px;
  margin-bottom: 12px;
  border: 1.5px solid #c3d8d2;
  border-radius: 10px;
  background: #fafcfa;
}
.rs-passage-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: #16494c;
}
.rs-passage-level { font-size: 11px; font-weight: 700; color: #5c7578; }
.rs-para {
  display: flex;
  gap: 9px;
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.66;
  color: #1d3439;
}
.rs-para:last-child { margin-bottom: 0; }
.rs-para-num {
  flex: none;
  min-width: 22px;
  font-size: 11px;
  font-weight: 800;
  color: #7c9699;
  padding-top: 2px;
}
.rs-para-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.4px solid #155f69;
  border-radius: 5px;
  background: #edf7f4;
  color: #155f69;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
}
.rs-para-text { flex: 1; min-width: 0; }
/* Optional bold target words (never default hyperlink-looking underlines!) */
.rs-target-word {
  font-weight: 800;
  color: #124850;
}

/* Click-to-blank interactive tokens in Cloze mode:
   Zero horizontal padding so natural typography and punctuation spacing stay exact! */
.rs-word-btn {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.rs-word-btn:hover {
  background: #dff1ec;
  color: #0f4c54;
  box-shadow: 0 0 0 2px #dff1ec;
}
.rs-nowrap { white-space: nowrap; }
.rs-nowrap > .rs-blank-token { margin-right: 0; }
.rs-nowrap > .rs-blank-key { padding-right: 2px; margin-right: 0; }
/* Single crisp writing line aligned to text baseline */
.rs-blank-token {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  min-width: 78px;
  padding: 0 4px 1px;
  margin: 0 1px;
  border: 0;
  border-bottom: 1.5px solid #155f69;
  border-radius: 3px 3px 0 0;
  background: #eef7f4;
  color: #467075;
  font: inherit;
  line-height: 1.25;
  vertical-align: baseline;
  cursor: pointer;
}
.rs-blank-token.is-static { cursor: default; }
.rs-blank-num {
  font-size: 10.5px;
  font-weight: 800;
  color: #155f69;
  opacity: .88;
}
.rs-blank-token:not(.is-static):hover { background: #fbe9e7; border-bottom-color: #b54035; }
.rs-blank-token:not(.is-static):hover .rs-blank-num { color: #9c2f24; }
.rs-blank-key {
  display: inline;
  white-space: nowrap;
  padding: 0 4px 1px;
  border-bottom: 1.5px solid #155f69;
  background: #e5f5ee;
  color: #11583e;
  font-weight: 800;
  border-radius: 3px 3px 0 0;
}
.rs-root-word {
  margin-left: 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #155f69;
}

/* Gapped text inline sentence slot & answer highlight */
.rs-gap-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 21px;
  margin: 0 3px;
  padding: 0 8px;
  border: 1.5px solid #155f69;
  border-radius: 5px;
  background: #edf7f4;
  color: #155f69;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}
.rs-gap-filled {
  background: #e6f6ef;
  border-bottom: 1.5px solid #155f69;
  color: #114e41;
  padding: 0 3px;
  border-radius: 3px;
}
.rs-gap-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: #155f69;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}

/* Word bank & Glossary strip */
.rs-wordbank {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1.5px solid #bed6d0;
  border-radius: 9px;
  background: #f3f9f7;
  font-size: 12.5px;
}
.rs-wordbank strong { color: #155f69; margin-right: 4px; }
.rs-wb-item {
  padding: 2px 10px;
  border: 1px solid #c3d8d2;
  border-radius: 6px;
  background: #fff;
  color: #173b43;
  font-weight: 700;
}
.rs-glossary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 5px 9px;
  margin-bottom: 11px;
  border: 1px dashed #d4ccb6;
  border-radius: 8px;
  background: #fbf8f0;
  font-size: 11.6px;
  color: #4a5f61;
}
.rs-glossary-label { color: #17494b; font-weight: 800; margin-right: 1px; }
.rs-gloss-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border: 1px solid #e7e0cb;
  border-radius: 5px;
  background: #fffdf7;
}
.rs-glossary .rs-add-btn { padding: 1px 7px; font-size: 11px; line-height: 1.3; }
.rs-gloss-item b { color: #163f44; }
.rs-gloss-zh { color: #566d70; }
.rs-gloss-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0;
  overflow: hidden;
  height: 15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9ba8a5;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: width .12s, opacity .12s;
}
.rs-gloss-item:hover .rs-gloss-del,
.rs-gloss-del:focus-visible { width: 15px; opacity: 1; }
.rs-gloss-del:hover { background: #fceae8; color: #a32f25; }

/* Question sections — crisp shared left rail across Part A, B, C */
.rs-section { margin-bottom: 14px; }
.rs-section:last-child { margin-bottom: 0; }
.rs-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
}
.rs-section h4 {
  margin: 0;
  font-size: 13.4px;
  font-weight: 800;
  color: #155f69;
}
.rs-add-btn {
  padding: 2px 8px;
  border: 1px dashed #a7c5be;
  border-radius: 6px;
  background: transparent;
  color: #155f69;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.rs-add-btn:hover { background: #ebf6f3; border-style: solid; }

.rs-mc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; }
.rs-mc-card {
  position: relative;
  padding: 4px 4px 5px 0;
  border: 1px solid transparent;
  border-radius: 7px;
}
.rs-mc-card:hover, .rs-tf-item:hover, .rs-sa-item:hover, .rs-match-row:hover, .rs-mc-cloze-item:hover, .rs-vocab-row:hover {
  border-color: #d6e4e0;
  background: #fbfdfb;
}
.rs-q-stem {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 6px;
  font-size: 12.8px;
  font-weight: 700;
  line-height: 1.4;
  color: #182f34;
}
.rs-q-num { flex: none; font-weight: 800; color: #163b41; }
.rs-mc-opts { display: grid; gap: 5px; padding-left: 16px; }
.rs-mc-opt {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.3px;
  line-height: 1.42;
  color: #2b454a;
}
/* Pixel-centered option circle (padding: 0 prevents browser button squash!) */
.rs-opt-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border: 1.3px solid #7f9ea1;
  border-radius: 50%;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: #3f5d61;
  flex: none;
  cursor: pointer;
  background: #fff;
}
.rs-opt-circle.is-answer-key {
  background: #155f69;
  border-color: #155f69;
  color: #fff;
}

/* True / False rows */
.rs-tf-list { display: grid; gap: 6px; }
.rs-tf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid #e3ece9;
  border-radius: 7px;
  background: #fcfdfb;
  font-size: 12.6px;
  line-height: 1.42;
}
.rs-tf-text { flex: 1; min-width: 0; display: flex; gap: 6px; }
.rs-tf-boxes { display: inline-flex; gap: 4px; flex: none; }
.rs-tf-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  box-sizing: border-box;
  border: 1.25px solid #90aba8;
  border-radius: 5px;
  background: #fff;
  color: #3f5d61;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.rs-tf-box.is-answer-key { background: #155f69; border-color: #155f69; color: #fff; }

/* Multiple-choice Cloze (KET P4 / PET P5 / FCE P1) compact 2-column choice table */
.rs-mc-cloze-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
}
.rs-mc-cloze-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid #e3ece9;
  border-radius: 7px;
  background: #fcfdfb;
  font-size: 12.2px;
}
.rs-mc-cloze-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 11px;
  flex: 1;
  min-width: 0;
}
.rs-mc-cloze-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Word Formation — authentic Cambridge FCE Part 3 right-column CAPITALS + Example (0) */
.rs-wf-example {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  margin-bottom: 10px;
  border: 1.2px solid #bed6d0;
  border-radius: 7px;
  background: #f4faf8;
  font-size: 12px;
  color: #1d3c42;
}
.rs-wf-example strong { color: #155f69; }
.rs-wf-ex-ans {
  padding: 1px 7px;
  border-radius: 4px;
  background: #e1f3ec;
  color: #0e4f58;
  font-weight: 800;
  letter-spacing: .04em;
}
.rs-wf-passage { display: grid; gap: 8px; }
.rs-wf-para-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 114px;
  gap: 14px;
  align-items: start;
}
.rs-wf-caps-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-left: 10px;
  border-left: 1px dashed #d3e1dc;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #155f69;
  line-height: 1.5;
}
.rs-wf-cap-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.rs-wf-cap-num {
  font-size: 10px;
  color: #678286;
  min-width: 18px;
}

/* Word Formation editor strip (screen only, hidden in print) */
.rs-wf-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}
.rs-wf-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #e1ebe7;
  border-radius: 7px;
  background: #f9fbfa;
  font-size: 12px;
}
.rs-wf-root { font-weight: 800; color: #155f69; letter-spacing: .03em; }
.rs-wf-arrow { color: #839a9d; }

/* Gapped text (PET P4 / FCE P6) sentence box + student answer strip */
.rs-sent-list { display: grid; gap: 6px; }
.rs-sent-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 6px 10px;
  border: 1px solid #d9e6e2;
  border-radius: 7px;
  background: #fafcfa;
  font-size: 12.5px;
  line-height: 1.45;
}
.rs-sent-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 21px;
  height: 21px;
  border: 1.3px solid #155f69;
  border-radius: 5px;
  background: #fff;
  color: #155f69;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.rs-answer-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 8px 12px;
  margin-top: 10px;
  border: 1.3px solid #c5dbd5;
  border-radius: 8px;
  background: #f5faf8;
  font-size: 12.5px;
  font-weight: 700;
  color: #16444a;
}
.rs-strip-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rs-ans-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  box-sizing: border-box;
  border: 1.4px solid #7f9ea1;
  border-radius: 5px;
  background: #fff;
  color: #155f69;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.rs-ans-box.is-answer-key {
  background: #155f69;
  border-color: #155f69;
  color: #fff;
}

/* Paragraph Matching (KET P2 / PET P2 / FCE P7) */
.rs-match-list { display: grid; gap: 6px; }
.rs-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid #e3ece9;
  border-radius: 7px;
  background: #fcfdfb;
  font-size: 12.6px;
  line-height: 1.42;
}

/* Vocabulary Matching (Word <-> English definition) */
.rs-vocab-grid {
  display: grid;
  grid-template-columns: minmax(175px, 0.85fr) minmax(0, 1.55fr);
  gap: 10px 16px;
  align-items: start;
}
.rs-vocab-col { display: grid; gap: 6px; }
.rs-vocab-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid #e3ece9;
  border-radius: 7px;
  background: #fcfdfb;
  font-size: 12.4px;
  line-height: 1.4;
}
.rs-vocab-word { flex: 1; font-weight: 700; color: #163b41; }

/* Short answer */
.rs-sa-list { display: grid; gap: 11px; }
.rs-sa-item {
  position: relative;
  padding: 3px 4px 4px 0;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12.6px;
}
.rs-write-lines { margin-top: 4px; display: grid; gap: 10px; }
.rs-write-lines.is-four { gap: 16px; margin-top: 7px; }
.rs-line-single { height: 24px; border-bottom: 1.2px solid #96afad; }
.rs-line-four {
  height: 27px;
  background:
    repeating-linear-gradient(to right, #a7c5d8 0 4px, transparent 4px 8px) 0 9px / 100% 1px no-repeat,
    linear-gradient(
      to bottom,
      #89b4cf 0 1px, transparent 1px 18px,
      #d16f69 18px 19.5px, transparent 19.5px 26px,
      #89b4cf 26px 27px
    );
}
.rs-empty-note {
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px dashed #c7d6d2;
  border-radius: 8px;
  background: #f9fbfa;
  color: #5b7275;
  font-size: 12.2px;
}
.rs-sa-key {
  margin-top: 5px;
  padding: 5px 9px;
  border-left: 3px solid #155f69;
  background: #edf7f4;
  color: #134d55;
  font-size: 12px;
  line-height: 1.45;
}

/* Inline editing & subtle remove control (hidden in print) */
.rs-editable {
  outline: none;
  border-radius: 4px;
  transition: background .12s;
}
.rs-editable:hover { background: rgba(21, 95, 105, .07); }
.rs-editable:focus { background: #fffbe6; box-shadow: 0 0 0 1.5px #155f69; }
.rs-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9bb0b2;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}
.rs-mc-card:hover .rs-del-btn,
.rs-tf-item:hover .rs-del-btn,
.rs-sa-item:hover .rs-del-btn,
.rs-match-row:hover .rs-del-btn,
.rs-mc-cloze-item:hover .rs-del-btn,
.rs-wf-row:hover .rs-del-btn,
.rs-sent-item:hover .rs-del-btn,
.rs-vocab-row:hover .rs-del-btn,
.rs-del-btn:focus-visible { opacity: 1; }
.rs-del-btn:hover { background: #fceae8; color: #a32f25; }

.rs-print-tip {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--studio-muted);
}

/* Separate Answer Key sheet visual divider on screen */
.rs-sheet-key { border-top: 4px solid #155f69; }
.rs-key-banner {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #155f69;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

/* 5.242: no phone layout for the sheet itself: it keeps the paper layout and is shown smaller (--rs-zoom),
   so it splits into the same pages on a phone as on a computer and as printed. */

@media print {
  .rs-preview-bar,
  .rs-stale-banner,
  .rs-print-tip,
  .rs-add-btn,
  .rs-add-ai-btn,
  .rs-add-pair,
  .rs-del-btn,
  .rs-gloss-del,
  .rs-screen-only,
  .rs-ans-pill,
  .rs-live-ans-hint,
  .rs-live-ans-text { display: none !important; }
  .rs-show-answers .rs-opt-circle.is-live-answer,
  .rs-show-answers .rs-tf-box.is-live-answer,
  .rs-show-answers .rs-ans-box.is-live-answer {
    background: #fff !important;
    border-color: #7f9ea1 !important;
    color: #3f5d61 !important;
    box-shadow: none !important;
  }
  .rs-show-answers.is-exam .rs-opt-circle.is-live-answer,
  .rs-show-answers.is-exam .rs-tf-box.is-live-answer,
  .rs-show-answers.is-exam .rs-ans-box.is-live-answer {
    border-color: #333 !important;
    color: #111 !important;
  }
  body.reading-studio-page .rs-sheet-host {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
  }
  .rs-sheet {
    max-width: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 7mm 10mm !important;
    break-after: page;
    page-break-after: always;
  }
  .rs-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .rs-sheet[data-print-hidden="true"] { display: none !important; }
  .rs-sheet-top { padding-bottom: 8px !important; margin-bottom: 10px !important; }
  .rs-sheet-title { font-size: 19px !important; margin-bottom: 6px !important; }
  .rs-instruction { margin-bottom: 8px !important; font-size: 12.2px !important; }
  .rs-passage-card { padding: 10px 13px !important; margin-bottom: 10px !important; break-inside: avoid; page-break-inside: avoid; }
  .rs-para { font-size: 12.6px !important; line-height: 1.56 !important; margin-bottom: 6px !important; }
  .rs-wordbank, .rs-glossary, .rs-answer-strip { padding: 6px 10px !important; margin-bottom: 9px !important; break-inside: avoid; page-break-inside: avoid; }
  .rs-section { margin-bottom: 10px !important; }
  .rs-section-head { margin-bottom: 5px !important; break-after: avoid; page-break-after: avoid; }
  .rs-mc-list { gap: 7px 18px !important; }
  .rs-mc-card, .rs-tf-item, .rs-sa-item, .rs-match-row, .rs-mc-cloze-item, .rs-sent-item, .rs-vocab-row {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .rs-mc-card { padding: 3px 0 !important; }
  .rs-tf-list, .rs-match-list, .rs-sent-list { gap: 4px !important; }
  .rs-tf-item, .rs-match-row, .rs-sent-item { padding: 4px 8px !important; font-size: 12px !important; }
  .rs-sa-list { gap: 9px !important; }
  .rs-write-lines { gap: 8px !important; }
  .rs-write-lines.is-four { gap: 14px !important; }
  .rs-line-single { height: 22px !important; }
  .rs-word-btn:hover, .rs-editable:hover { background: transparent !important; box-shadow: none !important; }
  .rs-blank-token { background: transparent !important; color: #444 !important; border-bottom-color: #333 !important; }
  .rs-blank-num { color: #555 !important; }
  .rs-gap-slot { background: #fff !important; border-color: #333 !important; color: #111 !important; }
}

/* 5.242 — Reading studio: one paper width on every screen (shown smaller on phones), gap parts that combine,
   the check-before-printing list, unfinished options, the WeChat print note and recent sheets. */
.rs-sheet-host > .rs-sheet {
  width: 736px;
  max-width: none;
  flex: none;
  zoom: var(--rs-zoom, 1);
}
.rs-sheet-host { align-items: center; }
.rs-level-hint {
  margin: -4px 0 10px;
  padding: 6px 9px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #ecd39a;
  color: #6f4e0b;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.rs-level-hint[hidden] { display: none; }
.rs-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.rs-two-col label { display: block; }
.rs-two-col select, .rs-two-col input { width: 100%; box-sizing: border-box; }
.rs-ms-note {
  margin: 0;
  padding: 7px 12px;
  border-top: 1px solid #dde7e2;
  background: #fff9ec;
  color: #78500b;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.rs-check-box {
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid #e6cfa1;
  border-radius: 10px;
  background: #fff9ec;
  color: #6b4708;
  font-size: 12.2px;
  line-height: 1.45;
}
.rs-check-box[hidden] { display: none !important; }
.rs-check-box.is-urgent { border-color: #d99a2b; box-shadow: 0 0 0 3px rgba(217, 154, 43, .18); }
.rs-check-box strong { display: block; margin-bottom: 4px; }
.rs-check-box ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.rs-check-box li button { margin-left: 6px; vertical-align: baseline; }
.rs-check-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.rs-inapp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #e3c27a;
  border-radius: 10px;
  background: #fff8e6;
  color: #4a3a12;
  font-size: 13px;
  line-height: 1.45;
}
.rs-inapp[hidden] { display: none !important; }
.rs-click-target { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-right: 6px; }
.rs-click-target[hidden] { display: none !important; }
.rs-click-target .rs-chip.is-active { background: var(--studio-accent); border-color: var(--studio-accent); color: #fff; }
.rs-gap-legend { display: grid; gap: 6px; margin-bottom: 10px; }
.rs-gap-legend .rs-wordbank { margin-bottom: 0; }
.rs-gap-legend-line { margin: 0; font-size: 12.6px; font-weight: 700; color: #1d4b52; }
.rs-sheet.is-exam .rs-gap-legend-line { color: #111; }
.rs-wb-item.is-extra { display: inline-flex; align-items: center; gap: 3px; }
.rs-opt-missing { display: inline-flex; align-items: center; gap: 6px; }
.rs-opt-circle.is-missing { border-style: dashed !important; border-color: #d99a2b !important; color: #a26a0e !important; background: #fff8e6 !important; }
.rs-missing-text {
  min-width: 110px;
  padding: 1px 6px;
  border: 1px dashed #d99a2b;
  border-radius: 6px;
  background: #fff8e6;
  color: #5b3d06;
}
.rs-missing-text:empty::before { content: attr(data-placeholder); color: #b48836; font-style: italic; }
.rs-recent-list { display: grid; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--studio-line, #dde7e2); }
.rs-recent-list[hidden] { display: none; }
.rs-recent-label { font-size: 11px; font-weight: 800; color: #5d767a; text-transform: none; }
.rs-recent-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--studio-ink, #183b42);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.rs-recent-item:hover { background: #edf6f3; }
.rs-recent-item small { color: #6c8487; font-weight: 600; white-space: nowrap; }
@media print {
  .rs-check-box, .rs-inapp, .rs-opt-missing, .rs-level-hint { display: none !important; }
  .rs-sheet-host > .rs-sheet { width: auto !important; zoom: 1 !important; }
}

/* AI progress window (5.243.1): fixed to the bottom of the screen while the AI writes. */
.rs-progress {
  position: fixed; z-index: 60; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 32px));
  padding: 14px 16px 12px; border-radius: 16px; background: #ffffff; border: 1px solid #cfe0db;
  box-shadow: 0 14px 40px rgba(18, 54, 60, .18), 0 2px 6px rgba(18, 54, 60, .08); color: #1d3a40;
  font-size: .92rem; line-height: 1.4;
}
.rs-progress[hidden] { display: none; }
.rs-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rs-progress-head strong { font-size: 1rem; color: #155f69; }
.rs-progress-head span { color: #5d7479; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .85rem; }
.rs-progress-steps { display: flex; gap: 6px; margin: 10px 0 8px; padding: 0; list-style: none; counter-reset: rsstep; }
.rs-progress-steps li { counter-increment: rsstep; display: flex; align-items: center; gap: 5px; flex: 1; font-size: .8rem; color: #8aa0a4; }
.rs-progress-steps li::before { content: counter(rsstep); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; font-size: .7rem; font-weight: 700; flex: none; }
.rs-progress-steps li[data-state="now"] { color: #155f69; font-weight: 700; }
.rs-progress-steps li[data-state="now"]::before { background: #155f69; border-color: #155f69; color: #fff; }
.rs-progress-steps li[data-state="done"] { color: #2f7d58; }
.rs-progress-steps li[data-state="done"]::before { content: "✓"; background: #e3f3ea; border-color: #2f7d58; }
.rs-progress-bar { height: 8px; border-radius: 999px; background: #e6eeec; overflow: hidden; }
.rs-progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #1f7a85, #2fa39a); transition: width .45s ease; }
.rs-progress[data-tone="busy"] .rs-progress-bar span { background-image: linear-gradient(90deg, #1f7a85, #2fa39a), repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 8px, transparent 8px 16px); background-blend-mode: overlay; }
.rs-progress[data-tone="ok"] .rs-progress-bar span { background: #2f9a64; }
.rs-progress[data-tone="error"] { border-color: #e6c2bc; }
.rs-progress[data-tone="error"] .rs-progress-head strong { color: #9c2f24; }
.rs-progress[data-tone="error"] .rs-progress-bar { display: none; }
.rs-progress-detail { margin: 8px 0 0; color: #3d5559; min-height: 1.4em; }
.rs-progress-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.rs-progress-actions .site-button { min-height: 34px; padding: 4px 14px; }
@media (max-width: 640px) {
  .rs-progress { right: 12px; left: 12px; bottom: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .rs-progress-bar span { transition: none; } }
@media print { .rs-progress { display: none !important; } }

/* Shared topic picker (js/studio-topics.js): used by Reading and Grammar studios */
.st-more-chip { border-style: dashed; color: var(--studio-muted); }
.st-more-chip:hover:not(:disabled) { border-style: solid; }
.st-topic-tray {
  flex: 0 0 100%;
  box-sizing: border-box;
  margin-top: 3px;
  padding: 8px;
  border: 1px solid var(--studio-line);
  border-radius: 10px;
  background: #fbfaf5;
}
.st-title-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-title-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 46px;
  padding: 5px 8px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #fff;
  color: var(--studio-ink);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
}
.st-title-btn:hover { background: #edf6f3; border-color: var(--studio-accent); }
.st-title-btn.is-picked { background: #e3f1ed; border-color: var(--studio-accent); color: var(--studio-accent); box-shadow: inset 3px 0 0 var(--studio-accent); }
.st-title-tag { font-size: 10px; font-weight: 600; color: var(--studio-muted); letter-spacing: .01em; }
.st-topic-tray.is-loading .st-title-grid { opacity: .55; pointer-events: none; transition: opacity .15s; }
.st-title-grid.is-fresh .st-title-btn { animation: stFadeIn .22s ease-out; }
@keyframes stFadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes stSpin { to { transform: rotate(360deg); } }
.st-spin { display: inline-block; animation: stSpin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .st-title-grid.is-fresh .st-title-btn, .st-spin { animation: none; }
}
.st-tray-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.st-tray-status { flex: 1; min-width: 0; font-size: 11px; font-weight: 600; line-height: 1.3; color: var(--studio-muted); }
.st-tray-status.is-error { color: #b54533; }
.st-tray-status a { color: var(--studio-accent); text-decoration: underline; }
.st-shuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 3px 9px;
  border: 1px solid #cbd9d4;
  border-radius: 999px;
  background: transparent;
  color: var(--studio-accent);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.st-shuffle-btn:hover:not(:disabled) { background: #edf6f3; border-color: var(--studio-accent); }
.st-shuffle-btn:disabled { opacity: .7; cursor: progress; }
.st-vocab-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed #dde6e0;
}
.st-vocab-label { font-size: 11px; font-weight: 700; color: var(--studio-muted); margin-right: 2px; }
.st-w {
  padding: 2px 8px;
  border: 1px solid #d8e2dc;
  border-radius: 999px;
  background: #fff;
  color: #2b4a4e;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.st-w:hover { background: #edf6f3; border-color: var(--studio-accent); color: var(--studio-accent); }
.st-w.is-used { background: #e3f1ed; border-color: #b8d4cb; color: var(--studio-muted); cursor: default; }
.st-title-btn:focus-visible, .st-w:focus-visible, .st-shuffle-btn:focus-visible { outline: 2px solid var(--studio-accent); outline-offset: 2px; }

/* Source: css/grammar-studio.css */
/* Grammar studio (/grammar): sits on the Reading studio layout (css/reading-studio.css) and adds the grammar point
   picker, the rule box and the grammar exercise blocks. */

/* ---- Step 01: search, categories, point grid, selection ---- */
.gs-search { position: relative; margin: 0 0 9px; }
.gs-search svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); fill: none; stroke: #668386; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.gs-search input { width: 100%; box-sizing: border-box; padding: 8px 10px 8px 32px; font-size: 12.5px; }
.gs-cat-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 9px; }
.gs-cat-tab {
  padding: 4px 9px;
  border: 1px solid #cddad5;
  border-radius: 7px;
  background: #fff;
  color: #36565a;
  font: inherit;
  font-size: 11.4px;
  font-weight: 700;
  cursor: pointer;
}
.gs-cat-tab:hover { border-color: #8fb3a6; background: #f2f9f6; }
.gs-cat-tab[aria-selected="true"] { background: var(--studio-accent); border-color: var(--studio-accent); color: #fff; }
.gs-point-grid { margin: 0 0 10px; }
.gs-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border: 1px solid #d5e2dd;
  border-radius: 9px;
  background: #f8fbfa;
}
.gs-matrix-head { text-align: center; padding-bottom: 2px; font-size: 10.5px; font-weight: 800; color: #517175; }
.gs-matrix-label { grid-column: 1 / -1; margin: 4px 0 0; font-size: 10.5px; font-weight: 800; color: #517175; }
.gs-point-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.gs-point {
  padding: 5px 6px;
  border: 1px solid #d2dfda;
  border-radius: 6px;
  background: #fff;
  color: #244448;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}
.gs-point-chips .gs-point { padding: 5px 10px; font-size: 11.6px; border-radius: 999px; }
.gs-point:hover { border-color: #8fb3a6; background: #f2f9f6; }
.gs-point[aria-pressed="true"] { background: var(--studio-accent); border-color: var(--studio-accent); color: #fff; box-shadow: 0 1px 4px rgba(21, 95, 105, .25); }
.gs-point small { display: block; margin-top: 1px; font-size: 9.5px; font-weight: 600; opacity: .75; }
.gs-empty { margin: 0; padding: 8px 2px; font-size: 12px; color: var(--studio-muted); }
.gs-selected {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  margin: 0 0 9px;
  border: 1px solid #c3dbd4;
  border-radius: 8px;
  background: #edf6f3;
  font-size: 11.5px;
}
.gs-sel-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 2px 9px;
  border-radius: 999px;
  background: var(--studio-accent);
  color: #fff;
  font-size: 11.4px;
  font-weight: 700;
}
.gs-sel-tag button { border: 0; padding: 0 5px; background: transparent; color: #fff; font: inherit; font-size: 13px; line-height: 1; cursor: pointer; opacity: .85; }
.gs-sel-tag button:hover { opacity: 1; }
.gs-vs { font-weight: 800; color: #b46d1e; font-size: 11px; }
.gs-sel-note { margin-left: auto; color: #517074; font-weight: 700; font-size: 10.8px; }
.gs-mini-label { display: block; margin: 0 0 5px; font-size: 11px; font-weight: 800; color: #5d767a; }
.gs-contrasts { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.gs-contrast {
  padding: 3px 9px;
  border: 1px dashed #a9c6bd;
  border-radius: 999px;
  background: transparent;
  color: #155f69;
  font: inherit;
  font-size: 11.2px;
  font-weight: 700;
  cursor: pointer;
}
.gs-contrast:hover { background: #ebf6f3; border-style: solid; }
.gs-contrast.is-active { background: #e1f1ec; border-style: solid; border-color: var(--studio-accent); }
.gs-theme-box { margin: 2px 0 0; padding: 8px 10px; border: 1px solid #d5e2dd; border-radius: 9px; background: #fbfdfc; }
.gs-theme-box > summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; list-style: none; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--studio-accent); }
.gs-theme-box > summary::-webkit-details-marker { display: none; }
.gs-theme-box[open] > summary { margin-bottom: 8px; }
.gs-theme-box label { display: block; margin: 8px 0 4px; font-size: 11.5px; font-weight: 700; color: var(--studio-muted); }
.gs-theme-box input { width: 100%; box-sizing: border-box; }
.gs-theme-box .tracing-help { margin: 6px 0 0; font-size: 11px; }
.gs-level-note { margin: -4px 0 8px; font-size: 11.2px; color: #6f4e0b; }

/* ---- Sheet ---- */
.gs-sheet { font-size: 12.2px; line-height: 1.45; }
.gs-sheet .rs-sheet-title { font-size: 20px; }
.gs-badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 10px; }
.gs-badge { padding: 2px 9px; border-radius: 999px; background: #e9f4f1; color: #155f69; font-size: 10.8px; font-weight: 800; }
.gs-body { display: block; }
.gs-sheet.is-compact .gs-block { margin-bottom: 7px; }

.gs-block { margin: 0 0 9px; }
.gs-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 0 0 4px; break-after: avoid; page-break-after: avoid; }
.gs-head h4 { margin: 0; font-size: 13.2px; font-weight: 800; color: #155f69; }
.gs-head .gs-instr { font-size: 11.6px; font-weight: 600; color: #4b6568; }
.gs-head-tools { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.gs-item { position: relative; padding: 2px 4px 2px 0; border: 1px solid transparent; border-radius: 6px; break-inside: avoid; page-break-inside: avoid; }
.gs-item:hover { border-color: #d6e4e0; background: #fbfdfb; }
.gs-item:hover .rs-del-btn { opacity: 1; }
.gs-item-row { display: flex; align-items: flex-start; gap: 6px; }
.gs-item-main { flex: 1; min-width: 0; }
.gs-num { flex: none; min-width: 20px; font-weight: 800; color: #17494b; }
.gs-cue { font-size: .92em; font-weight: 700; color: #557276; }
.gs-blank { display: inline-block; min-width: 76px; padding: 0 4px; border-bottom: 1.3px solid #35575b; text-align: center; line-height: 1.25; }
.gs-blank.is-short { min-width: 54px; }
.gs-blank.is-long { min-width: 118px; }
.gs-live-ans { display: none; color: #1b7a50; font-weight: 800; }
.gs-show-answers .gs-live-ans { display: inline; }
.gs-key-ans { color: #155f69; font-weight: 800; }
.gs-reason { display: block; margin-top: 1px; font-size: 10.6px; font-weight: 600; color: #6b8386; }
.gs-writeline { height: 20px; border-bottom: 1.2px solid #8ea6a9; margin-top: 3px; }
.gs-four { height: 40px; margin-top: 4px; background:
  linear-gradient(#7d9396, #7d9396) 0 0 / 100% 1px no-repeat,
  linear-gradient(#c6786f, #c6786f) 0 33.3% / 100% 1px no-repeat,
  linear-gradient(#c6786f, #c6786f) 0 66.6% / 100% 1px no-repeat,
  linear-gradient(#7d9396, #7d9396) 0 100% / 100% 1px no-repeat; }
.gs-fix { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; font-size: 11.4px; font-weight: 700; color: #557276; }
.gs-fix .gs-writeline { flex: 1; margin-top: 0; }

/* rule box */
.gs-rule { position: relative; padding: 7px 10px 8px; margin: 0 0 9px; background: #f5faf8; border: 1.2px solid #bdd6cf; border-left: 4px solid var(--studio-accent); border-radius: 8px; break-inside: avoid; page-break-inside: avoid; }
.gs-rule-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 7px; font-size: 11.4px; font-weight: 800; color: #155f69; }
.gs-rule-cols { display: grid; gap: 10px; grid-template-columns: repeat(var(--gs-rule-cols, 2), minmax(0, 1fr)); }
.gs-rule-box { padding: 5px 8px; background: #fff; border: 1px solid #d5e4df; border-radius: 7px; font-size: 10.8px; line-height: 1.38; color: #203d42; }
.gs-rule-box h5 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; margin: 0 0 3px; font-size: 11.8px; font-weight: 800; color: #155f69; }
.gs-formula { padding: 1px 5px; border-radius: 4px; background: #eef6f4; font-family: ui-monospace, Consolas, monospace; font-size: 10.6px; font-weight: 700; color: #17494b; }
.gs-rule-box svg { display: block; width: 100%; height: 30px; margin: 2px 0; }
.gs-rule-line { margin: 2px 0 0; }
.gs-rule-line b { color: #17494b; }
.gs-rule-line em { color: #284a4e; }

/* table */
.gs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.gs-table th { padding: 3px 8px; border: 1px solid #c7dad4; background: #edf5f3; color: #17494b; font-weight: 800; text-align: left; }
.gs-table td { padding: 2.5px 8px; border: 1px solid #d5e2de; vertical-align: middle; }
.gs-table td .gs-num { margin-right: 4px; }
.gs-table-wrap { position: relative; }
.gs-table tr:hover .rs-del-btn { opacity: 1; }

/* mc */
.gs-mc-opts { display: flex; flex-wrap: wrap; gap: 3px 18px; margin: 2px 0 0 26px; font-size: 12px; }
.gs-mc-opt { display: inline-flex; align-items: baseline; gap: 5px; }
.gs-mc-opt .gs-opt-circle { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border: 1.2px solid #5c7d81; border-radius: 50%; font-family: system-ui, sans-serif; font-size: 10px; font-weight: 800; color: #17494b; flex: none; transform: translateY(2px); }
.gs-show-answers .gs-mc-opt.is-right .gs-opt-circle, .gs-sheet-key .gs-mc-opt.is-right .gs-opt-circle { background: #155f69; border-color: #155f69; color: #fff; }
.gs-sheet-key .gs-mc-opt.is-right .gs-opt-circle { background: #155f69; border-color: #155f69; color: #fff; }
.gs-opt-missing { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px dashed #d99a2b; border-radius: 6px; background: #fff8e6; color: #7a540b; font-size: 11px; }
.gs-mc-opt .gs-opt-text { min-width: 14px; }

/* order / rewrite / cloze */
.gs-words { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0 26px; }
.gs-word { padding: 1px 9px; border: 1.2px solid #8ea6a9; border-radius: 6px; background: #fff; font-weight: 600; }
.gs-rewrite-prompt { margin: 0; }
.gs-instruction { font-size: 11.4px; font-weight: 700; color: #557276; }
.gs-story { padding: 6px 10px; border: 1px solid #cdded8; border-radius: 7px; background: #fbfdfb; line-height: 1.75; font-size: 12px; }
.gs-story .gs-blank { min-width: 64px; }
.gs-story .gs-bn { font-weight: 800; color: #17494b; }

/* compact key */
.gs-key-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 18px; margin: 0; padding: 0; list-style: none; font-size: 11.6px; }
.gs-key-list li { padding: 2px 0; border-bottom: 1px dotted #d3e0dc; break-inside: avoid; }
.gs-key-list b { color: #155f69; }

/* screen-only controls */
.gs-add-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.gs-stub-flag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: #fff3d6; color: #7a540b; font-size: 10px; font-weight: 800; }
.gs-sheet [contenteditable]:empty::before { content: attr(data-ph); color: #a9b9bb; font-weight: 600; }

/* exam style */
.rs-sheet.gs-sheet.is-exam { font-family: Georgia, "Times New Roman", "PingFang SC", serif; color: #111; }
.is-exam .gs-head h4, .is-exam .gs-num, .is-exam .gs-rule-top, .is-exam .gs-rule-box h5 { color: #111; }
.is-exam .gs-rule { background: #fff; border-color: #aaa; border-left-color: #111; border-radius: 2px; }
.is-exam .gs-rule-box, .is-exam .gs-story, .is-exam .gs-table td, .is-exam .gs-table th { border-color: #999; border-radius: 2px; background: #fff; color: #111; }
.is-exam .gs-table th { background: #f1f1f1; }
.is-exam .gs-formula { background: #f1f1f1; color: #111; }
.is-exam .gs-badge { background: #eee; color: #111; }
.is-exam .gs-blank { border-bottom-color: #111; }

.gs-print-all-pack { display: none; }
@media print {
  .gs-add-row, .gs-head-tools, .gs-stub-flag, .gs-live-ans, .gs-opt-missing { display: none !important; }
  .gs-show-answers .gs-live-ans { display: none !important; }
  .gs-show-answers .gs-mc-opt.is-right .gs-opt-circle { background: #fff !important; border-color: #5c7d81 !important; color: #17494b !important; }
  .gs-sheet-key .gs-mc-opt.is-right .gs-opt-circle { background: #155f69 !important; color: #fff !important; }
  .gs-item:hover { border-color: transparent !important; background: transparent !important; }
  .rs-sheet.gs-sheet { padding: 7mm 10mm !important; }
  .gs-sheet .rs-del-btn { display: none !important; }
}
@media (max-width: 899px) {
  .gs-matrix { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Source: css/account-nav.css */
.cp-account-nav { position: relative; display: inline-flex; flex-shrink: 0; }
.cp-account-nav [hidden] { display: none !important; }
.cp-account-button, .cp-account-signin { display: inline-flex; gap: 8px; align-items: center; min-height: 36px; padding: 4px 10px 4px 5px; border: 1px solid #c9d6de; border-radius: 4px; background: #fff; color: #263b48; font: 600 13px/1 "ClassPlay Round", Arial, sans-serif; white-space: nowrap; cursor: pointer; text-decoration: none; }
.cp-account-signin { padding: 4px 14px; }
.cp-account-button:hover, .cp-account-button[aria-expanded=true], .cp-account-signin:hover { background: #f1f6f2; border-color: #9fbab3; }
.cp-account-label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.cp-account-avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 4px; color: #fff; background: linear-gradient(135deg, #2f8a78, #155f69); font-size: 14px; font-weight: 800; }
.cp-account-caret { width: 0; height: 0; border: 5px solid transparent; border-top: 6px solid #445; border-bottom: 0; margin-top: 3px; }
.cp-account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 210px; padding: 6px 0; background: #fff; border: 1px solid #c9c9c9; border-radius: 4px; box-shadow: 0 8px 24px rgba(20,50,70,.2); }
.cp-account-menu button { display: block; width: 100%; padding: 10px 18px; border: 0; background: none; text-align: left; font: 500 14.5px/1.2 "ClassPlay Round", Arial, sans-serif; color: #222; cursor: pointer; }
.cp-account-menu button:hover, .cp-account-menu button:focus-visible { background: #eef5f1; color: #155f69; outline: none; }
.cp-account-menu button[data-account-action=logout] { border-top: 1px solid #eee; margin-top: 4px; padding-top: 12px; }
@media (max-width: 800px) { .site-header-inner { flex-wrap: wrap; gap: 10px; padding-top: 8px; padding-bottom: 8px; } .site-nav { gap: 14px; } .cp-account-label { max-width: 100px; } }
@media (max-width: 500px) { .cp-account-label { max-width: 70px; } .site-nav { margin-left: auto; } .cp-language-switch { margin-left: auto; } }

/* Public tools share teacher destinations without loading or requiring a cloud
   library. Only their explicitly marked headers use the mobile disclosure. */
.site-header .site-header-inner[data-teacher-nav] { position: relative; }
.site-header .site-header-inner[data-teacher-nav] .site-nav { margin-left: auto; gap: 4px; }
.site-header .site-header-inner[data-teacher-nav] .site-nav > a { display: flex; align-items: center; min-height: 44px; padding: 10px 11px; border: 0; border-radius: 9px; font: 700 14px/1.35 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--cp-muted, #526976); }
.site-header .site-header-inner[data-teacher-nav] .site-nav > a:hover { color: var(--cp-action, #155f69); background: #f1f6f2; }
.site-header .site-header-inner[data-teacher-nav] .site-nav > a[aria-current] { color: var(--cp-action, #155f69); background: #e6efe9; }
.site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-teacher-account-link { display: none; }
.site-header .site-header-inner[data-teacher-nav] [hidden] { display: none !important; }
.cp-teacher-nav-toggle { align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 12px; background: #fff; border: 1px solid var(--cp-line, #d7e3e7); border-radius: 9px; color: var(--cp-ink, #183747); font: 700 13px/1.35 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", sans-serif; cursor: pointer; }
.cp-teacher-nav-toggle svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.cp-teacher-nav-toggle:hover, .cp-teacher-nav-toggle[aria-expanded=true] { border-color: #9fbab3; background: #f1f6f2; }
@media (min-width: 961px) { .site-header .site-header-inner[data-teacher-nav] { gap: 14px; flex-wrap: nowrap; }.site-header .site-header-inner[data-teacher-nav] .cp-account-label { max-width: 120px; } }
@media (max-width: 960px) {
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 66px; padding: 10px 16px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-brand { grid-column: 1; grid-row: 1; font-size: 24px; min-width: 0; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-language-switch { grid-column: 2; grid-row: 1; margin: 0; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-language-switch button { min-width: 36px; min-height: 40px; padding: 6px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-teacher-nav-toggle { display: inline-flex; grid-column: 3; grid-row: 1; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-nav { position: absolute; z-index: 90; top: calc(100% + 6px); left: 12px; right: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 5px; width: auto; min-height: 0; margin: 0; padding: 10px; border: 1px solid var(--cp-line, #d7e3e7); border-radius: 12px; background: #fff; box-shadow: 0 10px 30px #15374724; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > a { justify-content: flex-start; min-height: 44px; padding: 10px 11px; white-space: normal; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-teacher-account-link { display: flex; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-account-nav { margin: 0; justify-self: end; max-width: 100%; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-account-signin { display: none; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-account-label { max-width: 74px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-account-button { min-height: 44px; max-width: 100%; gap: 5px; font-size: 12px; padding-right: 8px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-account-avatar { width: 24px; height: 24px; font-size: 12px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-account-menu { min-width: 210px; }
}
@media (max-width: 370px) { .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-brand { font-size: 21px; }.cp-teacher-nav-toggle { padding: 9px; }.cp-teacher-nav-toggle > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

/* ── One top bar for the whole site ───────────────────────────────────────────
   Every app and tool page uses this bar. The header says who it is for
   (data-audience: teacher or visitor; js/account-nav.js); links marked
   data-teacher-only or data-visitor-only follow it, so a parent on the tracing
   tool never meets "Class results", and a teacher never meets "Sign up".
   Order on wide screens: logo · links · New activity · account · language. */
.site-header .site-header-inner[data-teacher-nav]:not([data-audience=teacher]) [data-teacher-only],
.site-header .site-header-inner[data-teacher-nav]:not([data-audience=visitor]) [data-visitor-only] { display: none !important; }
/* Community stays out of the menu unless the server switches it on (COMMUNITY_READY=true
   marks every page <html data-community="on">; server.mjs markCommunityPage). */
html:not([data-community=on]) [data-classroom-nav=community] { display: none !important; }
.site-header .site-header-inner[data-teacher-nav] > .site-brand { order: 0; margin-right: auto; }
.site-header .site-header-inner[data-teacher-nav] > .cp-teacher-nav-toggle { order: 5; }
.site-header .site-header-inner[data-teacher-nav] > .site-nav { order: 1; margin-left: 0; }
.site-header .site-header-inner[data-teacher-nav] > .site-create { order: 2; }
.site-header .site-header-inner[data-teacher-nav] > .cp-account-nav { order: 3; }
.site-header .site-header-inner[data-teacher-nav] > .cp-language-switch { order: 4; }
.site-header .site-header-inner[data-teacher-nav] .site-logo { flex: none; }
.site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .cp-teacher-account-link { display: none !important; }
.site-header .site-header-inner[data-teacher-nav] .site-create { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 10px; text-decoration: none; white-space: nowrap; }
.site-create-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; flex: none; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-nav { align-items: center; gap: 8px; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-signin,
.site-header .site-header-inner[data-teacher-nav] .cp-account-signup { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 10px; font: 800 14px/1 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; text-decoration: none; white-space: nowrap; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-signin { background: #fff; border: 1px solid #c5d6d3; color: #173b43; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-signin:hover { background: #f1f6f2; border-color: #9fbab3; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-signup { background: #155f69; border: 1px solid #155f69; color: #fff; box-shadow: 0 3px 0 #0a424c; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-signup:hover { background: #114e57; }
/* Beside the solid "+ New activity" CTA on teacher pages, Sign up steps down to a soft tonal pill. */
.site-header .site-header-inner[data-teacher-nav][data-audience=teacher] .cp-account-signup { background: #eaf3ee; border-color: #b7d2c8; color: #155f69; box-shadow: none; }
.site-header .site-header-inner[data-teacher-nav][data-audience=teacher] .cp-account-signup:hover { background: #dcebe3; border-color: #8fb3a6; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-nav [hidden] { display: none !important; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-button { min-height: 42px; border-radius: 10px; border-color: #c5d6d3; color: #173b43; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-button:hover,
.site-header .site-header-inner[data-teacher-nav] .cp-account-button[aria-expanded=true] { background: #f1f6f2; border-color: #9fbab3; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-avatar { border-radius: 8px; background: linear-gradient(135deg, #2f8a78, #155f69); }
.site-header .site-header-inner[data-teacher-nav] .cp-account-menu { border-radius: 12px; border-color: #d7e3e7; overflow: hidden; }
.site-header .site-header-inner[data-teacher-nav] .cp-account-menu button:hover,
.site-header .site-header-inner[data-teacher-nav] .cp-account-menu button:focus-visible { background: #eef5f1; color: #155f69; }
.site-header .site-header-inner[data-teacher-nav] > .cp-language-switch { margin-left: 0; border: 1px solid #c5d6d3; border-radius: 10px; }
.site-header .site-header-inner[data-teacher-nav] > .cp-language-switch button { min-height: 40px; min-width: 42px; font-weight: 700; color: #4e6265; }
.site-header .site-header-inner[data-teacher-nav] > .cp-language-switch button[aria-pressed=true] { background: #e6efe9; color: #155f69; font-weight: 800; }
.site-header .site-header-inner[data-teacher-nav] .site-nav > a[aria-current] { color: #155f69; background: #e6efe9; }
.site-header .site-header-inner[data-teacher-nav] .site-nav > a:hover { color: #155f69; background: #f1f6f2; }

@media (max-width: 960px) {
  /* One row: logo · ＋ · language · Menu. Everything else lives in the Menu. */
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced { grid-template-columns: minmax(0, 1fr) auto auto auto; min-height: 64px; padding: 10px 16px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-create { grid-column: 2; grid-row: 1; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-language-switch { grid-column: 3; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-teacher-nav-toggle { grid-column: 4; border-radius: 10px; border-color: #c5d6d3; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-brand { margin: 0; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-nav { grid-template-columns: minmax(0, 1fr); padding: 8px; border-radius: 14px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > a { min-height: 48px; font-size: 15px; }
  /* Account sits at the foot of the menu: Log in and Sign up side by side, or the teacher's account button. */
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > .cp-account-nav { display: flex; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid #e3ebe6; justify-self: stretch; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > .cp-account-nav .cp-account-signin,
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > .cp-account-nav .cp-account-signup { display: inline-flex; flex: 1; min-height: 46px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > .cp-account-nav .cp-account-signin[hidden],
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > .cp-account-nav .cp-account-signup[hidden] { display: none !important; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > .cp-account-nav .cp-account-button { flex: 1; justify-content: flex-start; min-height: 46px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced .site-nav > .cp-account-nav .cp-account-label { max-width: none; }
}
@media (max-width: 600px) {
  /* New activity becomes a ＋ button; the language switch shows only the other language. */
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-create { width: 44px; min-height: 44px; padding: 0; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-create > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-create .site-create-icon { width: 22px; height: 22px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-language-switch button[aria-pressed=true] { display: none; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-language-switch button { min-width: 44px; min-height: 44px; border: 0; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-teacher-nav-toggle > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-teacher-nav-toggle { width: 44px; padding: 0; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-brand { font-size: 22px; }
}
.site-header .site-header-inner[data-teacher-nav] .site-nav > a { text-decoration: none; }

/* My library, always one tap away for teachers. On wide screens it is the first link
   in the bar; narrower than that it gets its own button beside ＋ instead of hiding
   in the Menu. */
.site-library-quick { display: none; }
.site-library-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; flex: none; }
@media (max-width: 960px) {
  .site-header .site-header-inner[data-teacher-nav][data-audience=teacher] > .site-library-quick { display: inline-flex; }
  .site-header .site-header-inner[data-teacher-nav] > .site-library-quick { grid-column: 2; grid-row: 1; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 14px; border: 1px solid #c5d6d3; border-radius: 10px; background: #fff; color: #173b43; font: 800 14px/1 "ClassPlay Round", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; text-decoration: none; white-space: nowrap; }
  .site-header .site-header-inner[data-teacher-nav] > .site-library-quick:hover { background: #f1f6f2; border-color: #9fbab3; }
  .site-header .site-header-inner[data-teacher-nav] > .site-library-quick:focus-visible { outline: 3px solid #173b43; outline-offset: 2px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced { grid-template-columns: minmax(0, 1fr) auto auto auto auto; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-create { grid-column: 3; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-language-switch { grid-column: 4; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-teacher-nav-toggle { grid-column: 5; }
}
@media (max-width: 600px) {
  .site-header .site-header-inner[data-teacher-nav] > .site-library-quick { width: 44px; padding: 0; }
  .site-header .site-header-inner[data-teacher-nav] > .site-library-quick > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-header .site-header-inner[data-teacher-nav] > .site-library-quick .site-library-icon { width: 22px; height: 22px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced { gap: 6px; padding: 10px 12px; }
}
@media (max-width: 380px) {
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-brand { font-size: 19px; gap: 6px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-library-quick,
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .site-create,
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-teacher-nav-toggle { width: 42px; min-height: 42px; }
  .site-header .site-header-inner[data-teacher-nav].teacher-nav-enhanced > .cp-language-switch button { min-width: 42px; min-height: 42px; }
}
/* The renewal reminder beside the account button (last week of paid access, or just after it ended). */
.cp-renew-link { display: inline-flex; align-items: center; align-self: center; min-height: 34px; margin-right: 8px; padding: 5px 13px; border: 1px solid #f0c27a; border-radius: 999px; background: #fff3dc; color: #8a4b0f; font-size: 14px; font-weight: 800; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.cp-renew-link:hover, .cp-renew-link:focus-visible { background: #ffe6b8; color: #6f3a08; }
/* On phones the account button sits in the folded menu, so the menu button carries a dot. */
.cp-renewal-due .cp-teacher-nav-toggle { position: relative; }
.cp-renewal-due .cp-teacher-nav-toggle::after { content: ""; position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #e8912d; }

/* 5.282.0: a red dot on "Wishing well" when the owner has replied to one of the teacher's wishes
   (js/account-nav.js); on phones the Menu button carries it too. */
.site-header .site-nav > a.cp-wish-new::after { content: ""; display: inline-block; flex: none; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px #fff; vertical-align: 2px; }
.cp-teacher-nav-toggle.cp-wish-new { position: relative; }
.cp-teacher-nav-toggle.cp-wish-new::after { content: ""; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px #fff; }
