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