    :root { color-scheme: light; font-family: Segoe UI, Arial, sans-serif; color: #201a38; background: #fff; }
    * { box-sizing: border-box; }
    html { min-height: 100%; }
    body { margin: 0; min-height: 100vh; min-height: 100svh; width: 100%; overflow-x: hidden; display: grid; place-items: start center; padding: clamp(8px, 1.2vw, 16px); background: #fff; }
    main { display: flex; flex-direction: column; width: min(1240px, 100%); min-width: 0; overflow: hidden; border: 0; border-radius: 28px; background: #fff; box-shadow: none; }
    .stage { align-self: center; width: min(560px, 100%); padding: 8px; border: 2px dashed #ddd6f3; border-radius: 22px; background: #fff; }
    img { display: block; width: 100%; border-radius: 18px; background: #fff; }
    #frame { display: block; width: auto; max-width: 100%; height: auto; max-height: min(520px, max(180px, calc(100svh - 220px))); margin-inline: auto; object-fit: contain; }
    [hidden] { display: none !important; }
    .empty-stage { min-height: 180px; display: grid; place-items: center; color: #7048bd; font-weight: 800; text-align: center; background: #fff; }
    .animation-frame { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: calc(100svh - 120px); border: 0; border-radius: 18px; background: #fff; }
    .page-heading { padding: 26px clamp(18px, 3vw, 42px) 20px; text-align: center; background: #fff; }
    .page-heading .tagline { margin-bottom: 0; }
    .content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "actions voice" "scene scene" "status status" "uploads code" "panel panel" "editor editor" "export export" "recorder recorder" "note note" "seo seo"; column-gap: 18px; row-gap: 8px; padding: 28px clamp(18px, 3vw, 42px) 30px; }
    .content > .top-actions { grid-area: actions; }
    .content > #scene { grid-area: scene; }
    .content > #status { grid-area: status; }
    .content > .voice-row { grid-area: voice; align-self: center; margin-top: 16px; }
    .content > .upload-row { grid-area: uploads; }
    .content > .editor-toggle { grid-area: code; }
    .content > #animation-editor-panel { grid-area: panel; }
    .content > #editor { grid-area: editor; }
    .content > .recorder-info { grid-area: recorder; }
    .content > .note { grid-area: note; }
    .content > .seo-content { grid-area: seo; }
    h1 { margin: 0; text-align: center; font-size: clamp(22px, 4vw, 32px); }
    .tagline { margin: 6px 0 14px; color: #7048bd; font-size: 14px; font-weight: 700; line-height: 1.5; text-align: center; }
    #scene { margin: 8px 0 0; color: #7048bd; font-weight: 800; }
    #status { min-height: 24px; margin: 16px 0 0; color: #575b81; line-height: 1.55; }
    .voice-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(0, .9fr); align-items: end; gap: 8px; min-width: 0; margin-top: 14px; color: #575b81; font-size: 14px; font-weight: 700; }
    .voice-field { display: grid; gap: 4px; min-width: 0; }
    .voice-field label { overflow: hidden; color: #575b81; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
    .voice-row select { width: 100%; min-width: 0; max-width: 100%; height: 40px; padding: 8px 21px 8px 8px; font-size: 11px; }
    select { min-width: 240px; max-width: 100%; border: 1px solid #ddd3f1; border-radius: 10px; padding: 9px 10px; color: #30254d; background: #fff; }
    .editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
    .upload-row { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 64px; margin-top: 18px; padding: 10px 12px; border: 1px solid #e4ddf4; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px #64568a12; }
    .upload-button { display: inline-flex; align-items: center; justify-content: center; margin: 0; border-radius: 14px; padding: 11px 16px; color: #fff; background: linear-gradient(100deg, #8650ee, #12a9b4); font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px #7650c538; }
    .upload-button:hover { filter: brightness(1.04); }
    .upload-status { color: #575b81; font-size: 13px; line-height: 1.4; }
    #image-upload { display: none; }
    .editor-toggle { justify-self: stretch; align-self: end; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 64px; margin-top: 18px; border: 1px solid #e4ddf4; color: #5c4a8e; background: #f5f1ff; box-shadow: 0 6px 18px #64568a12; }
    .editor-toggle:hover { background: #eee7ff; }
    .code-editor-card { margin-top: 18px; padding: 14px; border: 1px solid #e4ddf4; border-radius: 16px; background: linear-gradient(135deg, #fbf9ff, #f3fbfc); }
    .code-editor-card label { display: block; margin-bottom: 8px; color: #7048bd; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
    #animation-code { min-height: 170px; height: 170px; resize: vertical; color: #25304d; background: #fff; font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.45; tab-size: 2; }
    #animation-text { min-height: 72px; height: 72px; resize: vertical; }
    .code-help { margin: 8px 0 0; color: #575b81; font-size: 13px; line-height: 1.45; }
    .canvas-requirement { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #b9e3f0; border-left: 4px solid #0e9baa; border-radius: 8px; color: #24445a; background: #effaff; }
    .code-tools { display: flex; flex-wrap: wrap; gap: 8px; }
    .code-tools button { margin-top: 12px; }
    .recorder-info { width: 100%; margin: 18px 0 0; padding: 14px 16px; border: 1px solid #e4ddf4; border-radius: 16px; color: #575b81; line-height: 1.55; background: #faf8ff; }
    .recorder-info h2 { margin: 0 0 6px; color: #7048bd; font-size: 15px; }
    .recorder-info p { margin: 0; }
    .recorder-link { display: inline-block; margin-top: 10px; color: #7048bd; font-weight: 800; text-decoration: none; }
    .recorder-link:hover { text-decoration: underline; }
    .script-card { min-width: 0; padding: 14px; border: 1px solid #e4ddf4; border-radius: 16px; background: linear-gradient(135deg, #fbf9ff, #f3fbfc); box-shadow: 0 6px 18px #64568a0d; }
    .editor-image { width: 100%; height: 180px; object-fit: contain; margin-bottom: 10px; border-radius: 12px; background: #fff; }
    .script-card label { display: block; margin-bottom: 8px; color: #7048bd; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
    textarea { display: block; width: 100%; box-sizing: border-box; min-height: 72px; height: 72px; resize: vertical; border: 1px solid #ddd3f1; border-radius: 12px; padding: 11px 12px; color: #41375f; background: #fff; font: inherit; line-height: 1.55; outline: none; }
    textarea:focus, select:focus { border-color: #8650ee; box-shadow: 0 0 0 3px #8650ee1c; }
    .top-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
    .top-actions button { margin-top: 0; }
    button { margin-top: 16px; border: 0; border-radius: 14px; padding: 13px 22px; color: #fff; background: linear-gradient(100deg, #8650ee, #12a9b4); font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px #7650c538; }
    button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
    button.secondary { margin-left: 8px; color: #5c4a8e; background: #f5f1ff; box-shadow: none; }
    .transcript { margin: 14px 10px 0; padding: 10px 0 0; border: 0; border-radius: 0; background: #fff; }
    .transcript-title { margin: 0 0 8px; color: #7048bd; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
    .transcript-window { overflow: hidden; min-height: 58px; display: flex; align-items: center; padding: 0; background: #fff; }
    #transcript { margin: 0; color: #41375f; font-size: clamp(17px, 3.8vw, 20px); line-height: 1.75; }
    .transcript:not(.is-scrolling) #transcript { width: 100%; white-space: normal; text-align: center; transform: translateX(0); }
    .transcript.is-scrolling #transcript { width: max-content; white-space: nowrap; animation: transcript-marquee var(--marquee-duration, 28s) linear 1 forwards; }
    @keyframes transcript-marquee { from { transform: translateX(var(--marquee-start, 0px)); } to { transform: translateX(var(--marquee-end, -100%)); } }
    #transcript span { border-radius: 5px; padding: 1px 2px; transition: color .12s ease, background-color .12s ease; }
    #transcript span.active { color: inherit; background: transparent; box-shadow: none; }
    .note { margin: 18px 0 0; padding: 14px 16px; border: 1px solid #e6def5; border-radius: 14px; color: #575b81; line-height: 1.55; background: #faf8ff; }
    @media (max-width: 720px) { .content { grid-template-columns: 1fr; grid-template-areas: "actions" "voice" "scene" "status" "uploads" "code" "panel" "editor" "export" "recorder" "note" "seo"; } .editor-toggle { justify-self: stretch; width: 100%; } }
    @media (max-width: 480px) { body { padding: 8px; } main { border-radius: 22px; } .stage { padding: 8px; } .content { padding: 18px 16px 20px; } .transcript { margin: 14px 4px 0; } .voice-row { grid-template-columns: 1fr; gap: 8px; } .voice-field { width: 100%; } .upload-row { align-items: stretch; flex-direction: column; } select { min-width: 0; width: 100%; } .top-actions { align-items: stretch; flex-direction: column; } button { width: 100%; } button.secondary { margin-left: 0; } }
