/* Original learning pages. Shared site colors keep both appearances consistent. */
.zl-learning { --zl-success: #17683a; --zl-error: #c52237; --zl-accent: var(--accent-readable, var(--accent)); color: var(--ink); font-size: 15px; line-height: 1.7; text-align: left; }
:root[data-appearance="dark"] .zl-learning { --zl-success: #9ce3b5; --zl-error: #ff9ca6; }
.zl-learning *, .zl-learning *::before, .zl-learning *::after { box-sizing: border-box; }
.zl-learning [hidden] { display: none !important; }
.zl-learning h2, .zl-learning h3, .zl-learning p { margin: 0; }
.zl-learning h2 { color: var(--ink); font-size: 25px; line-height: 1.25; letter-spacing: -.65px; font-weight: 700; }
.zl-learning h3 { color: var(--ink); font-size: 18px; line-height: 1.4; letter-spacing: -.2px; }
.zl-learning p { color: var(--muted); }
.zl-learning p + p { margin-top: 13px; }
.zl-learning p strong, .zl-learning li strong { color: var(--ink); font-weight: 600; }
.zl-learning :is(h2, h3) + p { margin-top: 13px; }
.zl-learning a { color: var(--zl-accent); }
.zl-learning p a, .zl-learning .zl-source a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.zl-learning button, .zl-learning input { font: inherit; }
.zl-learning button { cursor: pointer; }
.zl-learning :is(button, a, input, summary):focus-visible { outline: 2px solid var(--zl-accent); outline-offset: 3px; }
.zl-learning :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible { outline-offset: -2px; }
.zl-kicker { display: block; margin-bottom: 10px; color: var(--zl-accent); font-size: 11px; font-weight: 700; letter-spacing: 1.45px; line-height: 1.5; text-transform: uppercase; }
.zl-learning .zl-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 11px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; line-height: 1.4; text-align: center; text-decoration: none; }
.zl-learning .zl-button:hover { background: var(--canvas); border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.zl-learning .zl-primary { border-color: #de032d; background: #de032d; color: #fff; }
.zl-learning .zl-primary:hover { border-color: #bb0226; background: #bb0226; color: #fff; }
.zl-learning .zl-small { min-height: 36px; padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.zl-start { display: grid; grid-template-columns: 1.12fr 1fr; gap: clamp(30px, 6vw, 85px); align-items: center; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.zl-start h2 { margin-bottom: 21px; font-size: clamp(30px, 3.7vw, 46px); letter-spacing: -1.4px; }
.zl-start .zl-button { margin-top: 25px; }
.zl-first-word { padding: 28px 24px 22px; border-radius: 18px; background: var(--canvas); text-align: center; }
.zl-first-word .zl-kicker { color: var(--muted); font-size: 10px; }
.zl-sound-pieces { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px 0 24px; }
.zl-sound-pieces > span { display: flex; flex-direction: column; justify-content: center; min-width: 70px; height: 88px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-family: Arial, sans-serif; font-size: 35px; line-height: 1.4; }
.zl-sound-pieces small { color: var(--muted); font-family: var(--font-body); font-size: 10px; }
.zl-sound-pieces b { color: var(--muted); font-size: 17px; font-weight: 400; }
.zl-word-result { display: flex; align-items: center; justify-content: center; gap: 25px; padding: 10px 0; border-top: 1px solid var(--line); }
.zl-word-result > span { color: var(--zl-accent); font-size: 78px; line-height: 1.4; }
.zl-word-result > div { text-align: left; }
.zl-word-result strong { display: block; font-size: 25px; line-height: 1.3; font-weight: 500; }
.zl-word-result small { color: var(--muted); font-size: 13px; }
.zl-first-word > p { font-size: 12px; line-height: 1.65; }
.zl-section { margin-top: 48px; }
.zl-section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 23px; }
.zl-section-heading > p { max-width: 300px; font-size: 13px; }
.zl-path-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.zl-learning .zl-path-card { display: flex; flex-direction: column; min-width: 0; padding: 24px 21px 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.zl-path-card:hover { border-color: var(--zl-accent); transform: translateY(-3px); }
.zl-step-number { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--zl-accent); font-size: 12px; font-weight: 650; }
.zl-path-art { display: flex; align-items: center; min-height: 95px; padding: 13px 0; color: var(--ink); font-family: Arial, sans-serif; font-size: 36px; letter-spacing: 2px; }
.zl-path-card p { flex: 1; margin-top: 10px; font-size: 13px; line-height: 1.7; }
.zl-card-link { display: flex; justify-content: space-between; margin-top: 23px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--zl-accent); font-size: 12px; font-weight: 600; }
.zl-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.zl-paper { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.zl-paper h2 { font-size: 23px; }
.zl-paper p { font-size: 14px; line-height: 1.8; }
.zl-routine { margin: 20px 0; padding-left: 23px; color: var(--zl-accent); }
.zl-routine li { padding-left: 8px; margin-top: 17px; }
.zl-routine strong, .zl-routine span { display: block; }
.zl-routine span { color: var(--muted); font-size: 13px; }
.zl-inline-link { font-size: 13px; font-weight: 600; text-decoration: none; }
.zl-inline-link:hover { text-decoration: underline; }
.zl-faq { margin-top: 22px; border-block: 1px solid var(--line); }
.zl-faq details + details { border-top: 1px solid var(--line); }
.zl-faq summary { padding: 19px 4px; color: var(--ink); cursor: pointer; font-weight: 600; }
.zl-faq details p { max-width: 850px; padding: 0 4px 22px; font-size: 14px; }
.zl-next { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 42px; padding: 29px 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--accent-soft); }
.zl-next h2 { font-size: 23px; }
.zl-next p { max-width: 660px; margin-top: 10px; font-size: 13px; }
.zl-next > .zl-button { flex-shrink: 0; }
.zl-learning .zl-source { margin-top: 25px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.zl-learning kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; min-height: 25px; padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 5px; background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: 11px; line-height: 1.3; font-weight: 600; white-space: nowrap; }
/* Reference chart. The examples remain readable without scripting. */
.zl-chart-controls, .zl-chart-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.zl-chart-controls { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.zl-filter-group { display: flex; flex-wrap: wrap; gap: 5px; }
.zl-filter-group button { min-width: 0; overflow-wrap: anywhere; hyphens: auto; min-height: 38px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.zl-filter-group button:hover { background: var(--canvas); }
.zl-filter-group button[aria-pressed="true"] { background: var(--accent-soft); color: var(--zl-accent); }
.zl-search { flex: 0 1 260px; min-width: 160px; }
.zl-learning .zl-search input { width: 100%; min-width: 0; height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); color: var(--ink); font-size: 12px; }
.zl-chart-options { padding: 15px 3px 2px; color: var(--muted); font-size: 12px; }
.zl-chart-options > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 15px; }
.zl-chart-options label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.zl-chart-options input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.zl-symbol-group { margin-top: 30px; }
.zl-group-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 13px; }
.zl-group-heading h2 { font-size: 18px; letter-spacing: -.2px; }
.zl-group-heading > span { color: var(--muted); font-size: 11px; }
.zl-symbol-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 11px; }
.zl-symbol { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 15px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; transition: background .15s, border-color .15s; }
.zl-symbol:hover, .zl-symbol[aria-pressed="true"] { border-color: var(--zl-accent); background: var(--accent-soft); }
.zl-symbol-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.zl-symbol-glyph { font-family: Arial, sans-serif; font-size: 38px; line-height: 1.4; font-weight: 400; }
.zl-symbol .zl-key-hint { min-width: 24px; padding-inline: 5px; font-size: 10px; }
.zl-pinyin-hint { display: block; min-height: 22px; margin-top: 4px; color: var(--zl-accent); font-size: 12px; }
.zl-symbol-example { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.zl-symbol-example > :first-child { font-size: 19px; }
.zl-symbol-example > :last-child { color: var(--muted); font-family: Arial, sans-serif; font-size: 12px; }
.zl-example-pinyin { color: var(--muted); font-size: 11px; }
.zl-example-meaning { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.zl-chart-sheet.zl-hide-readings :is(.zl-pinyin-hint, .zl-reading-hint), .zl-chart-sheet.zl-hide-keys .zl-key-hint { visibility: hidden; }
.zl-chart-empty { padding: 30px 15px; text-align: center; }
.zl-symbol-dialog { width: min(620px, calc(100vw - 30px)); max-width: none; max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow-y: auto; background: var(--surface); color: var(--ink); box-shadow: 0 24px 90px #13223840; }
.zl-symbol-dialog::backdrop { background: #15213770; backdrop-filter: blur(3px); }
.zl-symbol-dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.zl-symbol-dialog-header .zl-kicker { margin: 0; color: var(--muted); }
.zl-symbol-dialog-header button { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; background: var(--canvas); color: var(--ink); font-size: 25px; }
.zl-symbol-detail { display: flex; align-items: center; gap: 24px; padding: 22px 26px; }
.zl-symbol-detail > #zl-detail-glyph { flex: 0 0 65px; color: var(--zl-accent); font-family: Arial, sans-serif; font-size: 58px; text-align: center; }
.zl-symbol-detail > div:nth-child(2) { flex: 1; }
.zl-symbol-detail .zl-kicker { margin-bottom: 6px; font-size: 10px; }
.zl-symbol-detail h2 { font-size: 20px; letter-spacing: 0; }
.zl-symbol-detail p { margin-top: 7px; font-size: 12px; }
.zl-detail-key { display: flex; flex: 0 0 80px; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.zl-detail-key kbd { min-width: 40px; height: 40px; font-size: 16px; }
.zl-symbol-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 22px; border-top: 1px solid var(--line); }
.zl-symbol-dialog-footer > span { color: var(--muted); font-size: 11px; }
.zl-symbol-dialog-footer button:disabled { opacity: .45; cursor: default; }
.zl-print-heading, .zl-print-note { display: none; }
.zl-syllable-line { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; margin: 20px 0; padding: 15px; border-radius: 10px; background: var(--canvas); }
.zl-syllable-line > span { color: var(--ink); font-size: 23px; }
.zl-syllable-line > b { color: var(--muted); font-weight: 400; }
.zl-syllable-line small { color: var(--muted); font-size: 12px; }
/* The pitch contours are original, intentionally schematic diagrams. */
.zl-tone-intro { max-width: 850px; margin-bottom: 28px; }
.zl-tone-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.zl-tone-card { display: flex; flex-direction: column; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.zl-tone-title { display: flex; align-items: center; gap: 10px; }
.zl-tone-title h2 { flex: 1; font-size: 16px; letter-spacing: -.3px; }
.zl-tone-mark { color: var(--zl-accent); font-size: 26px; }
.zl-tone-card:first-child .zl-tone-mark { max-width: 30px; color: var(--muted); font-size: 10px; line-height: 1.35; text-align: right; }
.zl-tone-card svg { display: block; width: 100%; height: 130px; margin: 15px 0 12px; overflow: visible; }
.zl-tone-guide { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.zl-tone-curve { fill: none; stroke: var(--zl-accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.zl-tone-start { fill: var(--zl-accent); }
.zl-tone-card h3 { min-height: 25px; font-size: 14px; }
.zl-tone-card > p { flex: 1; margin-top: 8px; font-size: 12px; line-height: 1.8; }
.zl-tone-example { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.zl-tone-example > :first-child { font-size: 32px; }
.zl-tone-example > :nth-child(2) { color: var(--muted); font-family: Arial, sans-serif; font-size: 20px; }
.zl-tone-example > small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.zl-tone-key { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.zl-neutral { display: flex; align-items: center; gap: 28px; margin-top: 20px; padding: 26px 30px; border: 1px solid var(--line); border-radius: 17px; background: var(--accent-soft); }
.zl-neutral-dot { display: flex; align-items: center; justify-content: center; flex: 0 0 90px; height: 100px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--zl-accent); font-size: 90px; line-height: 1; padding-top: 45px; }
.zl-neutral p { font-size: 13px; }
.zl-readable-list { margin: 18px 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.zl-readable-list li + li { margin-top: 13px; }
.zl-tone-spelling { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.zl-tone-spelling > span { padding: 7px 9px; border-radius: 6px; background: var(--canvas); font-family: Arial, sans-serif; font-size: 19px; }
.zl-sandhi { display: flex; align-items: center; justify-content: space-around; gap: 12px; margin: 22px 0; padding: 15px; border-radius: 10px; background: var(--canvas); }
.zl-sandhi > span { color: var(--muted); font-size: 10px; }
.zl-sandhi strong { display: block; margin-top: 3px; color: var(--ink); font-size: 23px; font-weight: 500; }
.zl-sandhi > b { color: var(--zl-accent); font-weight: 400; }
.zl-quiz-question { min-width: 0; margin: 19px 0 0; padding: 22px 24px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.zl-learning .zl-quiz-question legend { max-width: 100%; padding: 0 9px; color: var(--ink); font-size: 14px; font-weight: 600; }
.zl-quiz-question legend span { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; margin-right: 10px; border-radius: 50%; background: var(--canvas); color: var(--muted); font-size: 11px; }
.zl-quiz-options { display: flex; flex-wrap: wrap; gap: 10px; }
.zl-quiz-options label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 17px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.zl-learning .zl-quiz-options label:has(:checked) { border-color: var(--zl-accent); background: var(--accent-soft); color: var(--ink); }
.zl-quiz-options input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.zl-quiz-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.zl-quiz-footer .zl-quiz-result { min-height: 32px; margin: 0; padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 20px; }
.zl-quiz-footer .zl-quiz-result[data-correct="true"] { color: var(--zl-success); font-weight: 600; }
.zl-quiz-footer .zl-quiz-result[data-correct="false"] { color: var(--zl-error); font-weight: 600; background: transparent; }
.zl-quiz-footer details { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.zl-quiz-footer summary { width: fit-content; cursor: pointer; }
.zl-quiz-footer details p { padding: 10px 0 0; }
/* Walkthrough: key sequences echo our real keyboard without copying its toolbar. */
.zl-typing-overview { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px; padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.zl-typing-overview h2 { font-size: 32px; }
.zl-typing-overview p { font-size: 14px; }
.zl-typing-overview .zl-button { margin-top: 22px; }
.zl-greeting { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 225px; padding: 25px; border-radius: 16px; background: var(--canvas); }
.zl-greeting > span { color: var(--ink); font-size: 70px; letter-spacing: 10px; line-height: 1.4; }
.zl-greeting strong { color: var(--zl-accent); font-family: Arial, sans-serif; font-size: 24px; font-weight: 400; }
.zl-greeting small { margin-top: 10px; color: var(--muted); font-size: 13px; }
.zl-typing-steps { list-style: none; margin: 35px 0 0; padding: 0; }
.zl-typing-steps > li { display: flex; gap: 25px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.zl-typing-steps > li > .zl-step-number { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; }
.zl-typing-steps > li > div { flex: 1; min-width: 0; max-width: 890px; }
.zl-typing-steps h2 { font-size: 24px; }
.zl-typing-steps p { font-size: 14px; }
.zl-key-sequence { display: flex; flex-wrap: wrap; align-items: center; gap: 17px; margin: 22px 0; }
.zl-key-sequence > span { display: flex; align-items: center; gap: 14px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.zl-key-sequence kbd { width: 31px; height: 31px; font-size: 12px; }
.zl-key-sequence b, .zl-key-sequence > strong { color: var(--ink); font-family: Arial, sans-serif; font-size: 27px; font-weight: 400; }
.zl-key-sequence > i { color: var(--muted); font-size: 18px; font-style: normal; }
.zl-key-sequence > strong { color: var(--zl-accent); }
.zl-shortcuts { margin: 17px 0; }
.zl-shortcuts > div { display: grid; grid-template-columns: 1fr 1.1fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.zl-shortcuts dt { color: var(--ink); font-size: 12px; font-weight: 600; }
.zl-shortcuts dd { margin: 0; color: var(--muted); font-size: 12px; }
@media (max-width: 1000px) {
    .zl-path-grid, .zl-tone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .zl-symbol-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .zl-symbol { padding: 12px 11px; }
    .zl-start { gap: 28px; }
    .zl-sound-pieces { gap: 8px; }
    .zl-sound-pieces > span { min-width: 57px; }
}
@media (max-width: 760px) {
    .zl-learning { font-size: 14px; }
    .zl-start, .zl-typing-overview { grid-template-columns: 1fr; gap: 26px; padding: 25px; }
    .zl-start h2 br { display: none; }
    .zl-start h2 { font-size: 34px; }
    .zl-first-word { padding: 22px; }
    .zl-sound-pieces > span { min-width: 75px; }
    .zl-two-columns { grid-template-columns: 1fr; }
    .zl-section { margin-top: 34px; }
    .zl-section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .zl-section-heading > p { max-width: none; }
    .zl-paper { padding: 24px; }
    .zl-chart-controls { align-items: stretch; flex-direction: column; gap: 10px; padding: 10px; }
    .zl-filter-group { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
    .zl-filter-group button { padding: 8px 4px; font-size: 11px; }
    .zl-search { flex-basis: auto; }
    .zl-chart-options { align-items: flex-start; }
    .zl-chart-options > span { flex: 0 0 64px; padding-top: 8px; font-size: 11px; }
    .zl-chart-options > div { gap: 10px 13px; }
    .zl-chart-options label { font-size: 11px; }
    .zl-symbol-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .zl-symbol-glyph { font-size: 34px; }
    .zl-symbol-detail { gap: 15px; padding: 18px; align-items: flex-start; }
    .zl-symbol-detail > #zl-detail-glyph { flex-basis: 40px; font-size: 42px; }
    .zl-symbol-detail h2 { font-size: 17px; }
    .zl-symbol-detail .zl-detail-key { flex-basis: 55px; }
    .zl-next { align-items: flex-start; flex-direction: column; gap: 20px; padding: 25px; }
    .zl-next h2 { font-size: 22px; }
    .zl-neutral { gap: 20px; padding: 23px; }
    .zl-neutral-dot { flex-basis: 60px; height: 80px; font-size: 70px; padding-top: 40px; }
    .zl-neutral h2 { font-size: 23px; }
    .zl-typing-overview h2 { font-size: 28px; }
    .zl-typing-steps > li { gap: 16px; padding: 24px 0; }
    .zl-typing-steps > li > .zl-step-number { flex-basis: 32px; width: 32px; height: 32px; border-radius: 9px; }
    .zl-typing-steps h2 { font-size: 21px; }
    .zl-key-sequence { gap: 9px; }
    .zl-key-sequence > span { gap: 7px; padding: 8px; }
}
@media (max-width: 450px) {
    .zl-filter-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .zl-start, .zl-typing-overview { padding: 21px; border-radius: 16px; }
    .zl-start h2 { font-size: 30px; }
    .zl-first-word { padding: 17px 12px; }
    .zl-sound-pieces > span { min-width: 62px; height: 78px; font-size: 30px; }
    .zl-path-grid { gap: 10px; }
    .zl-path-card { padding: 18px 14px 16px !important; border-radius: 13px; }
    .zl-path-card h3 { font-size: 16px; }
    .zl-path-card p { font-size: 12px; }
    .zl-path-art { min-height: 75px; font-size: 28px; letter-spacing: 0; }
    .zl-symbol-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .zl-symbol { padding: 10px; }
    .zl-group-heading { gap: 8px; }
    .zl-group-heading > span { font-size: 10px; }
    .zl-symbol-detail { flex-wrap: wrap; gap: 12px; }
    .zl-symbol-detail > div:nth-child(2) { flex-basis: calc(100% - 55px); }
    .zl-symbol-detail .zl-detail-key { flex: 0 0 100%; flex-direction: row; padding-left: 53px; }
    .zl-tone-grid { gap: 10px; }
    .zl-tone-card { padding: 15px 12px; }
    .zl-tone-title { gap: 6px; }
    .zl-tone-title .zl-step-number { width: 24px; height: 24px; flex-basis: 24px; font-size: 10px; border-radius: 6px; }
    .zl-tone-title h2 { font-size: 13px; }
    .zl-tone-mark { font-size: 22px; }
    .zl-tone-card svg { height: 100px; margin-block: 10px; }
    .zl-tone-card h3 { font-size: 13px; }
    .zl-tone-card > p { font-size: 11px; }
    .zl-tone-example > :first-child { font-size: 27px; }
    .zl-tone-example > :nth-child(2) { font-size: 17px; }
    .zl-tone-example > small { font-size: 11px; }
    .zl-neutral { align-items: flex-start; gap: 13px; padding: 18px; }
    .zl-neutral-dot { flex-basis: 34px; height: 46px; border: 0; background: transparent; font-size: 55px; padding-top: 27px; }
    .zl-quiz-question { padding: 16px; }
    .zl-learning .zl-quiz-question legend { padding: 0 4px; font-size: 13px; }
    .zl-quiz-options { flex-direction: column; gap: 7px; }
    .zl-quiz-options label { padding: 8px 12px; font-size: 13px; }
    .zl-greeting { min-height: 200px; padding: 20px 12px; }
    .zl-greeting > span { font-size: 61px; }
    .zl-key-sequence { gap: 7px; }
    .zl-key-sequence > span { flex-direction: column; gap: 5px; padding: 7px 9px; }
    .zl-key-sequence > strong { flex-basis: 100%; font-size: 24px; }
    .zl-key-sequence > i:last-of-type { display: none; }
    .zl-shortcuts > div { grid-template-columns: 1fr; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { .zl-path-card, .zl-symbol { transition: none; } .zl-path-card:hover { transform: none; } }
@media print {
    @page { size: A4; margin: 12mm; }
    body:has(.zl-chart-sheet) { margin: 0; background: #fff !important; color: #111 !important; }
    /* Remove other flow boxes, not just their ink, so they cannot create blank pages. */
    body:has(.zl-chart-sheet) > :not(:has(.zl-chart-sheet)),
    body:has(.zl-chart-sheet) :is(#main, .resource-shell, #zl-learning) > :not(:has(.zl-chart-sheet)):not(.zl-chart-sheet) { display: none !important; }
    body:has(.zl-chart-sheet) :is(#main, .resource-shell, #zl-learning) { display: block; position: static; width: 100%; max-width: none; height: auto; min-height: 0; margin: 0; padding: 0; border: 0; overflow: visible; background: #fff; }
    .zl-chart-sheet { position: static; width: 100%; color: #111; }
    .zl-print-heading { display: block; margin-bottom: 12px; }
    .zl-print-heading h2 { font-size: 23px; color: #111; }
    .zl-print-heading p { margin-top: 5px; font-size: 10px; color: #444; }
    .zl-symbol-group { margin-top: 14px; break-inside: avoid; }
    .zl-group-heading { margin-bottom: 7px; }
    .zl-group-heading h2 { color: #111; font-size: 13px; }
    .zl-group-heading > span { color: #444; font-size: 9px; }
    .zl-symbol-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
    .zl-symbol { padding: 6px 8px; border: 1px solid #bbb !important; border-radius: 5px; background: #fff !important; color: #111; break-inside: avoid; }
    .zl-symbol-glyph { font-size: 26px; }
    .zl-symbol .zl-key-hint { color: #222; border-color: #bbb; background: #fff; min-height: 18px; min-width: 18px; font-size: 8px; }
    .zl-pinyin-hint { min-height: 14px; margin-top: 0; color: #333; font-size: 9px; }
    .zl-symbol-example { margin-top: 5px; padding-top: 5px; gap: 4px; border-color: #ccc; }
    .zl-symbol-example > :first-child { font-size: 14px; }
    .zl-symbol-example > :last-child, .zl-example-pinyin { color: #333; font-size: 9px; }
    .zl-example-meaning { font-size: 8px; color: #444; margin-top: 2px; }
    .zl-print-note { display: block; margin-top: 16px !important; color: #333 !important; font-size: 9px; line-height: 1.6; }
    .zl-chart-sheet.zl-hide-readings :is(.zl-pinyin-hint, .zl-reading-hint), .zl-chart-sheet.zl-hide-keys .zl-key-hint { visibility: hidden !important; }
}

/* Arabic explanations flow right to left; study notation keeps its reading order. */
.zl-learning[dir="rtl"] { text-align: right; }
.zl-learning[dir="rtl"] :is(.zl-word-result > div,.zl-symbol,.pl-reference-card,.cl-reference-card,.cj-reference-card) { text-align: start; }
.zl-learning :is([lang^="zh"],[lang^="yue"],kbd,code,.zl-sound-pieces,.zl-key-sequence,.pl-pinyin,.pl-spelling,.pl-zhuyin,.cl-spelling,.cl-phrase-reading,.cj-key-flow,.cj-code,.cjp-code-roots,.cjt-root-row,.cjt-code-button,.pt-reading,.ct-output) { direction: ltr; unicode-bidi: isolate; }
.zl-learning[dir="rtl"] :is(.zl-readable-list,.zl-routine) { padding-inline-start: 1.4em; padding-inline-end: 0; }
.zl-learning[dir="rtl"] .zl-quiz-question { text-align: start; }
