.rainbow-title { background: linear-gradient(100deg,#ed9bba,#f4ca68,#8ce2d7,#b6a5f3); color:transparent; background-clip:text; }
.activity-home { width:min(1000px,calc(100% - 40px)); margin:0 auto; padding:35px 0 60px; }
.activity-home .hero-copy { max-width:750px; margin-bottom:35px; }
.activity-home .hero-copy h1 { font-size:clamp(3rem,7vw,5rem); }
.activity-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.activity-choice { display:flex; flex-direction:column; gap:18px; padding:30px; min-height:285px; border:1px solid var(--lavender); border-radius:var(--radius); color:var(--ink); text-decoration:none; background:var(--card); box-shadow:var(--shadow); }
.activity-choice:hover { border-color:var(--gold); background:var(--card-strong); }
.activity-choice:focus-visible { outline:3px solid var(--gold); outline-offset:5px; }
.reading-choice { background:linear-gradient(130deg,rgba(156,82,134,.25),rgba(42,121,127,.25)); }
.spelling-choice { background:linear-gradient(130deg,rgba(106,74,161,.35),rgba(154,118,44,.16)); }
.activity-symbol { font-size:2.7rem; color:var(--gold); }
.activity-name { font:700 clamp(1.9rem,4vw,2.5rem)/1.1 "Fraunces",Georgia,serif; }
.activity-description { color:var(--muted); line-height:1.6; max-width:32ch; }
.activity-enter { display:flex; justify-content:space-between; gap:16px; padding-top:8px; margin-top:auto; color:var(--gold-pale); font-weight:700; }
@media(max-width:600px) { .activity-choices { grid-template-columns:1fr; gap:18px; } .activity-choice { min-height:230px; padding:24px; } .activity-home { padding-top:22px; } }
#reading-app,#review-app { width:min(1088px,calc(100% - 40px)); margin:0 auto; outline:none; }
#reading-app > .home-shell > h1 { font-family:"Fraunces",Georgia,serif; font-size:clamp(2.7rem,7vw,5rem); line-height:1.05; margin:18px 0; letter-spacing:-.04em; }
.site-header a.brand { text-decoration:none; }
#reading-home,#reading-report,#reading-sound,.site-header a.quiet-button { font-size:.9rem; min-height:44px; }
.rainbow-word { font:700 clamp(2.5rem,8vw,5rem) "Fraunces",Georgia,serif; overflow-wrap:anywhere; margin:24px 0; }
.reading-actions { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin:22px 0; }
.reading-actions button,.word-bank button,.answer-tray button,.meaning-options button { min-height:48px; }
.word-bank,.answer-tray { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; padding:18px; border:1px solid var(--lavender); border-radius:16px; margin:18px 0; min-height:82px; }
.word-bank button,.answer-tray button { border:1px solid var(--mint); color:var(--ink); background:var(--night-soft); border-radius:10px; padding:12px 18px; font-size:1.2rem; cursor:pointer; }
.answer-tray { border-style:dashed; background:rgba(140,226,215,.06); }
.meaning-options { display:grid; gap:12px; margin:24px 0; }
.meaning-options button { padding:16px; border-radius:12px; border:1px solid var(--lavender); color:var(--ink); background:var(--night-soft); cursor:pointer; }
.meaning-options button[aria-pressed="true"] { border:3px solid var(--gold); background:var(--card-strong); }
.reading-input { display:block; width:100%; padding:16px; min-height:95px; margin:14px 0; border:1px solid var(--lavender); border-radius:12px; background:var(--night-soft); color:var(--ink); font-size:1.2rem; }
.reading-feedback { min-height:28px; line-height:1.7; color:var(--gold-pale); }
.reading-example { font-size:1.3rem; line-height:1.7; }
.reading-chip { display:inline-block; border:1px solid var(--mint); border-radius:99px; padding:7px 12px; margin:4px; }
.rainbow-entry { margin:24px 0; padding:24px; border:1px solid var(--mint); border-radius:20px; background:linear-gradient(110deg,rgba(237,155,186,.13),rgba(140,226,215,.12)); }
.rainbow-entry a,footer a { color:var(--mint); }
.report-item { text-align:left; padding:20px; border:1px solid var(--lavender); border-radius:16px; margin:18px 0; overflow-wrap:anywhere; }
.report-item p { white-space:pre-wrap; }
.problem-form select,.admin-key { width:100%; background:var(--night-soft); color:var(--ink); padding:14px; border:1px solid var(--lavender); border-radius:10px; }
.comparison { display:grid; gap:14px; margin:20px 0; }
.comparison audio { width:100%; }
.record-compare { margin:24px 0; padding:16px; border:1px solid rgba(255,255,255,.15); border-radius:16px; }
.record-compare .reading-actions { margin:16px 0; }
[data-visual-action] { display:inline-flex; align-items:center; justify-content:center; gap:10px; }
.action-picture { width:30px; height:30px; flex-shrink:0; }
.record-compare .reading-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.record-compare [data-visual-action] { flex-direction:column; min-height:110px; padding:16px 10px; border:2px solid transparent; }
.record-compare .action-picture { width:42px; height:42px; }
.record-compare [data-visual-action="mic"] { color:#ffc4cf; border-color:#d989a0; }
.record-compare [data-visual-action="stop"] { color:#ffe4a1; border-color:#cfb068; }
.record-compare [data-visual-action="play"] { color:#a5f1df; border-color:#72bfae; }
.record-compare [data-visual-action="listen"] { color:#d7caff; border-color:#a68fd9; }
#reading-app [data-visual-action]:disabled { opacity:.4; cursor:not-allowed; }
#hear-directions { margin:0 0 12px; color:var(--mint); }
.reading-step { color:var(--mint); }
@media(max-width:650px) { .site-header { align-items:flex-start; gap:12px; flex-direction:column; } .header-actions { flex-wrap:wrap; } .reading-actions { flex-direction:column; } .word-bank button,.answer-tray button { padding:10px 12px; } }

/* Keep the word and every recording action together without clipping content.
   Expanded details and enlarged text may still scroll for accessibility. */
body:has(.record-compare) .site-header { padding:6px 0; gap:4px; }
body:has(.record-compare) .system-notice { padding:7px 10px; margin-bottom:8px; font-size:.8rem; line-height:1.35; }
body:has(.record-compare) footer { padding:8px 16px; font-size:.75rem; }
#reading-app .center-shell:has(.record-compare) { min-height:0; padding:0; display:block; }
.book-card:has(.record-compare) { width:min(920px,100%); padding:18px 24px; container-type:inline-size; }
.book-card:has(.record-compare) .eyebrow { margin:0 0 4px; font-size:.68rem; }
.book-card:has(.record-compare) .reading-step { margin:4px 0; font-size:.85rem; }
.book-card:has(.record-compare) h1 { font-size:clamp(1.6rem,3.5vw,2rem); line-height:1.1; }
.book-card:has(.record-compare) h1.learning-target { display:block; font-size:min(clamp(3.75rem,20vw,7rem),calc(160cqi / var(--word-length))); line-height:1; margin:12px 0 0; overflow-wrap:anywhere; }
.record-compare > #learning-recording-status:empty { display:none; }
.book-card:has(.record-compare) #hear-directions { min-height:44px; margin:0; }
.book-card:has(.record-compare) .rainbow-word { font-size:clamp(2.4rem,6vw,3.5rem); line-height:1.05; margin:6px 0; }
.book-card:has(.record-compare) .reading-example { font-size:1.1rem; line-height:1.4; margin:6px 0; }
.book-card:has(.record-compare) > p:not(.eyebrow):not(.reading-step) { margin:6px 0; }
.book-card:has(.record-compare) .record-compare { margin:12px 0; padding:10px; }
.record-compare > p { margin:4px 0; line-height:1.35; }
.book-card:has(.record-compare) .reading-actions { margin:8px 0; gap:8px; flex-direction:row; }
.record-compare .reading-actions { grid-template-columns:repeat(4,minmax(0,1fr)); }
.record-compare [data-visual-action] { min-height:88px; padding:8px; gap:6px; }
.record-compare .action-picture { width:34px; height:34px; }
.recording-info { margin-top:6px; font-size:.8rem; color:var(--muted); }
.recording-info summary { cursor:pointer; padding:6px; }
.book-card:has(.record-compare) .reading-feedback:empty { display:none; }
.book-card:has(.record-compare) .reading-feedback { min-height:0; line-height:1.35; }
@media(max-width:650px) {
  body:has(.record-compare) #reading-app { width:calc(100% - 20px); }
  body:has(.record-compare) .site-header { align-items:center; }
  body:has(.record-compare) .site-header .brand { font-size:1rem; }
  body:has(.record-compare) .header-actions { gap:2px; flex-wrap:nowrap; }
  body:has(.record-compare) .header-actions .quiet-button { font-size:.75rem; padding:6px; white-space:nowrap; }
  .book-card:has(.record-compare) { padding:12px; }
  .book-card:has(.record-compare)::before { inset:5px; }
  .record-compare .reading-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .record-compare [data-visual-action] { min-height:70px; padding:6px; font-size:.85rem; }
  .record-compare .action-picture { width:28px; height:28px; }
  .book-card:has(.record-compare) > .reading-actions button { padding:8px; font-size:.8rem; }
  .book-card:has(.record-compare) > .reading-actions .action-picture { width:24px; height:24px; }
}
@media(max-height:740px) and (max-width:650px) {
  /* The same privacy information remains in About recordings. */
  body:has(.record-compare) footer { display:none; }
  .book-card:has(.record-compare) { padding:8px; }
  .book-card:has(.record-compare) h1 { display:inline-block; font-size:1.3rem; vertical-align:middle; margin-right:8px; }
  .book-card:has(.record-compare) #hear-directions { font-size:.75rem; vertical-align:middle; gap:4px; }
  .book-card:has(.record-compare) #hear-directions .action-picture { width:24px; height:24px; }
  .book-card:has(.record-compare) .rainbow-word { margin:2px 0; }
  .book-card:has(.record-compare) .reading-example { margin:2px 0; font-size:1rem; }
  .book-card:has(.record-compare) .record-compare { padding:6px; margin:6px 0; }
  .book-card:has(.record-compare) .reading-actions { margin:4px 0; gap:6px; }
  .recording-info { margin-top:2px; }
}

/* Sentence building needs the same all-actions-visible layout as recording.
   Keep normal document flow: large text/zoom and unusually long words can scroll. */
@media(max-width:650px) {
  body:has(.word-bank) .site-header { padding:6px 0; gap:4px; align-items:center; }
  body:has(.word-bank) .site-header .brand { font-size:1rem; }
  body:has(.word-bank) .header-actions { gap:2px; flex-wrap:nowrap; }
  body:has(.word-bank) .header-actions .quiet-button { padding:6px; font-size:.75rem; white-space:nowrap; }
  body:has(.word-bank) .system-notice { margin-bottom:6px; padding:5px 10px; font-size:.75rem; line-height:1.25; }
  body:has(.word-bank) #reading-app { width:calc(100% - 20px); }
  #reading-app .center-shell:has(.word-bank) { min-height:0; padding:0; display:block; }
  .book-card:has(.word-bank) { padding:10px; }
  .book-card:has(.word-bank)::before { inset:4px; }
  .book-card:has(.word-bank) .eyebrow { margin:0; font-size:.65rem; }
  .book-card:has(.word-bank) .reading-step { margin:3px 0; font-size:.8rem; }
  .book-card:has(.word-bank) h1 { margin:4px 0; font-size:1.5rem; line-height:1.1; }
  .book-card:has(.word-bank) #hear-directions { margin:0; min-height:44px; font-size:.8rem; }
  .book-card:has(.word-bank) > p { margin:4px 0; }
  .book-card:has(.word-bank) .action-picture { width:22px; height:22px; }
  .book-card:has(.word-bank) .word-bank,
  .book-card:has(.word-bank) .answer-tray { padding:6px; margin:6px 0; gap:6px; min-height:56px; }
  .book-card:has(.word-bank) .word-bank button,
  .book-card:has(.word-bank) .answer-tray button { min-height:44px; padding:6px 9px; font-size:1rem; }
  .book-card:has(.word-bank) > .reading-actions { display:flex; flex-direction:row; gap:6px; margin:6px 0; }
  .book-card:has(.word-bank) > .reading-actions button { flex:1; min-height:44px; padding:6px; font-size:.8rem; gap:4px; }
  .book-card:has(.word-bank) #hear-my-sentence,
  .book-card:has(.word-bank) #check-puzzle,
  .book-card:has(.word-bank) #reset-puzzle { flex-direction:column; }
  .book-card:has(.word-bank) .reading-feedback:empty { display:none; }
  .book-card:has(.word-bank) .reading-feedback { min-height:0; line-height:1.3; font-size:.85rem; }
  .book-card:has(.word-bank) .reading-input { margin:6px 0; min-height:75px; padding:8px; }
  body:has(.word-bank) footer { padding:8px 16px; font-size:.75rem; }
}
