:root {
    --ink: #17181c;
    --muted: #747985;
    --muted-2: #a4a9b3;
    --line: #e5e7eb;
    --soft: #f5f6f8;
    --workspace: #e8e8e8;
    --orange: #ff5a12;
    --orange-dark: #e94b06;
    --cyan: #09cde8;
    --panel-width: 380px;
    --topbar-height: 72px;
    --radius: 12px;
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: #fff; font-size: 14px; }
button, input, select { font: inherit; }
button { color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { width: 100%; height: 100%; background: #fff; }
.topbar { height: var(--topbar-height); padding: 0 22px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: relative; z-index: 30; }
.topbar__start, .topbar__end, .history-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__end { justify-content: flex-end; }
.history-actions { justify-content: center; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 10px; cursor: pointer; transition: background .18s, color .18s, opacity .18s; }
.icon-button:hover { background: #f2f3f5; }
.icon-button:disabled { opacity: .3; cursor: default; }
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand__logo { width: 35px; height: 33px; display: block; object-fit: contain; }
.brand__name { font-weight: 750; letter-spacing: -.02em; }
.topbar__divider { height: 24px; width: 1px; background: var(--line); margin: 0 4px; }
.project-name { min-width: 0; }
.project-name input { width: min(260px, 26vw); border: 1px solid transparent; padding: 8px 10px; border-radius: 8px; outline: none; font-weight: 560; background: transparent; text-overflow: ellipsis; }
.project-name input:hover, .project-name input:focus { border-color: var(--line); background: #fafafa; }
.save-state { color: #777d86; font-size: 12px; display: flex; align-items: center; gap: 6px; margin-left: 4px; white-space: nowrap; }
.save-state span { width: 7px; height: 7px; border-radius: 50%; background: #33aa63; }
.save-state.saving span { background: #eda900; }
.button { min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 600; background: #fff; }
.button svg { width: 20px; height: 20px; }
.button--ghost { border-color: #d9dce1; }
.button--ghost:hover { background: #f6f6f7; }
.button--dark { background: #17181c; color: white; }
.button--dark:hover { background: #303136; }
.button--danger { background: #e63636; color: white; }

.editor-layout { height: calc(100% - var(--topbar-height)); display: grid; grid-template-columns: var(--panel-width) minmax(0, 1fr); }
.editor-layout.panel-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.side-panel { background: #fff; border-right: 1px solid #d7d9dd; height: 100%; position: relative; z-index: 20; overflow: hidden; }
.side-panel.collapsed { opacity: 0; pointer-events: none; transform: translateX(-100%); }
.panel-heading { height: 70px; padding: 0 16px 0 20px; display: flex; align-items: center; border-bottom: 1px solid #f0f1f2; }
.panel-tabs { display: grid; grid-template-columns: repeat(4, auto); gap: 23px; flex: 1; height: 100%; }
.panel-tabs[hidden] { display: none; }
.panel-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 2px 0 0; color: #9297a0; font-size: 13px; cursor: pointer; white-space: nowrap; }
.panel-tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 610; }
.product-tabs { min-width: 0; flex: 1; height: 100%; display: flex; align-items: stretch; gap: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.product-tabs[hidden] { display: none; }
.product-tabs::-webkit-scrollbar { display: none; }
.product-tab { flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 2px 9px 0; color: #9297a0; font-size: 12px; cursor: pointer; white-space: nowrap; }
.product-tab.active { color: var(--ink); border-bottom-color: var(--orange); font-weight: 650; }
.panel-close { width: 34px; height: 34px; margin-left: 6px; }
.panel-close svg { width: 19px; }
.panel-content { display: none; height: calc(100% - 70px); }
.panel-content.active { display: block; }
.panel-scroll { height: 100%; overflow-y: auto; padding: 24px 28px 110px; scrollbar-width: thin; scrollbar-color: #c9ccd2 transparent; }
.panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #c9ccd2; border-radius: 20px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.section-title h2 { margin: 0; font-size: 14px; font-weight: 620; }
.section-title button, .section-title span { border: 0; background: none; padding: 3px 0; font-size: 12px; color: #656a73; cursor: pointer; }
.library-section { margin-top: 30px; }
.transparent-choice { width: 100%; padding: 0; border: 0; background: transparent; display: flex; justify-content: space-between; align-items: center; text-align: left; cursor: pointer; }
.transparent-choice span { display: grid; gap: 5px; }
.transparent-choice b { font-size: 14px; font-weight: 600; }
.transparent-choice small { color: var(--muted); }
.checkerboard { width: 58px; height: 58px; border-radius: 8px; border: 1px solid #d9d9dc; background-color: #fff; background-image: linear-gradient(45deg,#d0d0d0 25%,transparent 25%),linear-gradient(-45deg,#d0d0d0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#d0d0d0 75%),linear-gradient(-45deg,transparent 75%,#d0d0d0 75%); background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0; }
.swatch-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch { aspect-ratio: 1; border-radius: 9px; border: 2px solid transparent; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.035); }
.swatch:hover { transform: translateY(-2px); }
.swatch.active::after { content: ""; position: absolute; inset: -4px; border: 2px solid var(--ink); border-radius: 12px; }
.pattern-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.pattern-item { aspect-ratio: 1; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background-size: 38px 38px; }
.pattern-item.active { box-shadow: 0 0 0 3px #202126; }
.custom-color-card { margin-top: 28px; padding: 16px; border-radius: 12px; background: var(--soft); }
.color-line { display: flex; gap: 8px; }
.native-color { width: 38px; height: 38px; position: relative; border-radius: 8px; overflow: hidden; border: 1px solid #bbbfc7; flex: 0 0 auto; }
.native-color input { position: absolute; inset: -10px; width: 60px; height: 60px; border: 0; cursor: pointer; }
.text-input { border: 1px solid #cfd2d8; border-radius: 8px; height: 40px; padding: 0 11px; outline: none; background: #fff; color: var(--ink); }
.text-input:focus { border-color: #888e98; box-shadow: 0 0 0 3px rgba(32,36,44,.08); }
#bgHex { min-width: 0; flex: 1; text-transform: uppercase; }
.small-button { border: 1px solid #cfd2d8; border-radius: 8px; background: #fff; padding: 0 10px; cursor: pointer; }

.search-box { width: 100%; height: 46px; border: 1px solid #bfc3cb; border-radius: 9px; display: flex; align-items: center; gap: 9px; padding: 0 13px; margin-bottom: 12px; background: #fff; }
.search-box:focus-within { border-color: #6a707b; box-shadow: 0 0 0 3px rgba(40,45,55,.07); }
.search-box svg { width: 20px; flex: 0 0 auto; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.tag-list { display: flex; gap: 7px; overflow-x: auto; overflow-y: hidden; margin: 8px 0 22px; padding-bottom: 2px; scrollbar-width: none; }
.tag-list::-webkit-scrollbar { display: none; }
.tag-list button { flex: 0 0 auto; border: 1px solid #babec5; background: #fff; border-radius: 7px; padding: 7px 10px; cursor: pointer; font-size: 12px; }
.tag-list button.active { background: #191b20; color: #fff; border-color: #191b20; }
.folder-library { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.folder-library .search-box { margin-top: 12px; }
.background-assets .asset-card { aspect-ratio: 4 / 3; }
.asset-grid { display: grid; gap: 12px; }
.asset-grid--3 { grid-template-columns: repeat(3, 1fr); }
.asset-grid--2 { grid-template-columns: repeat(2, 1fr); }
.asset-card { border: 0; background: #f0f0f1; border-radius: 9px; aspect-ratio: 1; overflow: hidden; padding: 0; cursor: pointer; position: relative; transition: transform .15s, box-shadow .15s; }
.asset-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23,24,28,.1); }
.asset-card.active { box-shadow: 0 0 0 3px #202126, 0 8px 20px rgba(23,24,28,.12); }
.asset-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-card__label { position: absolute; inset: auto 5px 5px; padding: 4px 6px; border-radius: 5px; background: rgba(20,22,27,.76); color: #fff; font-size: 9px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(3px); transition: .15s; }
.asset-card:hover .asset-card__label, .asset-card:focus-visible .asset-card__label { opacity: 1; transform: translateY(0); }
.asset-card .asset-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: 42px; }
.asset-card[hidden] { display: none; }
.library-empty { grid-column: 1 / -1; min-height: 82px; display: grid; place-items: center; padding: 16px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; text-align: center; }
.infinite-loader { grid-column: 1 / -1; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #7b8089; font-size: 11px; }
.infinite-loader span { width: 17px; height: 17px; border: 2px solid #d6d9de; border-top-color: var(--orange); border-radius: 50%; animation: loader-spin .8s linear infinite; }
.infinite-loader--done { color: #a0a4ac; }
@keyframes loader-spin { to { transform: rotate(360deg); } }
.add-text-button { width: 100%; height: 46px; border: 0; border-radius: 9px; background: #202126; color: #fff; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.add-text-button svg { width: 18px; }
.text-presets { display: grid; gap: 10px; margin: 20px 0 28px; }
.text-presets button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 14px; text-align: left; display: grid; gap: 6px; cursor: pointer; }
.text-presets button:hover { background: #fafafa; }
.text-presets button:nth-child(1) span { font-size: 23px; font-weight: 750; }
.text-presets button:nth-child(2) span { font-size: 18px; font-weight: 650; }
.text-presets small { color: var(--muted); }
.text-style-title { margin-top: 8px; }
.text-style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.text-style-grid button { min-height: 105px; border: 0; border-radius: 9px; background: #f1f1f2; padding: 10px; cursor: pointer; overflow: hidden; }

.upload-intro > p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.upload-dropzone { min-height: 116px; border: 1.5px dashed #afb4bf; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 5px; color: #7d8390; cursor: pointer; margin-bottom: 20px; padding: 14px; }
.upload-dropzone.dragging, .upload-dropzone:hover { background: #fff8f4; border-color: var(--orange); color: var(--orange-dark); }
.upload-dropzone svg { width: 25px; }
.upload-dropzone b { font-size: 13px; }
.upload-dropzone small { font-size: 11px; color: #9ba0aa; }
.upload-title { display: flex; justify-content: space-between; align-items: center; margin: 21px 0 12px; }
.upload-title h2 { font-size: 14px; margin: 0; }
.upload-title small { color: var(--muted); }
.uploads-grid .asset-card { aspect-ratio: 1.22; }
.empty-uploads { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 35px 20px; border: 1px dashed var(--line); border-radius: 10px; }
.empty-uploads svg { width: 34px; height: 34px; color: #abb0ba; }
.empty-uploads p { font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
.panel-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.product-template-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.product-template-heading strong { font-size: 16px; font-weight: 680; }
.product-template-heading span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.template-card { background: transparent; border: 0; padding: 0; text-align: left; cursor: pointer; }
.template-card canvas { width: 100%; display: block; border-radius: 8px; box-shadow: 0 0 0 1px #d7d9de; background: #fff; }
.template-card span { display: block; font-size: 12px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-empty { grid-column: 1 / -1; min-height: 130px; display: grid; place-items: center; padding: 22px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.setting-title { font-size: 18px; margin: 0 0 18px; }
.setting-card { display: grid; gap: 10px; margin-bottom: 22px; }
.setting-card label { font-size: 13px; font-weight: 600; }
.setting-card select { width: 100%; }
.zoom-control { display: grid; grid-template-columns: 42px 1fr 42px; height: 42px; border: 1px solid #cfd2d8; border-radius: 9px; overflow: hidden; }
.zoom-control button { border: 0; background: #fff; cursor: pointer; display: grid; place-items: center; }
.zoom-control button:hover { background: #f4f5f6; }
.zoom-control svg { width: 17px; }
.zoom-control span { display: grid; place-items: center; border-inline: 1px solid #e3e4e7; font-size: 13px; }
.danger-button { width: 100%; height: 44px; border: 1px solid #f0b9b9; background: #fff7f7; color: #d32828; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.danger-button svg { width: 19px; }

.workspace { min-width: 0; height: 100%; background: var(--workspace); position: relative; overflow: hidden; }
.stage-viewport { position: absolute; inset: 0; display: grid; place-items: center; padding: 70px 100px 105px; overflow: hidden; touch-action: none; }
.stage-wrap { position: relative; box-shadow: 0 2px 10px rgba(20,22,28,.16); background-color: white; background-image: linear-gradient(45deg,#e5e5e5 25%,transparent 25%),linear-gradient(-45deg,#e5e5e5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e5e5e5 75%),linear-gradient(-45deg,transparent 75%,#e5e5e5 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; flex: 0 0 auto; }
#designCanvas { width: 100%; height: 100%; display: block; background: transparent; touch-action: none; }
.inline-text-editor { position: absolute; z-index: 4; margin: 0; padding: 0; border: 1.5px solid #02cbe8; outline: 0; overflow: hidden; resize: none; background: rgba(255,255,255,.12); box-shadow: 0 0 0 2px rgba(2,203,232,.12); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; transform-origin: center; }
.bottom-dock { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 10; height: 58px; background: rgba(255,255,255,.97); border: 1px solid #d9dce0; border-radius: 13px; box-shadow: 0 3px 12px rgba(22,23,27,.14); display: flex; align-items: stretch; padding: 5px; }
.bottom-dock button { border: 0; background: transparent; border-radius: 9px; padding: 0 17px; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.bottom-dock button:hover, .bottom-dock button.active { background: #26272b; color: #fff; }
.bottom-dock svg { width: 22px; height: 22px; }
.context-toolbar { position: absolute; left: 50%; transform: translateX(-50%) translateY(18px); bottom: 18px; min-width: 610px; max-width: calc(100% - 36px); height: 58px; display: flex; align-items: center; justify-content: flex-start; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: rgba(255,255,255,.98); border: 1px solid #d6d9de; border-radius: 13px; box-shadow: 0 3px 12px rgba(22,23,27,.15); padding: 5px 8px; z-index: 12; opacity: 0; pointer-events: none; transition: .2s; }
.context-toolbar::-webkit-scrollbar { display: none; }
.context-toolbar.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.context-toolbar > button { height: 44px; min-width: 66px; border: 0; border-radius: 8px; background: transparent; display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; font-size: 12px; padding: 0 9px; }
.context-toolbar > button:hover { background: #f1f2f4; }
.context-toolbar > button:disabled { color: #9da1aa; cursor: default; background: transparent; }
.context-toolbar > button svg { width: 18px; }
.context-toolbar .context-close { border: 1px solid #cdd0d5; min-width: 42px; width: 42px; border-radius: 50%; margin-left: 5px; }
.element-color-control { height: 44px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border-right: 1px solid #e5e7eb; font-size: 11px; white-space: nowrap; }
.element-color-control[hidden] { display: none; }
.element-color-swatches { display: flex; align-items: center; gap: 5px; }
.element-color-swatch { width: 25px; height: 25px; position: relative; display: block; flex: 0 0 auto; border: 1px solid #aeb2ba; border-radius: 6px; overflow: hidden; background: var(--swatch-color, #000); box-shadow: inset 0 0 0 2px #fff; cursor: pointer; }
.element-color-swatch:hover { transform: translateY(-1px); border-color: #4d525b; }
.element-color-swatch input { position: absolute; inset: -8px; width: 42px; height: 42px; opacity: 0; cursor: pointer; }
.text-format-control { height: 44px; display: flex; align-items: center; gap: 5px; padding: 0 8px; border-right: 1px solid #e5e7eb; white-space: nowrap; }
.text-format-control[hidden] { display: none; }
.text-format-control select { height: 32px; border: 1px solid #d2d5da; border-radius: 7px; background: #fff; padding: 0 7px; outline: none; font-size: 11px; color: #30333a; }
#textFontFamily { width: 112px; }
#textAlign { width: 72px; }
.font-size-field { height: 32px; width: 65px; display: flex; align-items: center; border: 1px solid #d2d5da; border-radius: 7px; overflow: hidden; background: #fff; }
.font-size-field input { width: 43px; height: 100%; padding: 0 2px 0 7px; border: 0; outline: none; font-size: 11px; }
.font-size-field span { color: #8b9099; font-size: 10px; }
.text-format-buttons { display: flex; height: 32px; border: 1px solid #d2d5da; border-radius: 7px; overflow: hidden; }
.text-format-buttons button { width: 31px; height: 30px; border: 0; border-right: 1px solid #e2e4e7; background: #fff; cursor: pointer; }
.text-format-buttons button:last-child { border-right: 0; }
.text-format-buttons button:hover { background: #f2f3f5; }
.text-format-buttons button.active { background: #202126; color: #fff; }
.multi-align-control { height: 44px; display: flex; align-items: center; gap: 7px; padding: 0 8px; border-right: 1px solid #e5e7eb; white-space: nowrap; }
.multi-align-control[hidden] { display: none; }
.multi-align-control > span { color: #656a73; font-size: 11px; font-weight: 600; }
.multi-align-buttons { height: 32px; display: flex; align-items: center; border: 1px solid #d2d5da; border-radius: 7px; overflow: hidden; background: #fff; }
.multi-align-buttons button { width: 32px; height: 30px; flex: 0 0 32px; display: grid; place-items: center; border: 0; border-right: 1px solid #e2e4e7; background: #fff; color: #30333a; cursor: pointer; }
.multi-align-buttons button:last-child { border-right: 0; }
.multi-align-buttons button:nth-child(4), .multi-align-buttons button:nth-child(7) { border-left: 2px solid #c9ccd2; }
.multi-align-buttons button:hover { background: #f2f3f5; }
.multi-align-buttons button:disabled { color: #b6bac2; background: #f7f8f9; cursor: default; }
.multi-align-buttons svg { width: 17px; height: 17px; }
.toolbar-range { height: 44px; min-width: 100px; display: grid; align-content: center; gap: 2px; padding: 0 8px; font-size: 11px; }
.toolbar-range input { width: 95px; accent-color: #26272b; }
.zoom-pill { position: absolute; right: 18px; bottom: 20px; height: 34px; display: flex; align-items: center; gap: 9px; padding: 0 10px; background: rgba(255,255,255,.9); border: 1px solid #d6d9dd; border-radius: 8px; color: #646a74; font-size: 11px; }
.zoom-pill button { padding: 0; border: 0; background: transparent; cursor: pointer; font-weight: 600; }
.page-controls, .mobile-selection-top { display: none; }

.toast-region { position: fixed; top: 86px; right: 18px; z-index: 80; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 250px; max-width: 360px; padding: 12px 14px; background: #202126; color: #fff; border-radius: 9px; box-shadow: 0 8px 25px rgba(0,0,0,.2); display: flex; align-items: center; gap: 9px; animation: toast-in .22s ease-out; }
.toast svg { width: 18px; color: #6ce09a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15,17,22,.48); backdrop-filter: blur(2px); }
.modal__dialog { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 28px; position: relative; text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.modal__close { position: absolute; right: 12px; top: 12px; }
.modal__icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: #fff0f0; color: #d83434; }
.modal__icon svg { width: 22px; }
.modal__dialog h2 { margin: 0 0 8px; font-size: 20px; }
.modal__dialog p { margin: 0; color: var(--muted); line-height: 1.55; }
.modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

body.order-open { overflow: hidden; }
.order-modal { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 22px; }
.order-modal.open { display: grid; }
.order-modal__backdrop { position: absolute; inset: 0; background: rgba(15,17,22,.58); backdrop-filter: blur(3px); }
.order-modal__dialog { width: min(960px, 100%); max-height: min(850px, calc(100dvh - 44px)); overflow: hidden; position: relative; display: grid; grid-template-rows: auto minmax(0,1fr); background: #fff; border-radius: 18px; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.order-modal__close { position: absolute; top: 15px; right: 15px; z-index: 2; }
.order-modal__header { padding: 25px 68px 20px 30px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.order-kicker { display: block; margin-bottom: 6px; color: var(--orange-dark); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.order-modal__header h2 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.order-modal__header p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.commerce-mode { flex: 0 0 auto; margin-top: 3px; padding: 6px 9px; border-radius: 99px; background: #fff2d8; color: #8a5500; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.order-modal__body { min-height: 0; display: grid; grid-template-columns: 245px minmax(0,1fr); }
.order-preview-card { padding: 26px; background: #f4f4f5; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; }
.order-preview-frame { aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden; padding: 14px; border-radius: 11px; background: #e4e4e6; }
.order-preview-frame img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 9px rgba(0,0,0,.13)); }
.order-preview-card strong { margin-top: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.order-preview-card small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.order-form { min-height: 0; overflow-y: auto; padding: 24px 28px 28px; }
.order-section + .order-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.order-section h3 { margin: 0 0 13px; font-size: 14px; }
.order-fields { display: grid; gap: 13px; }
.order-fields--2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.order-fields--3 { grid-template-columns: 1.25fr 1.25fr .55fr; }
.order-fields label { min-width: 0; display: grid; gap: 6px; color: #4f545d; font-size: 11px; font-weight: 600; }
.order-fields label > span { display: flex; justify-content: space-between; gap: 5px; }
.order-fields label small { color: #9a9ea6; font-weight: 400; }
.order-fields input, .order-fields select { width: 100%; height: 42px; border: 1px solid #cfd2d8; border-radius: 8px; background: #fff; padding: 0 11px; outline: none; color: var(--ink); }
.order-fields input:focus, .order-fields select:focus { border-color: #777d87; box-shadow: 0 0 0 3px rgba(40,45,55,.08); }
.order-field--wide { grid-column: 1 / -1; }
.order-error { margin-top: 16px; padding: 11px 13px; border: 1px solid #efb5b5; border-radius: 8px; background: #fff5f5; color: #b92323; font-size: 12px; line-height: 1.45; }
.order-quote { margin-top: 20px; padding: 16px; border-radius: 11px; background: #f5f6f7; display: grid; gap: 10px; }
.order-quote[hidden] { display: none; }
.order-quote > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #626771; font-size: 12px; }
.order-quote > div strong { color: var(--ink); }
.order-quote .order-quote__total { margin-top: 2px; padding-top: 11px; border-top: 1px solid #dfe1e4; color: var(--ink); font-size: 14px; font-weight: 700; }
.order-quote small { color: var(--muted); line-height: 1.45; }
.order-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.order-actions .button { min-height: 44px; }
.order-actions .button[hidden] { display: none; }
.order-legal { margin: 12px 0 0; color: #969aa2; text-align: right; font-size: 9px; line-height: 1.45; }

@media (max-width: 1100px) {
    :root { --panel-width: 330px; }
    .topbar { padding-inline: 14px; }
    .brand__name, .save-state { display: none; }
    .project-name input { width: 190px; }
    .panel-tabs { gap: 14px; }
    .product-tabs { gap: 4px; }
    .panel-scroll { padding-inline: 20px; }
    .stage-viewport { padding-inline: 60px; }
    .bottom-dock button { padding-inline: 12px; }
    .zoom-pill { display: none; }
}

@media (max-width: 760px) {
    :root { --topbar-height: 68px; }
    html, body { min-height: 100%; min-height: 100dvh; }
    .topbar { grid-template-columns: auto 1fr auto; padding: max(6px, env(safe-area-inset-top)) 12px 0; height: calc(var(--topbar-height) + env(safe-area-inset-top)); }
    .profile-button { display: none; }
    .brand__logo { width: 30px; height: 29px; }
    .topbar__divider, .project-name, .save-state { display: none; }
    .topbar__start { gap: 0; }
    .history-actions { justify-self: center; gap: 8px; }
    .topbar__end { gap: 3px; }
    .topbar__end .button { width: 42px; height: 42px; padding: 0; border: 0; background: transparent; color: var(--ink); }
    .topbar__end .button span { display: none; }
    .topbar__end .button:hover { background: #f1f2f3; }
    .editor-layout { height: calc(100% - var(--topbar-height) - env(safe-area-inset-top)); display: block; }
    .workspace { width: 100%; }
    .side-panel { position: fixed; left: 0; right: 0; top: calc(var(--topbar-height) + env(safe-area-inset-top)); bottom: 66px; height: auto; width: 100%; border: 0; z-index: 18; transform: translateY(calc(100% + 80px)); transition: transform .24s cubic-bezier(.2,.75,.25,1); }
    .side-panel.collapsed { opacity: 1; transform: translateY(calc(100% + 80px)); }
    .side-panel.open { transform: translateY(0); }
    .panel-heading { height: 64px; padding-inline: 18px 12px; }
    .panel-tabs { gap: 0; justify-content: space-between; }
    .panel-tab { padding-inline: 6px; }
    .product-tabs { gap: 3px; }
    .product-tab { padding-inline: 10px; }
    .panel-content { height: calc(100% - 64px); }
    .panel-scroll { padding: 20px 26px 55px; }
    .asset-grid--3 { gap: 14px; }
    .asset-grid--2 { gap: 16px; }
    .asset-card { border-radius: 6px; }
    .stage-viewport { inset: 0; padding: 67px 32px 112px; overflow: hidden; }
    .stage-wrap { box-shadow: 0 0 0 1px #bfc1c5; }
    .bottom-dock { left: 14px; right: 14px; transform: none; width: auto; bottom: 8px; height: 54px; justify-content: stretch; padding: 4px; border-radius: 12px; }
    .bottom-dock button { flex: 1 1 25%; justify-content: center; padding: 0 7px; font-size: 12px; gap: 6px; }
    .bottom-dock button:last-child { display: none; }
    .bottom-dock svg { width: 20px; }
    .context-toolbar { left: 14px; right: 14px; min-width: 0; width: auto; transform: translateY(18px); bottom: 8px; height: 54px; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 4px; scrollbar-width: none; }
    .context-toolbar::-webkit-scrollbar { display: none; }
    .context-toolbar.visible { transform: translateY(0); }
    .context-toolbar > button { min-width: 70px; height: 44px; }
    .context-toolbar > button svg { display: none; }
    .context-toolbar .context-close { min-width: 42px; position: sticky; right: 0; background: #fff; }
    .context-toolbar .context-close svg { display: block; }
    .element-color-control { min-width: max-content; }
    .toolbar-range { min-width: 105px; }
    .mobile-selection-top { position: absolute; top: 27px; left: 44px; right: 44px; display: flex; justify-content: space-between; z-index: 5; font-size: 12px; pointer-events: none; }
    .mobile-selection-top button { border: 0; background: transparent; pointer-events: auto; cursor: pointer; }
    .mobile-selection-top button:disabled { color: #a4a8af; }
    .page-controls { display: flex; position: absolute; left: 40px; right: 40px; bottom: 78px; align-items: center; justify-content: space-between; font-size: 12px; }
    .page-controls button { border: 0; background: transparent; display: flex; align-items: center; gap: 1px; font-size: 12px; padding: 4px 0; }
    .page-controls svg { width: 14px; }
    .workspace.has-selection .stage-viewport { padding-top: 67px; padding-bottom: 129px; }
    .workspace.has-selection .page-controls { bottom: 76px; }
    .toast-region { top: calc(var(--topbar-height) + env(safe-area-inset-top) + 10px); left: 12px; right: 12px; }
    .toast { min-width: 0; max-width: none; }
    .order-modal { padding: 0; place-items: stretch; }
    .order-modal__dialog { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
    .order-modal__header { padding: max(20px, env(safe-area-inset-top)) 58px 17px 20px; }
    .order-modal__header h2 { font-size: 19px; }
    .order-modal__header p { font-size: 11px; line-height: 1.45; }
    .commerce-mode { display: none; }
    .order-modal__body { display: block; overflow-y: auto; }
    .order-preview-card { padding: 14px 20px; border: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 62px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
    .order-preview-frame { grid-row: 1 / 3; width: 62px; aspect-ratio: 4/5; padding: 4px; border-radius: 6px; }
    .order-preview-card strong { margin: 0; align-self: end; }
    .order-preview-card small { margin-top: 3px; align-self: start; }
    .order-form { overflow: visible; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
    .order-fields--2, .order-fields--3 { grid-template-columns: 1fr; }
    .order-field--wide { grid-column: auto; }
    .order-actions { display: grid; grid-template-columns: 1fr; }
    .order-actions .button[data-order-close] { order: 3; }
    .order-legal { text-align: center; }
}

@media (max-width: 390px) {
    .topbar { padding-inline: 8px; }
    .icon-button { width: 38px; }
    .stage-viewport { padding-inline: 26px; }
    .panel-scroll { padding-inline: 20px; }
    .bottom-dock { left: 8px; right: 8px; }
    .bottom-dock button { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
