body.comic-active { overflow: hidden; }
body.auth-locked .cm-flow { display: none; }
.cm-flow { position: fixed; inset: 0; z-index: 1600; overflow-y: auto; overscroll-behavior: contain; color: #202635; background: #f5f7fb; }
.cm-flow *, .cm-flow *::before, .cm-flow *::after { box-sizing: border-box; letter-spacing: 0; }
.cm-shell { max-width: 760px; min-height: 100%; display: flex; flex-direction: column; margin: auto; background: #fff; }
.cm-header { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #e8ebf0; background: #fff; }
.cm-header h2 { margin: 0; font-size: 20px; text-align: center; }
.cm-icon { width: 44px; height: 44px; display: inline-flex; justify-content: center; align-items: center; border: 1px solid #dfe4ec; border-radius: 8px; color: #5d6980; background: #fff; padding: 0; }
.cm-flow .app-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.cm-flow main { flex: 1; min-width: 0; padding: 12px 24px 24px; }
.cm-flow h3 { margin: 0; font-size: 16px; }
.cm-flow button, .cm-flow summary, .cm-upload, .cm-photo-actions label { cursor: pointer; touch-action: manipulation; }
.cm-flow button:disabled { opacity: .5; cursor: default; }
.cm-flow summary { min-height: 44px; padding: 12px 0; font-size: 14px; color: #647087; }
.cm-input-section { padding: 8px 0 12px; }
.cm-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: #3c465a; font-size: 14px; }
.cm-flow textarea, .cm-flow input, .cm-flow select { width: 100%; min-width: 0; max-width: 100%; font: inherit; font-size: 16px; line-height: 1.6; border: 1px solid #dfe4ec; border-radius: 8px; background: #fff; color: #202635; padding: 10px 12px; outline: 0; }
.cm-flow input[hidden] { display: none; }
.cm-flow textarea { resize: vertical; }
.cm-flow input:focus, .cm-flow select:focus, .cm-flow textarea:focus { border-color: #7965e5; box-shadow: 0 0 0 2px #7965e514; }
.cm-example { text-align: left; line-height: 1.6; border: 0; padding: 10px 0; background: transparent; color: #7665cc; font-size: 13px; }
.cm-text { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; background: transparent; color: #6853d7; border: 0; padding: 6px; font-size: 14px; }
.cm-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 20px 0 12px; }
.cm-section-head > span { font-size: 13px; color: #7b869a; }
.cm-characters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.cm-character { min-width: 0; border: 1px solid #e1e6ee; border-radius: 8px; padding: 8px; }
.cm-photo { width: 100%; padding: 0; border: 0; background: #f5f6f8; border-radius: 4px; overflow: hidden; }
.cm-photo img { width: 100%; height: 140px; object-fit: contain; display: block; }
.cm-character .cm-field { margin-top: 10px; }
.cm-photo-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.cm-photo-actions label { display: grid; place-items: center; width: 44px; height: 44px; color: #657187; border: 1px solid #dfe4ec; border-radius: 8px; }
.cm-upload { min-height: 140px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed #bdb4eb; border-radius: 8px; background: #faf9fe; color: #6e58d5; font-size: 14px; text-align: center; }
.cm-styles { display: flex; gap: 10px; overflow-x: auto; padding: 12px 2px; scrollbar-width: thin; }
.cm-style { flex: 0 0 108px; padding: 4px; border: 1px solid #dfe4ec; background: #fff; border-radius: 8px; color: #647087; }
.cm-style > div, .cm-style img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: #f0f3f6; display: grid; place-items: center; }
.cm-style span { display: block; padding: 9px 2px 5px; font-size: 14px; overflow-wrap: anywhere; }
.cm-style[aria-pressed="true"] { border-color: #7058ed; box-shadow: inset 0 0 0 1px #7058ed; color: #6348db; }
.cm-more { border-top: 1px solid #e8ebf0; margin-top: 8px; }
.cm-more summary .app-icon { display: inline-block; margin: 0 6px; vertical-align: middle; width: 16px; height: 16px; }
.cm-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cm-result { border-top: 1px solid #e8ebf0; margin-top: 12px; }
.cm-result-picture { width: 100%; aspect-ratio: 3 / 4; display: block; padding: 0; background: #f4f6f8; border: 0; border-radius: 8px; overflow: hidden; }
.cm-result-picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cm-script { padding-left: 22px; color: #536077; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.cm-script p { margin: 6px 0; }
.cm-versions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.cm-versions button { min-width: 0; padding: 4px; background: #fff; border: 1px solid #dfe4ec; border-radius: 8px; color: #657187; }
.cm-versions button[aria-pressed="true"] { border-color: #7058ed; }
.cm-versions img { width: 100%; aspect-ratio: 3 / 4; display: block; object-fit: contain; border-radius: 4px; }
.cm-versions span { display: block; font-size: 13px; padding: 8px 0; overflow-wrap: anywhere; }
.cm-status, .cm-edit { margin-top: 20px; }
.cm-technical { color: #7a8597; font-size: 13px; overflow-wrap: anywhere; }
.cm-storage { color: #a35c3a; line-height: 1.6; font-size: 14px; overflow-wrap: anywhere; }
.cm-storage:empty { display: none; }
.cm-footer { position: sticky; bottom: 0; z-index: 2; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #e8ebf0; background: #fffffffa; }
.cm-cost { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: #7b869a; margin: 0; padding-bottom: 10px; }
.cm-cost strong { color: #202635; font-size: 15px; white-space: nowrap; }
.cm-primary { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px; background: #6651ec; color: #fff; font-size: 16px; font-weight: 600; border: 0; border-radius: 8px; }
.cm-footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cm-footer-actions > button:not(.cm-primary) { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 8px; border: 1px solid #dfe4ec; border-radius: 8px; background: #fff; color: #5e6980; font-size: 14px; min-height: 48px; }
.comic-active .image-preview-backdrop { z-index: 1700; }
.comic-active .image-preview-sheet { z-index: 1701; }
.comic-active #globalToast { z-index: 1900; }
@media(max-width:480px){.cm-flow main{padding-inline:18px}.cm-header,.cm-footer{padding-inline:18px}.cm-fields{grid-template-columns:minmax(0,1fr)}.cm-style{flex-basis:100px}.cm-header h2{font-size:19px}.cm-footer-actions{gap:8px}}
@media(prefers-reduced-motion:no-preference){.cm-style{transition:border-color 150ms ease,background-color 150ms ease}}
