.listen-write-letter-dialog { width: min(740px, calc(100vw - 24px)); max-width: 740px; max-height: calc(100dvh - 24px); margin: auto; padding: 0; overflow: auto; border: 1px solid #dce3d5; border-radius: 24px; background: #fffdf7; color: #233d35; box-shadow: 0 18px 80px #17332645; font-family: 'Nunito', sans-serif; }
.listen-write-letter-dialog::backdrop { background: #163b2d80; backdrop-filter: blur(5px); }
.listen-write-letter-dialog *, .listen-write-letter-dialog *::before, .listen-write-letter-dialog *::after { box-sizing: border-box; }
.listen-write-letter-dialog [hidden] { display: none !important; }
.listen-write-letter-dialog button { min-height: 48px; padding: 12px 17px; border: 1px solid #b8cbb3; border-radius: 13px; background: #fffefb; color: #286744; font: 800 16px/1.3 'Nunito', sans-serif; cursor: pointer; }
.listen-write-letter-dialog button:hover:enabled { background: #edf4e8; border-color: #44764d; }
.listen-write-letter-dialog button:disabled { opacity: .48; cursor: default; }
.listen-write-letter-dialog button:focus-visible { outline: 3px solid #3768b6; outline-offset: 3px; }
.listen-write-letter-dialog .lwl-primary { color: #fff; background: #286744; border-color: #286744; }
.listen-write-letter-dialog .lwl-primary:hover:enabled { background: #205738; border-color: #205738; }
.lwl-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px; border-bottom: 1px solid #e2e7db; position: sticky; top: 0; z-index: 2; background: #fffdf7; }
.lwl-eyebrow { margin: 0 0 6px; color: #58704f; font-size: 11px; font-weight: 900; letter-spacing: 1.2px; }
.lwl-header h3 { margin: 0; font-size: clamp(23px, 4vw, 29px); line-height: 1.25; }
.lwl-body h4:focus, .lwl-header h3:focus { outline: none; }
.listen-write-letter-dialog .lwl-close { flex: 0 0 48px; width: 48px; padding: 0; border-radius: 50%; font-size: 30px; font-weight: 600; line-height: 1; }
.lwl-body { padding: 24px 26px 28px; }
.lwl-body h4 { margin: 0 0 12px; font-size: clamp(23px, 4vw, 29px); line-height: 1.3; text-align: center; }
.lwl-intro { margin: 0 0 23px; color: #536b4d; font-size: 17px; line-height: 1.6; text-align: center; }
.lwl-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; }
.lwl-modes button { min-height: 58px; font-size: 19px; }
.listen-write-letter-dialog .lwl-modes button[aria-pressed='true'] { border: 2px solid #286744; background: #e3efdb; box-shadow: inset 0 0 0 1px #286744; color: #1c5135; }
.lwl-body h4.lwl-level-heading { margin-bottom: 17px; font-size: 22px; }
.lwl-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lwl-levels button { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; min-height: 174px; padding: 20px 8px; text-align: center; background: #f4f7ed; }
.lwl-levels small { font-size: 12px; font-weight: 800; }
.lwl-levels strong { font-size: 20px; line-height: 1.25; }
.lwl-levels span:not(.lwl-level-stars) { font-size: 13px; font-weight: 700; }
.lwl-level-stars { min-height: 31px; color: #ae851e; font-size: 25px; letter-spacing: 3px; }
.lwl-helper { margin: 20px 0 0; color: #536b4d; font-size: 14px; text-align: center; }
.lwl-progress-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; color: #536b4d; font-size: 13px; font-weight: 800; }
.lwl-progress-row p { margin: 0; }
.lwl-level-name { padding: 6px 11px; border-radius: 20px; background: #eaf1e3; }
.lwl-mode-name { margin: 13px 0 0; color: #536b4d; font-size: 15px; font-weight: 800; text-align: center; }
.lwl-paws { display: flex; justify-content: center; gap: 10px; margin: 16px 0 20px; padding: 0; list-style: none; }
.lwl-paws li { width: 31px; height: 31px; color: #d5ddcf; }
.lwl-paws li.is-complete { color: #387553; }
.lwl-paws svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.listen-write-letter-dialog .lwl-hear { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 58px; margin-top: 18px; font-size: 20px; }
.lwl-hear svg { width: 27px; height: 27px; flex: 0 0 27px; }
.lwl-voice-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; padding: 8px 0; }
.lwl-voice-row p { margin: 0; color: #536b4d; font-size: 13px; line-height: 1.55; }
.listen-write-letter-dialog .lwl-small { flex-shrink: 0; padding: 8px 12px; font-size: 13px; }
.lwl-write-label { margin: 7px 0 9px; font-size: 18px; font-weight: 800; }
.lwl-pad { position: relative; width: 100%; aspect-ratio: 1.7; min-height: 250px; max-height: 340px; overflow: hidden; border: 2px solid #a6b9a0; border-radius: 18px; background: #fff; }
.lwl-pad canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; background: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.lwl-writing-actions { display: grid; grid-template-columns: minmax(80px, .65fr) minmax(0, 1.35fr); gap: 10px; margin: 13px 0 0; }
.lwl-writing-actions button { min-height: 54px; }
.lwl-writing-actions button, .lwl-feedback-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.lwl-writing-actions button svg, .lwl-feedback-actions button svg { flex: 0 0 23px; width: 23px; height: 23px; }
.lwl-feedback-panel { position: relative; margin-top: 20px; padding: 18px; border: 1px solid #d6e2cd; border-radius: 17px; background: #f0f5e9; scroll-margin-top: 125px; }
.lwl-feedback-panel[data-kind='wrong'] { background: #fbf2e8; border-color: #ead7c0; }
.lwl-feedback-panel p { margin: 0 0 12px; color: #286744; font-size: 21px; font-weight: 900; line-height: 1.4; text-align: center; }
.lwl-feedback-panel[data-kind='error'] p { font-size: 16px; }
.lwl-feedback-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lwl-feedback-actions button { flex: 1 1 110px; }
.lwl-feedback-actions:empty { display: none; }
.lwl-stars { display: flex; justify-content: center; gap: 20px; min-height: 42px; margin: 0 0 12px; color: #ae851e; font-size: 29px; }
.lwl-stars span { animation: lwl-star-pop 850ms ease-out both; }
.lwl-stars span:nth-child(2) { animation-delay: 90ms; }
.lwl-stars span:nth-child(3) { animation-delay: 180ms; }
@keyframes lwl-star-pop { 0% { opacity: 0; transform: scale(.65) translateY(7px); } 45% { opacity: 1; transform: scale(1.12) translateY(-4px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
.listen-write-letter-dialog .lwl-change-level { display: block; margin: 20px auto 0; border-color: transparent; background: transparent; font-size: 14px; }
.lwl-complete { padding: 18px 0 14px; text-align: center; }
.lwl-complete-star { color: #ae851e; font-size: 76px; }
.lwl-complete h4 { margin-top: 15px; }
.lwl-complete p { margin: 0 0 23px; font-size: 18px; line-height: 1.6; }
.lwl-complete-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
@media (max-width: 520px) {
  .listen-write-letter-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .lwl-header { padding: 17px 16px; gap: 10px; }
  .lwl-header h3 { font-size: 23px; }
  .lwl-body { padding: 18px 16px 22px; }
  .lwl-levels { grid-template-columns: 1fr; gap: 10px; }
  .lwl-levels button { display: grid; grid-template-columns: 80px 1fr; grid-template-rows: auto auto auto; min-height: 108px; padding: 13px 15px; gap: 3px 10px; text-align: left; }
  .lwl-level-stars { grid-row: 1 / 4; align-self: center; font-size: 21px; letter-spacing: 0; }
  .lwl-levels strong { font-size: 19px; }
  .lwl-intro { font-size: 15px; }
  .lwl-modes { gap: 8px; margin-bottom: 23px; }
  .lwl-modes button { padding: 10px 8px; font-size: 17px; }
  .lwl-paws { margin: 13px 0 17px; gap: 9px; }
  .lwl-writing-actions { gap: 8px; }
  .lwl-writing-actions button { padding: 11px 9px; font-size: 14px; }
  .lwl-writing-actions button svg { flex-basis: 20px; width: 20px; height: 20px; }
  .lwl-feedback-panel { padding: 17px 12px; }
  .lwl-feedback-panel p { font-size: 19px; }
  .lwl-voice-row { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .lwl-stars span { animation: none; } }
