/* Mobile café activities follow the spacing and illustration sizes of Set 3. */
.cf-app .cf-word-audio {
  display: flex; align-items: center; justify-content: start; gap: 1rem;
  padding: .75rem 1rem; border: 1px solid var(--cf-line); border-radius: .8rem;
  background: var(--cf-lime); color: var(--cf-ink); font-weight: 750;
}
.cf-app .cf-word-audio svg { width: 1.5rem; height: 1.5rem; color: var(--cf-green); }
.cf-app .cf-complete .cf-art-award { display: block; width: 5rem; }
@media (max-width: 40rem) {
  .cf-app { font-size: clamp(16px,4.9vw,20px); line-height: 1.38; }
  .cf-app .cf-body { gap: clamp(14px,4vw,20px); padding: 20px 17px max(24px,env(safe-area-inset-bottom)); }
  .cf-app .cf-top { min-height: 62px; gap: 8px; padding: 7px 16px; }
  .cf-app .cf-top .cf-brand { font-size: 29px; }
  .cf-app .cf-top [data-cafe-exit] { margin-inline-start: 0; }
  .cf-app .cf-top [data-cafe-back] { min-width: 32px; font-size: 0; }
  .cf-app .cf-top [data-cafe-back]::before { content: "‹"; font-size: 27px; }
  .cf-app .cf-top [data-cafe-exit]::before { content: "×"; margin-right: .3em; font-size: 1.2em; }
  .cf-app .cf-top .cf-step { max-width: 9em; text-align: end; }
  .cf-app .cf-body h1 { font-size: clamp(29px,8.5vw,38px); line-height: 1.05; }
  .cf-app .cf-body h2 { font-size: clamp(22px,6.5vw,28px); }
  .cf-app .cf-kicker { font-size: 17px; margin-bottom: 8px; }
  .cf-app .cf-lead { font-size: inherit; }
  .cf-app :is(.cf-heading,.cf-practice-heading) > .cf-art { width: 28%; max-width: 104px; }
  .cf-app :is(.cf-primary,.cf-secondary,.cf-option,.cf-tile) { min-height: 52px; font-size: clamp(17px,5.1vw,21px); }
  .cf-app .cf-actions { gap: 10px; }
  .cf-app .cf-card { padding: 15px; }
  .cf-app .cf-frame:is([data-s3-screen="1"],[data-s3-screen="2"],[data-s3-screen="3"],[data-s3-screen="5"],[data-s3-screen="9"],[data-s3-screen="10"],[data-s3-screen="11"],[data-s3-screen="13"]) .cf-body > .cf-actions:last-child { margin-top: 12px; }
  .cf-app .cf-hero:not(.cf-media-heading,.cf-complete) > .cf-art { width: 48%; height: 125px; max-width: 190px; object-fit: contain; }
  .cf-app .cf-goals h2 { margin-bottom: 12px; }
  .cf-app .cf-goals li { min-height: 49px; }
  .cf-app .cf-goals li::before { width: 40px; height: 36px; }
  .cf-app .cf-metadata { min-height: 54px; }
  .cf-app [data-s3-screen="2"] .cf-word { gap: 15px; padding: 20px; }
  .cf-app .cf-word .cf-row { display: grid; }
  .cf-app .cf-word .cf-row > .cf-art { justify-self: end; width: 52%; max-width: 165px; height: 116px; }
  .cf-app .cf-word .cf-row h2 { font-size: 32px; }
  .cf-app .cf-word .cf-note { justify-self: stretch; }
  .cf-app .cf-word .cf-actions { padding-top: 14px; border-top: 1px solid var(--cf-line); }
  .cf-app [data-s3-screen="3"] .cf-card.cf-lime { padding-right: 27%; background: var(--cf-lime) url("/assets/cafe-lesson/cup.webp") right 3% bottom 18% / 24% auto no-repeat; }
  .cf-app [data-s3-screen="3"] h2 em { font-style: normal; text-decoration: underline; text-decoration-color: #efb82e; text-underline-offset: 4px; }
  .cf-app .cf-definitions p { padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 5px; align-items: center; min-height: 44px; }
  .cf-app .cf-definitions b { padding: 8px 10px; }
  .cf-app [data-s3-screen="3"] .cf-note { padding: 15px; }
  .cf-app [data-s3-screen="3"] .cf-note.cf-violet { padding-right: 22%; background: var(--cf-lilac) url("/assets/cafe-lesson/tea.webp") right 3% center / 21% auto no-repeat; }
  .cf-app .cf-word-audio { min-height: 60px; font-size: 23px; }
  .cf-app .cf-options { gap: 9px; }
  .cf-app .cf-option { min-height: 55px; }
  .cf-app .cf-radio { font-size: 24px; }
  .cf-app [data-s3-screen="5"] .cf-answer-slots { min-height: 87px; }
  .cf-app .cf-tiles { gap: 10px; }
  .cf-app .cf-tiles .cf-tile { min-height: 54px; }
  .cf-app .cf-gap-heading .cf-art { width: 48%; max-width: 160px; height: 114px; }
  .cf-app .cf-options-visual .cf-option { min-height: 76px; gap: 14px; padding: 6px 14px; }
  .cf-app .cf-options-visual .cf-art { width: 28%; height: 66px; }
  .cf-app .cf-reading-heading .cf-art { width: 66px; }
  .cf-app .cf-body .cf-reading-heading h1 { font-size: 20px; }
  .cf-app .cf-passage { gap: 4px; padding: 16px; }
  .cf-app .cf-passage .cf-art { width: 29%; }
  .cf-app .cf-reading-question { font-size: 20px; }
  .cf-app .cf-feedback { position: relative; padding: 18px; border: 0; }
  .cf-app .cf-feedback.cf-success { padding-left: 70px; }
  .cf-app .cf-feedback.cf-success::before { content: "✓"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); background: var(--cf-green); color: white; border-radius: 50%; width: 43px; height: 43px; line-height: 43px; text-align: center; font-size: 30px; font-weight: 800; }
  .cf-app .cf-feedback.cf-retry p[lang] { padding: 9px 12px; border-radius: 8px; background: var(--cf-lime); }
  .cf-app .cf-complete .cf-art { width: 80%; height: 145px; }
  .cf-app .cf-complete .cf-art-award { width: 98px; height: 79px; }
  .cf-app .cf-results { padding: 19px; gap: 15px; }
  .cf-app .cf-practice-row { min-height: 80px; }
  .cf-app .cf-practice-row .cf-art { width: 65px; height: 54px; }
  .cf-app .cf-practice-copy strong { font-size: 21px; }
  .cf-app .cf-practice-copy small { font-size: 16px; }
  .cf-app .cf-mistake-row { min-height: 76px; padding: 9px; }
  .cf-app [data-s3-screen="13"] .cf-note { background: var(--cf-lilac); }
  .cf-app [data-s3-screen="13"] .cf-actions { margin-block-start: 28px; }
  .cf-app [data-s3-screen="14"] .cf-prompt { padding: 20px 12px; font-size: 30px; }
  .cf-app .cf-flash-face { min-height: 110px; font-size: 23px; }
  .cf-app .cf-flash-art .cf-art { width: min(68vw,220px); }
  .cf-app [data-s3-screen="15"] .cf-flash-face { min-height: 148px; }
  .cf-app [data-s3-screen="15"] .cf-flash-face .cf-art { width: 32%; }
  .cf-app .cf-rating-prompt { font-size: 21px; }
  .cf-app .cf-media { gap: 21px; }
  .cf-app .cf-hero-art { width: 28%; max-width: 116px; }
  .cf-app .cf-media-prompt { min-height: 94px; font-size: 24px; }
  .cf-app .cf-playback .cf-player-row { min-height: 61px; padding: 10px; }
  .cf-app .cf-playback .cf-actions { margin-top: 12px; }
  .cf-app .cf-writing .cf-media-heading { flex-direction: column; align-items: start; }
  .cf-app .cf-writing .cf-hero-art { align-self: center; width: 65%; max-width: 218px; }
  .cf-app .cf-writing textarea { min-height: 157px; }
  .cf-app .cf-writing .cf-word-count { margin-top: -57px; margin-bottom: 6px; }
  .cf-app .cf-dialog { padding: 14px 18px max(25px,env(safe-area-inset-bottom)); gap: 17px; }
  .cf-app .cf-dialog > .cf-art { width: 102px; }
  .cf-app .cf-dialog h1 { font-size: 30px; }
  .cf-app .cf-audio-error { justify-content: flex-start; padding: 12px 0 20px; }
  .cf-app .cf-audio-error .cf-kicker { align-self: start; color: var(--cf-ink); font-size: 28px; }
  .cf-app .cf-audio-error .cf-hero-art { width: min(60%,210px); max-width: none; margin: 18px 0; }
}
.cf-app .cf-player-row :is(#cf-example,#cf-play-local) { min-width: 44px; min-height: 44px; padding: 8px; background: var(--cf-lime); color: var(--cf-green); border: none; }
.cf-app .cf-voice-icon { color: var(--cf-green); letter-spacing: 1px; font-size: 18px; }
@media (max-width: 40rem) {
  /* The general theme assigns important fonts to headings and controls. */
  body.cf-mode #app .cf-app { --klar-font: "Klar Cafe Inter", Inter, system-ui, sans-serif; }
  body.cf-mode #app .cf-body h1,
  body.cf-mode #app .cf-dialog h1 {
    font-family: var(--klar-font) !important;
    font-weight: 850 !important;
    letter-spacing: -.045em !important;
    line-height: 1.07;
    font-size: clamp(32px,9vw,39px);
  }
  body.cf-mode #app .cf-reading-heading h1 { font-size: 22px; }
  body.cf-mode #app .cf-body h2 { font-weight: 800 !important; letter-spacing: -.03em !important; }
  body.cf-mode #app .cf-body :is(.cf-primary,.cf-secondary,.cf-option,.cf-tile,.cf-word-audio),
  body.cf-mode #app .cf-dialog :is(.cf-primary,.cf-secondary) {
    font-family: var(--klar-font) !important;
    font-size: clamp(18px,5.4vw,22px);
    font-weight: 730;
    line-height: 1.2;
    min-height: 54px;
  }
  body.cf-mode #app .cf-body .cf-option { font-weight: 640; }
  body.cf-mode #app .cf-body .cf-practice-copy strong { font-weight: 760; }
  body.cf-mode #app .cf-body button.cf-primary:not(:disabled),
  body.cf-mode #app .cf-dialog button.cf-primary {
    background: #08783b; color: #fff; opacity: 1;
  }
  body.cf-mode #app .cf-body .cf-word .cf-row { grid-template-columns: minmax(0,1fr); }
  body.cf-mode #app .cf-word .cf-row > .cf-art { width: 62%; max-width: 195px; height: 136px; }
  body.cf-mode #app [data-s3-screen="5"] .cf-body > .cf-actions { margin-top: auto; padding-top: 14px; }
  body.cf-mode #app [data-s3-screen="9"] .cf-body .cf-option:disabled,
  body.cf-mode #app [data-s3-screen="10"] .cf-body .cf-option:disabled {
    opacity: 1; color: var(--cf-ink); -webkit-text-fill-color: currentColor;
  }
  body.cf-mode #app [data-s3-screen="9"] .cf-option[aria-pressed=true] {
    color: #14341b; border: 2px solid #168147; background: #ebf4c8;
  }
  body.cf-mode #app [data-s3-screen="9"] .cf-option[aria-pressed=true] .cf-radio {
    background: var(--cf-green); color: white; border-radius: 100%; font-size: 0;
    width: 25px; height: 25px; text-align: center;
  }
  body.cf-mode #app [data-s3-screen="9"] .cf-option[aria-pressed=true] .cf-radio::after {
    content: "✓"; font-size: 18px; line-height: 25px;
  }
  body.cf-mode #app .cf-dialog {
    min-height: min(440px,53dvh); align-content: start;
    gap: clamp(15px,2.2dvh,22px); padding: 16px 19px max(28px,env(safe-area-inset-bottom));
  }
  body.cf-mode #app .cf-dialog .cf-art { height: 68px; object-fit: contain; }
  body.cf-mode #app .cf-dialog h1 { font-size: 32px; }
  body.cf-mode #app .cf-dialog .cf-actions { margin-top: 8px; }
  body.cf-mode #app .cf-body h1[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
}

