.storefront-upgrade-active { overflow: hidden; }
body.auth-locked .sf-flow { display: none; }
.sf-flow { position: fixed; inset: 0; z-index: 1600; overflow-y: auto; overscroll-behavior: contain; background: #f5f7fb; color: #192232; }
.sf-flow *, .sf-flow *::before, .sf-flow *::after { box-sizing: border-box; letter-spacing: 0; }
.sf-shell { display: flex; flex-direction: column; max-width: 760px; min-height: 100%; margin: 0 auto; background: #fff; }
.sf-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; background: #fff; border-bottom: 1px solid #e8ebf0; }
.sf-header h2 { margin: 0; text-align: center; font-size: 20px; line-height: 1.3; }
.sf-icon { width: 44px; height: 44px; display: inline-flex; justify-content: center; align-items: center; padding: 0; border: 1px solid #e0e5ee; border-radius: 8px; background: #fff; color: #5b667b; }
.sf-flow button, .sf-flow summary, .sf-upload, .sf-photo-actions label { cursor: pointer; touch-action: manipulation; }
.sf-flow button:disabled, .sf-flow .is-disabled { opacity: .5; cursor: default; }
.sf-flow .app-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.sf-flow main { flex: 1; padding: 0 24px 24px; }
.sf-flow h3 { margin: 0; font-size: 17px; }
.sf-text { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; background: transparent; color: #6552de; font-size: 14px; padding: 6px; }
.sf-continue { margin-top: 8px; }
.sf-setup { padding-top: 16px; }
.sf-setup > summary, .sf-more > summary, .sf-history > summary { min-height: 44px; padding: 12px 0; color: #5b667b; font-size: 14px; }
.sf-setup:not([open]) { padding-bottom: 16px; border-bottom: 1px solid #e9ecf2; }
.sf-setup[open] > summary { margin-bottom: 8px; }
.sf-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; }
.sf-photo-actions { display: flex; gap: 8px; }
.sf-photo-actions label { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #e0e5ee; border-radius: 8px; }
.sf-upload { display: flex; min-height: 170px; align-items: center; justify-content: center; flex-direction: column; gap: 14px; border: 1px dashed #bbb6ef; border-radius: 8px; background: #f8f8fd; color: #6552de; }
.sf-upload .app-icon { width: 28px; height: 28px; }
.sf-original { width: 100%; display: block; padding: 0; border: 0; background: #f4f6f9; border-radius: 8px; overflow: hidden; }
.sf-original img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.sf-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.sf-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: #38445a; font-size: 14px; }
.sf-flow input, .sf-flow select, .sf-flow textarea { display: block; width: 100%; min-width: 0; max-width: 100%; border: 1px solid #dfe4ec; border-radius: 8px; padding: 11px 12px; background: #fff; color: #192232; font: inherit; font-size: 16px; line-height: 1.5; outline: none; }
.sf-flow input:focus, .sf-flow select:focus, .sf-flow textarea:focus { border-color: #7866e5; box-shadow: 0 0 0 2px #7866e514; }
.sf-flow input[hidden] { display: none; }
.sf-wide { grid-column: 1 / -1; }
.sf-style-title { margin-top: 24px !important; }
.sf-styles { display: flex; align-items: stretch; gap: 10px; overflow-x: auto; padding: 12px 2px; scrollbar-width: thin; }
.sf-style { flex: 0 0 108px; min-width: 0; padding: 4px; border: 1px solid #dfe4ec; border-radius: 8px; background: #fff; color: #526079; overflow: hidden; }
.sf-style > img, .sf-style > div { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: grid; place-items: center; background: #f1f4f6; }
.sf-style > span { display: block; padding: 9px 2px 6px; font-size: 14px; overflow-wrap: anywhere; }
.sf-style[aria-pressed="true"] { border-color: #7058ed; box-shadow: inset 0 0 0 1px #7058ed; color: #6348db; }
.sf-more { margin-top: 12px; border-top: 1px solid #e8ebf0; }
.sf-more > summary .app-icon { display: inline-block; width: 16px; height: 16px; margin: 0 7px 0 3px; vertical-align: middle; }
.sf-result { padding-top: 24px; }
.sf-result-image { width: 100%; background: #f3f5f8; border-radius: 8px; overflow: hidden; position: relative; }
.sf-result-image img { width: 100%; height: 100%; display: block; object-fit: contain; }
.sf-view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #f0f3f6; padding: 4px; border-radius: 8px; margin: 14px 0; }
.sf-view-switch button { border: 0; border-radius: 5px; min-height: 40px; background: transparent; color: #657086; font-size: 14px; }
.sf-view-switch button[aria-pressed="true"] { background: #fff; color: #263248; box-shadow: 0 1px 4px #1826320d; }
.sf-caption, .sf-message { font-size: 13px; line-height: 1.6; color: #7a8597; overflow-wrap: anywhere; }
.sf-warning { font-size: 14px; line-height: 1.6; color: #a05a34; overflow-wrap: anywhere; }
.sf-warning[hidden] { display: none; }
.sf-history { margin-top: 16px; border-top: 1px solid #e8ebf0; }
.sf-history > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sf-history button { min-width: 0; padding: 4px; border: 1px solid #dfe4ec; border-radius: 8px; color: #657086; background: #fff; }
.sf-history button[aria-pressed="true"] { border-color: #7058ed; }
.sf-history img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 4px; }
.sf-history span { display: block; padding: 8px 2px; font-size: 13px; overflow-wrap: anywhere; }
.sf-status { padding-top: 16px; }
.sf-technical { margin: 12px 0; font-size: 13px; color: #7a8597; overflow-wrap: anywhere; }
.sf-technical summary { min-height: 40px; padding: 8px 0; }
.sf-edit { padding-top: 20px; }
.sf-footer { position: sticky; bottom: 0; z-index: 2; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); background: #fffffffa; border-top: 1px solid #e8ebf0; }
.sf-cost { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; font-size: 13px; color: #7a8597; }
.sf-cost strong { color: #192232; font-size: 15px; white-space: nowrap; }
.sf-primary { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; border: 0; border-radius: 8px; padding: 12px; color: #fff; background: #6651ec; font-size: 16px; font-weight: 600; }
.sf-footer-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 10px; }
.sf-footer-actions > button:not(.sf-primary) { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px; border: 1px solid #dfe4ec; border-radius: 8px; background: #fff; color: #526079; font-size: 14px; }
.storefront-upgrade-active .image-preview-backdrop { z-index: 1700; }
.storefront-upgrade-active .image-preview-sheet { z-index: 1701; }
.storefront-upgrade-active #globalToast { z-index: 1900; }
@media (max-width: 480px) { .sf-flow main { padding-inline: 18px; } .sf-header { padding: 12px 18px; } .sf-header h2 { font-size: 19px; } .sf-footer { padding-inline: 18px; } .sf-fields { grid-template-columns: minmax(0, 1fr); gap: 14px; } .sf-style { flex-basis: 100px; } }
@media (prefers-reduced-motion: no-preference) { .sf-primary, .sf-style { transition: border-color 150ms ease, background-color 150ms ease; } }
