/* Read with Mia: the passage stays central, with no floating panels over words. */
.reader-page {
  --reader-ink: #264d3b;
  --reader-muted: #64735e;
  --reader-line: #dce4d2;
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-bottom: 12px;
  color: var(--reader-ink);
}
.reader-page [hidden] { display: none !important; }
.reader-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.reader-back { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; margin-bottom: 7px; color: #526f56; font-size: 13px; }
.reader-back:hover { color: #204d35; }
.reader-eyebrow { color: #6d805f; font-size: 10px; font-weight: 1000; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; }
.reader-header h1 { margin-top: 5px; font-size: clamp(32px, 4vw, 45px); font-weight: 1000; line-height: 1.12; letter-spacing: -.045em; }
.reader-header-intro { margin-top: 8px; color: var(--reader-muted); font-size: 14px; line-height: 1.5; }
.reader-layout { display: grid; grid-template-columns: minmax(0, 1fr) 265px; align-items: start; gap: 24px; }
.reader-main { min-width: 0; }
.reader-pickers { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 13px; margin-bottom: 15px; }
.reader-pickers label { display: grid; min-width: 0; gap: 6px; }
.reader-pickers label > span { padding-left: 2px; color: #6c7b61; font-size: 11px; font-weight: 900; }
.reader-pickers select { width: 100%; min-width: 0; min-height: 48px; padding: 10px 33px 10px 14px; border: 1px solid var(--reader-line); border-radius: 13px; background: #fffef9; color: #365e43; font-size: 13px; font-weight: 850; }
.reader-pickers select:disabled { opacity: .62; }
.reader-activity { min-width: 0; padding: 25px; border: 1px solid var(--reader-line); border-radius: 25px; background: #fffef9; box-shadow: 0 5px 0 #e9ecdf, 0 16px 30px #28471e0b; }
.reader-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.reader-heading-row h2 { margin-top: 4px; color: #2e583e; font-size: clamp(23px, 2.7vw, 30px); font-weight: 1000; line-height: 1.2; letter-spacing: -.035em; }
.reader-part { flex: none; margin-top: 2px; padding: 7px 10px; border-radius: 10px; background: #eef3e5; color: #59704e; font-size: 10px; line-height: 1.4; }
.reader-instruction { margin: 13px 0 15px; color: var(--reader-muted); font-size: 13px; line-height: 1.6; }
.reader-line { display: flex; flex-wrap: wrap; align-content: center; align-items: center; justify-content: center; gap: 10px 11px; min-height: 150px; padding: 23px 15px; border: 1px solid #e6e8d6; border-radius: 19px; background: #faf8ec; text-align: center; }
.reader-word { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 46px; max-width: 100%; min-height: 58px; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; color: #2f503a; }
.reader-word-text { font-size: clamp(25px, 3vw, 36px); font-weight: 850; line-height: 1.25; letter-spacing: .01em; overflow-wrap: anywhere; }
.reader-word small { display: flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 9px; font-weight: 850; line-height: 1.3; white-space: nowrap; }
.reader-word small b { font-size: 13px; }
.reader-word-heard { border-color: #c5d8b8; background: #edf4e2; color: #3b6542; }
.reader-word-retry { border-color: #dec8a6; border-style: dashed; background: #fff1d8; color: #805d30; }
.reader-result-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px 17px; margin-top: 12px; font-size: 10px; }
.reader-result-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.reader-result-legend > span:first-child { color: #496f3d; }
.reader-result-legend > span:nth-child(2) { color: #805d30; }
.reader-result-legend b { font-size: 14px; }
.reader-result-legend small { color: #718064; font-size: 10px; }
.reader-feedback { min-height: 43px; margin-top: 16px; color: #5b7054; font-size: 13px; line-height: 1.6; }
.reader-feedback[data-tone="success"] { color: #3b6a43; }
.reader-feedback[data-tone="retry"] { color: #806337; }
.reader-feedback[data-tone="example"] { color: #65658a; }
.reader-recorder-state { display: flex; align-items: center; gap: 8px; width: fit-content; margin-top: 12px; padding: 9px 12px; border: 1px solid #e6bcae; border-radius: 10px; background: #fff0e7; color: #934734; font-size: 12px; }
.reader-recording-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #b4593e; box-shadow: 0 0 0 4px #b4593e17; }
.reader-recording-limit { padding-left: 9px; border-left: 1px solid #dfc3b5; color: #966b59; font-size: 10px; }
.reader-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 9px; margin-top: 15px; }
.reader-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 16px; border: 1px solid #d7e2c9; border-radius: 13px; background: #f3f6e9; color: #4f6b44; font-size: 12px; font-weight: 900; line-height: 1.4; text-align: center; }
.reader-button:hover:not(:disabled) { border-color: #aec59e; background: #eaf2dd; }
.reader-primary { border-color: #3b694c; background: #3b694c; color: #fffced; box-shadow: 0 3px 0 #285137; }
.reader-primary:hover:not(:disabled) { border-color: #2b593c; background: #2b593c; }
.reader-stop { border-color: #a76246; background: #a76246; color: #fff7e8; box-shadow: 0 3px 0 #81472f; }
.reader-stop:hover:not(:disabled) { border-color: #925134; background: #925134; }
.reader-button:disabled { opacity: .48; box-shadow: none; }
.reader-record { min-width: 171px; }
.reader-next { margin-left: auto; }
.reader-adult-button { flex: none; min-height: 44px; background: #fffdf5; font-size: 11px; }
.reader-connection-row { display: flex; align-items: flex-start; gap: 7px; margin-top: 19px; }
.reader-connection-dot { width: 6px; height: 6px; flex: none; margin-top: 5px; border-radius: 50%; background: #ae9770; }
.reader-connection-dot[data-state="ready"] { background: #7b9b60; }
.reader-connection-dot[data-state="checking"] { background: #a0a37e; }
.reader-connection { color: #7b856e; font-size: 10px; line-height: 1.5; }
.reader-details { margin-top: 14px; padding-top: 13px; border-top: 1px solid #e9ebdf; color: #758168; font-size: 11px; line-height: 1.6; }
.reader-details summary { width: fit-content; min-height: 36px; padding: 6px 4px 6px 0; color: #687e5d; font-size: 11px; font-weight: 900; }
.reader-details p { margin-top: 8px; overflow-wrap: anywhere; }
.reader-progress { margin: 18px 3px 0; color: #6e805e; font-size: 11px; line-height: 1.5; }
.reader-private-note { margin: 6px 3px 0; color: #818a74; font-size: 10px; line-height: 1.6; }
.reader-example-banner { display: flex; align-items: center; gap: 11px; margin: 17px 0 0; padding: 12px 13px; border: 1px solid #d7d6e7; border-radius: 13px; background: #f1effa; color: #69668c; }
.reader-example-banner > span { display: grid; place-items: center; width: 29px; height: 29px; flex: none; border: 1px solid #c6c3db; border-radius: 50%; font-size: 19px; }
.reader-example-banner strong { font-size: 12px; }
.reader-example-banner p { margin-top: 3px; font-size: 10px; line-height: 1.5; }
.reader-guide { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; margin-top: 27px; padding: 16px 23px 24px; overflow: hidden; border: 1px solid #dce4d0; border-radius: 25px; background: linear-gradient(150deg, #f0f3df, #e6eedc); text-align: center; }
.reader-guide::before { position: absolute; top: 25px; left: 50%; width: 185px; height: 185px; border: 1px solid #d9e3c4; border-radius: 50%; background: #e2ebca80; content: ''; transform: translateX(-50%); }
.reader-guide img { position: relative; width: 100%; max-width: 210px; height: 243px; object-fit: contain; object-position: center bottom; }
.reader-guide > div { position: relative; }
.reader-guide .reader-eyebrow { margin-top: 14px; font-size: 8px; }
.reader-guide h2 { margin-top: 9px; color: #4b6e44; font-size: 25px; font-weight: 1000; line-height: 1.15; letter-spacing: -.04em; }
.reader-guide > div > p:not(.reader-eyebrow) { margin-top: 13px; color: #748069; font-size: 12px; line-height: 1.65; }
.reader-guide-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 19px; padding-top: 15px; border-top: 1px solid #d5dfc6; text-align: left; }
.reader-guide-note > span { color: #8b9f6b; font-size: 23px; }
.reader-guide-note p { color: #748269; font-size: 10px; line-height: 1.6; }
.reader-setup { width: min(94vw, 610px); max-height: calc(100dvh - 36px); padding: 31px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #d9e2cb; border-radius: 24px; background: #fffef8; color: #4b6544; box-shadow: 0 20px 90px #1e3a2c30; }
.reader-setup::backdrop { background: #233e3280; backdrop-filter: blur(3px); }
.reader-dialog-close { display: flex; justify-content: flex-end; height: 0; }
.reader-close { display: grid; place-items: center; width: 44px; height: 44px; margin-top: -19px; margin-right: -19px; border: 0; border-radius: 12px; background: transparent; color: #7e8b70; font-size: 28px; line-height: 1; }
.reader-close:hover { background: #f0f3e4; }
.reader-setup h2 { max-width: 380px; margin-top: 6px; color: #31593e; font-size: 29px; font-weight: 1000; line-height: 1.15; letter-spacing: -.035em; }
.reader-setup > p:not(.reader-eyebrow) { margin-top: 13px; color: #69775e; font-size: 12px; line-height: 1.7; }
.reader-setup-facts { display: grid; gap: 14px; margin-block: 23px; }
.reader-setup-facts > div { display: flex; align-items: flex-start; gap: 12px; }
.reader-setup-facts > div > span { display: grid; place-items: center; width: 29px; height: 29px; flex: none; border-radius: 9px; background: #edf2df; color: #809165; font-size: 9px; }
.reader-setup-facts p { color: #7b846d; font-size: 11px; line-height: 1.7; }
.reader-setup-facts strong { color: #5d7551; font-weight: 900; }
.reader-allow { width: 100%; }
.reader-example-card { margin-top: 25px; padding: 20px; border: 1px solid #e1e3d3; border-radius: 17px; background: #f7f8ed; }
.reader-example-card h3 { margin-top: 5px; color: #536e48; font-size: 18px; font-weight: 1000; }
.reader-example-card > p:not(.reader-eyebrow) { margin: 9px 0 13px; color: #7b856d; font-size: 11px; line-height: 1.6; }
.reader-setup-connection { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; margin-top: 17px; }
.reader-setup-status { color: #7e876f; font-size: 10px; line-height: 1.6; }
.reader-text-button { min-height: 44px; padding: 9px 3px; border: 0; border-radius: 7px; background: transparent; color: #617f4e; font-size: 11px; font-weight: 900; }
.reader-text-button:hover:not(:disabled) { color: #315e3d; }
.reader-text-button:disabled { opacity: .5; }
@media (max-width: 960px) {
  .reader-layout { grid-template-columns: minmax(0, 1fr) 205px; gap: 18px; }
  .reader-activity { padding: 20px; }
  .reader-guide { padding: 13px 15px 20px; }
  .reader-guide img { height: 215px; }
  .reader-guide h2 { font-size: 23px; }
}
@media (max-width: 750px) {
  .reader-layout { grid-template-columns: minmax(0, 1fr); gap: 19px; }
  .reader-guide { flex-direction: row; align-items: center; gap: 20px; margin-top: 0; padding: 12px 22px 0; text-align: left; }
  .reader-guide::before { left: 88px; top: 10px; width: 135px; height: 135px; }
  .reader-guide img { width: 145px; height: 165px; flex: none; }
  .reader-guide > div { padding-block: 8px 21px; }
  .reader-guide .reader-eyebrow { margin-top: 0; }
  .reader-guide h2 br { display: none; }
  .reader-guide-note { margin-top: 11px; padding-top: 10px; }
  .reader-guide-note p { font-size: 10px; }
}
@media (max-width: 520px) {
  .reader-header { gap: 11px; margin-bottom: 16px; }
  .reader-back { min-height: 36px; margin-bottom: 4px; font-size: 11px; }
  .reader-header .reader-eyebrow, .reader-header-intro { display: none; }
  .reader-header h1 { margin-top: 2px; font-size: 29px; }
  .reader-adult-button { max-width: 100px; padding: 8px 10px; font-size: 10px; }
  .reader-adult-button > span { display: none; }
  .reader-pickers { gap: 9px; margin-bottom: 12px; }
  .reader-pickers label > span { font-size: 10px; }
  .reader-pickers select { min-height: 46px; padding-left: 10px; padding-right: 21px; border-radius: 11px; font-size: 11px; }
  .reader-activity { padding: 16px; border-radius: 21px; }
  .reader-heading-row { gap: 9px; }
  .reader-heading-row .reader-eyebrow { font-size: 8px; }
  .reader-heading-row h2 { margin-top: 3px; font-size: 25px; }
  .reader-part { padding: 6px 8px; font-size: 9px; }
  .reader-instruction { margin: 11px 0 12px; font-size: 12px; }
  .reader-line { min-height: 142px; padding: 16px 9px; gap: 8px 4px; border-radius: 15px; }
  .reader-word { min-width: 36px; min-height: 50px; padding: 6px 7px; border-radius: 9px; }
  .reader-word-text { font-size: 27px; }
  .reader-word small { font-size: 8px; }
  .reader-feedback { min-height: 0; margin-top: 13px; font-size: 12px; }
  .reader-result-legend { gap: 7px 12px; font-size: 9px; }
  .reader-result-legend small { flex-basis: 100%; text-align: center; font-size: 9px; }
  .reader-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 13px; }
  .reader-actions .reader-button { min-width: 0; min-height: 48px; padding: 10px 9px; font-size: 11px; }
  .reader-next { margin-left: 0; }
  .reader-actions [data-reader-action="retry"] { grid-column: 1 / -1; }
  .reader-connection-row { margin-top: 14px; }
  .reader-connection { font-size: 9px; }
  .reader-recorder-state { width: 100%; justify-content: center; font-size: 11px; }
  .reader-recording-limit { font-size: 9px; }
  .reader-example-banner { gap: 8px; margin-top: 12px; padding: 10px; }
  .reader-example-banner strong { font-size: 11px; }
  .reader-example-banner p { font-size: 9px; }
  .reader-progress { margin-top: 15px; font-size: 10px; }
  .reader-private-note { font-size: 9px; }
  .reader-guide { gap: 14px; padding: 9px 16px 0; border-radius: 20px; }
  .reader-guide img { width: 100px; height: 139px; }
  .reader-guide::before { left: 65px; top: 9px; width: 110px; height: 110px; }
  .reader-guide > div { padding-bottom: 15px; }
  .reader-guide .reader-eyebrow { font-size: 7px; }
  .reader-guide h2 { margin-top: 6px; font-size: 22px; }
  .reader-guide > div > p:not(.reader-eyebrow) { margin-top: 8px; font-size: 11px; }
  .reader-guide-note { display: none; }
  .reader-setup { max-height: calc(100dvh - 20px); padding: 23px; border-radius: 20px; }
  .reader-setup h2 { padding-right: 6px; font-size: 26px; }
  .reader-close { margin-top: -15px; margin-right: -15px; }
  .reader-setup-facts { gap: 12px; margin-block: 19px; }
  .reader-setup-facts > div { gap: 9px; }
  .reader-setup-facts p { font-size: 10px; }
  .reader-setup > p:not(.reader-eyebrow) { font-size: 11px; }
  .reader-example-card { margin-top: 21px; padding: 16px; }
  .reader-example-card .reader-button { width: 100%; font-size: 11px; }
}
@media (max-height: 760px) and (min-width: 751px) {
  .reader-header { margin-bottom: 13px; }
  .reader-header > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 20px; }
  .reader-back { margin-bottom: 0; min-height: 40px; font-size: 12px; }
  .reader-header .reader-eyebrow, .reader-header-intro { display: none; }
  .reader-header h1 { margin-top: 0; font-size: 30px; }
  .reader-pickers { margin-bottom: 12px; }
  .reader-pickers label { gap: 4px; }
  .reader-pickers select { min-height: 44px; padding-block: 8px; }
  .reader-activity { padding: 18px; }
  .reader-heading-row h2 { font-size: 25px; }
  .reader-instruction { margin: 9px 0 11px; font-size: 12px; }
  .reader-line { min-height: 114px; padding: 15px 10px; gap: 7px; }
  .reader-word { min-height: 48px; padding: 5px 8px; }
  .reader-word-text { font-size: 30px; }
  .reader-feedback { min-height: 0; margin-top: 11px; font-size: 12px; }
  .reader-actions { margin-top: 12px; }
  .reader-connection-row { margin-top: 13px; }
  .reader-guide { margin-top: 26px; padding-top: 12px; }
  .reader-guide img { height: 196px; }
  .reader-guide h2 { font-size: 23px; }
  .reader-guide-note { display: none; }
  .reader-progress { margin-top: 14px; }
}
@media (max-height: 520px) and (min-width: 521px) {
  .reader-layout { grid-template-columns: minmax(0, 1fr); }
  .reader-guide { display: none; }
  .reader-line { min-height: 100px; }
  .reader-setup { max-height: calc(100dvh - 16px); padding-block: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .reader-page *, .reader-page *::before, .reader-page *::after { scroll-behavior: auto; transition: none; animation: none; }
  .reader-setup::backdrop { backdrop-filter: none; }
}
.reader-path-practice { margin: 20px 0; padding: 18px; border: 1px solid #cbdcc8; border-radius: 20px; background: #eff5e7; }
.reader-path-practice[hidden] { display: none; }
.reader-path-practice > p { font-size: .9rem; line-height: 1.6; }
.reader-together { margin-top: 14px; padding-top: 14px; border-top: 1px solid #cfddc4; }
.reader-together summary { min-height: 44px; cursor: pointer; font-weight: 900; }
.reader-together label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; margin: 14px 0; }
.reader-together input { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 3px; }
.letter-voice-actions { padding: 18px; border: 1px solid #cfddc4; background: #f4f7e8; border-radius: 20px; }
.letter-voice-actions button { margin: 0 6px 8px 0; }
.letter-voice-actions p { line-height: 1.6; font-size: .9rem; }