/* Art from the compact café boards. Wide screens keep their own illustrations. */
.cf-app picture.cf-art > img { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 40rem) {
  .cf-app .cf-goals li:nth-child(1)::before { background-image: url("/assets/cafe-lesson/goal-drink.webp"); }
  .cf-app .cf-goals li:nth-child(2)::before { background-image: url("/assets/cafe-lesson/goal-bill.webp"); }
  .cf-app .cf-goals li:nth-child(3)::before { background-image: url("/assets/cafe-lesson/goal-thanks.webp"); }
  .cf-app [data-s3-screen="3"] .cf-card.cf-lime { background-image: url("/assets/cafe-lesson/grammar-example-coffee.webp"); }
  .cf-app [data-s3-screen="3"] .cf-note.cf-violet { background-image: url("/assets/cafe-lesson/grammar-example-tea.webp"); }
  .cf-app [data-s3-screen="3"] .cf-note:last-of-type,
  .cf-app [data-s3-screen="5"] .cf-note.cf-violet,
  .cf-app [data-s3-screen="6"] .cf-note.cf-violet { padding-left: 3em; background-position: .5em center; background-size: 2em auto; background-repeat: no-repeat; }
  .cf-app [data-s3-screen="3"] .cf-note:last-of-type { background-image: url("/assets/cafe-lesson/grammar-tip.webp"); }
  .cf-app [data-s3-screen="5"] .cf-note.cf-violet { background-image: url("/assets/cafe-lesson/tile-helper.webp"); }
  .cf-app [data-s3-screen="6"] .cf-note.cf-violet { background-image: url("/assets/cafe-lesson/keyboard-tip.webp"); }
  .cf-app .cf-feedback.cf-success::before { content: ""; background: url("/assets/cafe-lesson/feedback-check.webp") center / contain no-repeat; border-radius: 0; }
  .cf-app .cf-feedback.cf-retry h2 { background: url("/assets/cafe-lesson/retry-bubble.webp") left center / 1.1em auto no-repeat; padding-left: 1.35em; }
}

