/* Shared website and embedded iOS exercise controls. Button motion comes from button-feedback.css. */
.grammar-rule { margin: 0 0 16px; padding: 14px 16px; border: 1px solid #c4b5fd; border-radius: 12px; background: #f5f3ff; color: #3b2866; line-height: 1.6; font-size: 15px; }
.prompt-sentence-translation { color: #5b5870; font-size: 17px; line-height: 1.5; margin: 10px 0 0; }
.prompt-main.grammar-prompt { font-size: clamp(25px, 5vw, 40px); line-height: 1.65; overflow-wrap: anywhere; }
.new-word-badge { color: #6d28d9; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.prompt-word-anchor { position: relative; display: grid; justify-items: center; width: min(360px, 100%); }
.prompt-main.is-tappable { cursor: pointer; text-decoration: underline; text-decoration-color: #a78bfa; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.prompt-main.is-tappable:focus-visible { outline: 3px solid #7c3aed; outline-offset: 3px; }
.prompt-word-translation { position: absolute; z-index: 8; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(240px, calc(100vw - 56px)); padding: 10px 16px; border: 2px solid #9ca3af; border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(15, 23, 42, .16); color: #111827; font-size: 17px; font-weight: 800; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.prompt-word-translation::before { content: ''; position: absolute; bottom: -7px; left: calc(50% - 6px); width: 10px; height: 10px; transform: rotate(45deg); border-right: 2px solid #9ca3af; border-bottom: 2px solid #9ca3af; background: #fff; }
.exercise-shell .speak-label { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.exercise-shell .speak-label svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.exercise-shell.first-map-vocabulary .prompt-area { position: relative; min-height: 0; }
.exercise-shell.first-map-vocabulary .prompt-content { gap: 4px; }
.exercise-shell.first-map-vocabulary .prompt-pinyin { height: auto; margin-bottom: 2px; }
.exercise-shell.first-map-vocabulary .prompt-pinyin.is-hidden,
.exercise-shell.first-map-vocabulary .prompt-traditional.is-hidden { display: none; }
.exercise-shell.first-map-vocabulary #speakButton { position: absolute; top: 12px; left: 12px; width: 52px; min-width: 52px; height: 52px; padding: 0; border-color: #c4b5fd; border-radius: 13px; background: #f5f3ff; color: #6d28d9; box-shadow: none; animation: none; transition: transform 160ms ease-out, opacity 160ms ease-out; }
.exercise-shell.first-map-vocabulary #speakButton .speak-text { display: none; }
.exercise-shell.first-map-vocabulary #speakButton .speak-label svg { width: 28px; height: 28px; }
.exercise-shell.first-map-vocabulary #speakButton:is(:hover, :focus-visible):not(:disabled) { border-color: #c4b5fd; background: #f5f3ff; box-shadow: none; transform: translateY(-2px); }
.exercise-shell.first-map-vocabulary #speakButton:active:not(:disabled) { transform: scale(.985); }
.exercise-shell.first-map-vocabulary .toggle-button.active { border-color: #a78bfa; background: #ede9fe; color: #5b21b6; box-shadow: none; }
body .practice-view .exercise-shell.first-map-vocabulary #choices button.choice:not(.correct):not(.incorrect),
body .practice-view .exercise-shell.first-map-vocabulary #choices button.choice:not(.correct):not(.incorrect):hover,
body .practice-view .exercise-shell.first-map-vocabulary #choices button.choice:not(.correct):not(.incorrect):active { border-color: #9ca3af; }
.exercise-example { margin: 18px 0; padding: 16px; border: 1px solid #b8dfed; border-radius: 14px; background: #f4fbfe; text-align: left; }
.exercise-example-heading { margin: 0 0 8px; color: #3b2866; font-size: 14px; font-weight: 800; }
.exercise-example-chinese { font-size: 21px; line-height: 1.7; color: #282035; margin: 6px 0; overflow-wrap: anywhere; }
.exercise-example-translation { font-size: 14px; line-height: 1.6; color: #59566a; margin: 4px 0 12px; }
.exercise-example-line + .exercise-example-line { border-top: 1px solid #c9e4ed; padding-top: 10px; }
.example-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.example-actions button { min-height: 44px; padding: 10px 14px; }
.example-subscription { margin: 12px 0 0; font-size: 14px; line-height: 1.7; }
.example-subscription a { display: inline-block; color: #6d28d9; font-weight: 750; }
.example-status { color: #9f1239; font-size: 14px; line-height: 1.6; }
@media (max-width: 480px) {
    .exercise-example { padding: 12px; }
    .grammar-rule { padding: 12px; font-size: 14px; }
}

@media (max-width: 700px) {
    .exercise-shell .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(58px, auto); min-height: 0; padding: 0; }
    .exercise-shell .choice { height: auto; min-height: 58px; font-size: 15px; padding: 10px 8px; }
    .exercise-shell .prompt-area { padding: 12px; min-height: 0; }
    .exercise-shell .prompt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
    .exercise-shell .prompt-actions button { flex: 1 1 auto; min-height: 44px; padding: 8px 10px; }
    .exercise-shell .feedback-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; padding: 0; }
    .exercise-shell .feedback { grid-column: 1 / -1; }
    .exercise-shell .feedback:empty { display: none; }
    .exercise-shell .exercise-example { margin: 0; }
}

/* Map lessons use one open canvas, a word row, and four large answer cards. */
.practice-view .practice { border: 0; border-radius: 0; background: #fff; box-shadow: none; padding: clamp(12px, 2vw, 24px); }
.practice-view .lesson-progress-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 38px; margin: 0 0 18px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.practice-view .lesson-progress-count { grid-column: auto; color: #64748b; font-size: 11px; white-space: nowrap; }
.practice-view .lesson-progress-track { height: 9px; border: 0; border-radius: 999px; background: #e5e7eb; box-shadow: none; }
.practice-view .lesson-progress-fill { background: #22c55e; }
.practice-view .lesson-progress-hearts { min-width: 0; min-height: 0; padding: 0; border: 0; background: none; font-size: 16px; }
.practice-view .exercise-shell { display: grid; gap: 14px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.practice-view .prompt-area { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr; gap: 10px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: left; }
.practice-view .prompt-content { display: grid; justify-items: start; gap: 0; text-align: left; }
.practice-view .new-word-badge { position: relative; isolation: isolate; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-left: auto; padding: 4px 7px 4px 4px; border: 1px solid #fcd34d; border-radius: 9px; background: #fffbeb; color: #92400e; font-size: 11px; line-height: 1; letter-spacing: 0; white-space: nowrap; animation: new-word-badge-hop 3s ease-in-out infinite; }
.practice-view .new-word-badge > .new-word-badge-icon { display: block; width: 20px; height: 20px; flex: 0 0 20px; }
.practice-view #skipButton { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 118px; min-height: 44px; padding: 8px 12px; border: 2px solid #64748b; border-radius: 10px; background: #f8fafc; color: #334155; box-shadow: none; font-size: 14px; font-weight: 800; }
.practice-view #skipButton svg { flex: 0 0 24px; }
.practice-view #skipButton:is(:hover, :focus-visible):not(:disabled) { border-color: #475569; background: #f1f5f9; box-shadow: 0 4px 10px rgba(15, 23, 42, .1); }
.practice-view #skipButton:disabled { cursor: wait; opacity: .65; }
.practice-view .feedback-bar #skipButton { grid-column: 1; }
.practice-view .feedback-bar #checkButton { grid-column: 2; }
@media (max-width: 680px) { .practice-view .feedback-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 58px; gap: 8px; padding: 0; } }
.practice-view .new-word-badge-stars { position: absolute; inset: 0; pointer-events: none; }
.practice-view .new-word-badge-stars i { position: absolute; color: #d97706; font-style: normal; font-size: 8px; line-height: 1; opacity: 0; animation: new-word-star-rise 3s ease-out infinite; }
.practice-view .new-word-badge-stars i:nth-child(1) { top: 1px; right: 8px; }
.practice-view .new-word-badge-stars i:nth-child(2) { top: 0; right: 26px; animation-delay: 120ms; }
.practice-view .new-word-badge-stars i:nth-child(3) { top: 6px; right: 3px; font-size: 6px; animation-delay: 220ms; }
@keyframes new-word-badge-hop { 0%, 13%, 100% { transform: translateY(0); } 6% { transform: translateY(-3px); } }
@keyframes new-word-star-rise { 0%, 2%, 22%, 100% { opacity: 0; transform: translateY(0) scale(.6); } 8% { opacity: .9; transform: translateY(-4px) scale(1); } 17% { opacity: 0; transform: translateY(-10px) scale(.8); } }
@media (prefers-reduced-motion: reduce) { .practice-view .new-word-badge, .practice-view .new-word-badge-stars i { animation: none; } }
.practice-view .prompt-kind { margin: 0; color: #4b5563; font-size: clamp(15px, 1.8vw, 18px); line-height: 1.3; font-weight: 800; text-align: left; text-transform: none; transform: none; }
.practice-view .prompt-word-row { display: flex; align-items: center; gap: 15px; width: 100%; min-height: 76px; margin-top: 10px; }
.practice-view .prompt-word-copy { display: grid; justify-items: start; align-content: center; min-width: 0; }
.practice-view .prompt-word-anchor { justify-items: start; width: auto; max-width: 100%; }
.practice-view .prompt-pinyin, .practice-view .prompt-traditional { height: auto; max-width: 100%; margin: 0; color: #6b7280; font-size: 16px; line-height: 1.2; text-align: left; }
.practice-view .prompt-pinyin.is-hidden, .practice-view .prompt-traditional.is-hidden { display: none; }
.practice-view .prompt-main, .practice-view .prompt-main.text { display: block; width: auto; max-width: 100%; min-height: 0; margin: 0; padding: 0; border-radius: 0; background: transparent; color: #1f2937; font-size: clamp(31px, 7vw, 47px); line-height: 1.18; text-align: left; }
.practice-view .prompt-main.text { font-size: clamp(22px, 4vw, 29px); }
.practice-view .prompt-main.grammar-prompt { font-size: clamp(21px, 4vw, 32px); line-height: 1.4; }
.practice-view .first-map-vocabulary .prompt-main { color: #1f2937; }
.practice-view .prompt-main.is-new-word, .practice-view .first-map-vocabulary .prompt-main.is-new-word { color: #16a34a; }
.practice-view .prompt-main.is-new-word.is-tappable { text-decoration-color: #86efac; }
.practice-view .prompt-word-translation { bottom: calc(100% + 9px); left: 0; transform: none; }
.practice-view .prompt-word-translation::before { left: 18px; }
.practice-view .exercise-shell #speakButton { position: static; flex: 0 0 52px; width: 52px; min-width: 52px; height: 52px; padding: 0; border: 1px solid #c4b5fd; border-radius: 13px; background: #f5f3ff; color: #6d28d9; box-shadow: none; animation: none; }
.practice-view #speakButton .speak-text { display: none; }
.practice-view #speakButton .speak-label svg { width: 27px; height: 27px; }
.practice-view #speakButton:is(:hover, :focus-visible):not(:disabled) { border-color: #a78bfa; background: #ede9fe; transform: translateY(-2px); }
.practice-view .prompt-sentence-translation { margin: 7px 0 0; font-size: 14px; }
.practice-view .grammar-rule { margin: 0; padding: 4px 0 4px 10px; border: 0; border-left: 3px solid #c4b5fd; border-radius: 0; background: transparent; color: #5b21b6; font-size: 13px; line-height: 1.35; }
.practice-view .exercise-example { margin: 0; padding: 2px 0 2px 10px; border: 0; border-left: 3px solid #d1d5db; border-radius: 0; background: transparent; }
.practice-view .exercise-example-heading { margin-bottom: 2px; color: #64748b; font-size: 12px; }
.practice-view .exercise-example-chinese { margin: 0; font-size: 16px; line-height: 1.3; }
.practice-view .exercise-example-translation { margin: 2px 0 0; font-size: 12px; line-height: 1.3; }
.practice-view .example-actions { margin-top: 6px; }
.practice-view .example-actions button { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.practice-view .exercise-shell #choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(146px, auto); gap: 12px; justify-self: stretch; width: 100%; min-height: 0; padding: 0; }
body .practice-view #choices button.choice, body .practice-view #choices button.choice:hover, body .practice-view #choices button.choice:active { display: grid; place-items: center; min-height: 146px; padding: 16px 12px; border: 2px solid #d1d5db; border-bottom-width: 4px; border-radius: 16px; background: #fff; color: #374151; box-shadow: none; font-size: clamp(17px, 2.4vw, 22px); line-height: 1.25; font-weight: 800; text-align: center; }
body .practice-view #choices button.choice:hover:not(:disabled) { border-color: #9ca3af; transform: translateY(-2px); }
body .practice-view #choices button.choice.selected, body .practice-view #choices button.choice.selected:hover { border-color: #9ca3af; background: #f1f3f6; color: #1f2937; transform: translateY(-3px); }
body .practice-view #choices button.choice.correct, body .practice-view #choices button.choice.correct:hover { border-color: #22c55e; background: #dcfce7; color: #166534; }
body .practice-view #choices button.choice.incorrect, body .practice-view #choices button.choice.incorrect:hover { border-color: #ef4444; background: #fee2e2; color: #991b1b; }
.practice-view .feedback-bar { display: grid; grid-template-columns: 1fr; gap: 4px; min-height: 0; padding: 0; }
.practice-view .feedback-bar #checkButton { grid-row: 1; width: 100%; min-height: 50px; border-radius: 13px; font-size: 17px; }
.practice-view .feedback-bar #skipButton { grid-row: 2; justify-self: end; width: auto; min-width: 0; min-height: 32px; padding: 4px 8px; border: 0; background: transparent; box-shadow: none; color: #64748b; font-size: 12px; }
.practice-view .report-error-section { min-height: 0; margin: 2px 0 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.practice-view .report-error-button { min-width: 0; min-height: 34px; padding: 5px 8px; border: 0; background: transparent; color: #64748b; box-shadow: none; font-size: 11px; text-transform: none; }
.practice-view .report-error-icon { width: 14px; height: 14px; }
body.crp-lesson-active .site-header, body.crp-lesson-active .learning-nav-column, body.crp-lesson-active .learning-nav-mobile, body.crp-lesson-active .exercise-progress-rail, body.crp-lesson-active .exercise-page-heading { display: none; }
body.crp-lesson-active .exercise-layout { display: block; }
body.crp-lesson-active .practice { width: min(100%, 1000px); margin-inline: auto; }
body .practice-view #choices button.choice.visual-choice { grid-template-rows: minmax(54px, 1fr) auto; justify-items: center; align-items: center; padding: 12px 10px; }
.practice-view .choice-art { display: grid; place-items: center; align-self: center; min-height: 60px; font-size: clamp(42px, 8vw, 76px); line-height: 1; }
.practice-view .choice-art.is-number { color: #7c3aed; font-family: ui-rounded, -apple-system, BlinkMacSystemFont, sans-serif; font-size: clamp(58px, 11vw, 96px); font-weight: 900; }
.practice-view .choice-caption { align-self: end; color: #4b5563; font-size: clamp(14px, 1.8vw, 18px); line-height: 1.2; font-weight: 700; }
.practice-view .choice.correct .choice-caption { color: #166534; }
.practice-view .choice.incorrect .choice-caption { color: #991b1b; }

@media (max-width: 820px) {
    .practice-view .practice { padding: 10px 4px 20px; }
    .practice-view .lesson-progress-strip { grid-template-columns: auto minmax(0, 1fr) auto; }
    .practice-view .lesson-progress-count { grid-column: auto; }
    .practice-view .exercise-shell #choices { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(clamp(130px, 19dvh, 174px), auto); padding: 0; }
    body .practice-view #choices button.choice { min-height: clamp(130px, 19dvh, 174px); }
    .practice-view .feedback-bar { grid-template-columns: 1fr; min-height: 0; padding: 0; }
    .practice-view .feedback-bar #checkButton { width: 100%; }
    .practice-view .report-error-button { width: auto; }
}

@media (max-width: 360px) {
    .practice-view .prompt-word-row { gap: 7px; }
    .practice-view .exercise-shell #speakButton { flex-basis: 44px; width: 44px; min-width: 44px; height: 44px; }
    .practice-view .first-map-vocabulary .prompt-main { font-size: 27px; }
    .practice-view .new-word-badge { gap: 3px; padding: 3px 5px 3px 3px; font-size: 10px; }
    .practice-view .new-word-badge > .new-word-badge-icon { width: 18px; height: 18px; flex-basis: 18px; }
}