.cf-app .cf-profile > img, .cf-app .cf-profile > .profile-identity { display: block; width: 2rem; height: 2rem; object-fit: cover; border-radius: 50%; }

@media (min-width: 40.001rem) {
  .cf-app .cf-goals li:nth-child(1)::before { background-image: url("/assets/cafe-lesson/wide/goal-drink.webp"); }
  .cf-app .cf-goals li:nth-child(2)::before { background-image: url("/assets/cafe-lesson/wide/goal-bill.webp"); }
  .cf-app .cf-goals li:nth-child(3)::before { background-image: url("/assets/cafe-lesson/wide/goal-thanks.webp"); }
  .cf-app [data-s3-screen="3"] .cf-card.cf-lime { padding-right:25%; background-position:right .5rem center; background-size:auto 80%; background-repeat:no-repeat; background-image: url("/assets/cafe-lesson/wide/grammar-example-coffee.webp"); }
  .cf-app [data-s3-screen="3"] .cf-note.cf-violet { padding-right:25%; background-position:right .5rem center; background-size:auto 80%; background-repeat:no-repeat; background-image: url("/assets/cafe-lesson/wide/grammar-example-tea.webp"); }
  .cf-app [data-s3-screen="3"] .cf-note:last-of-type,
  .cf-app [data-s3-screen="5"] .cf-note.cf-violet,
  .cf-app [data-s3-screen="6"] .cf-note.cf-violet { padding-left: 3em; background-position: .5em center; background-size: 2em auto; background-repeat: no-repeat; }
  .cf-app [data-s3-screen="3"] .cf-note:last-of-type { background-image: url("/assets/cafe-lesson/wide/grammar-tip.webp"); }
  .cf-app [data-s3-screen="5"] .cf-note.cf-violet { background-image: url("/assets/cafe-lesson/wide/tile-helper.webp"); }
  .cf-app [data-s3-screen="6"] .cf-note.cf-violet { background-image: url("/assets/cafe-lesson/wide/keyboard-tip.webp"); }
  .cf-app .cf-feedback.cf-success { position:relative; padding-left:4.6rem; }
  .cf-app .cf-feedback.cf-success::before { content: ""; position:absolute; left:.75rem; top:50%; transform:translateY(-50%); width:3rem; height:3rem; background: url("/assets/cafe-lesson/wide/feedback-check.webp") center / contain no-repeat; border-radius: 0; }
  .cf-app .cf-feedback.cf-retry h2 { background: url("/assets/cafe-lesson/wide/retry-bubble.webp") left center / 1.1em auto no-repeat; padding-left: 1.35em; }
}

/* Board-scale layout follows the available width and height. */

@media (min-width: 641px) {
  html:has(body.cf-mode) { font-size:clamp(100%,min(2.25vw,2.65svh),200%); }
  body.cf-mode #app .cf-frame { width:100%; min-height:100svh; }
  body.cf-mode #app .cf-body { width:min(100%,54rem); gap:clamp(.72rem,2.3svh,1.25rem); padding:clamp(1rem,3svh,2rem) clamp(1.2rem,3.5vw,2.35rem); }
  body.cf-mode #app .cf-top { padding-inline:clamp(1rem,3.5vw,2.35rem); }
  body.cf-mode #app .cf-body h1 { font-size:clamp(1.85rem,4.55vw,3rem); }
  body.cf-mode #app .cf-reading-heading h1 { font-size:1.4rem; }
  body.cf-mode #app .cf-workspace { grid-template-columns:21% minmax(0,1fr); }
  body.cf-mode #app .cf-body > .cf-actions:last-child { margin-top:auto; }
  body.cf-mode #app .cf-complete .cf-art-award { width:4.8rem; }
  body.cf-mode #app .cf-word .cf-actions { width:100%; }
  body.cf-mode #app [data-s3-screen="13"] .cf-segment { width:100%; }
}
@media (min-width:641px) and (max-width:1024px) {
  html:has(body.cf-mode) { font-size:clamp(100%,min(3.65vw,2.65svh),180%); }
  body.cf-mode #app .cf-workspace { grid-template-columns:15% minmax(0,1fr); }
  body.cf-mode #app .cf-body h1 { font-size:clamp(1.65rem,5.9vw,2.5rem); }
  body.cf-mode #app .cf-reading-heading h1 { font-size:1.2rem; }
  body.cf-mode #app [data-s3-screen="9"] .cf-options-visual { grid-template-columns:repeat(3,minmax(0,1fr)); }
  body.cf-mode #app [data-s3-screen="9"] .cf-options-visual .cf-option { flex-direction:column; justify-content:center; }
}
@media (max-width:640px) {
  body.cf-mode #app .cf-top .cf-step { margin-inline-start:auto; max-width:42%; }
  body.cf-mode #app .cf-word h2, body.cf-mode #app .cf-goals h2 { font-size:clamp(21px,6.4vw,29px); font-weight:800; }
  body.cf-mode #app .cf-options-visual .cf-option { min-height:clamp(52px,8svh,84px); }
  body.cf-mode #app .cf-audio { flex-wrap:nowrap; gap:.3rem; }
  body.cf-mode #app .cf-audio :is(button,select) { min-width:0; padding-inline:.25em; }
  body.cf-mode #app .cf-top [data-cafe-back] { min-width:24px; }
}
