.wm-stage-wrap { display: grid; gap: 10px; min-width: 0; }
.wm-stage-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wm-view { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; height: 36px; margin-left: auto; padding: 0 12px; border: 1px solid var(--cc-line); border-radius: 999px; background: var(--cc-card); color: var(--cc-ink-2); font: 600 .74rem 'Poppins', sans-serif; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.wm-view i { font-size: 12px; }
.wm-view:hover { border-color: rgba(6, 147, 139, .45); color: var(--cc-teal); }
.wm-view.is-on { border-color: var(--cc-teal); background: var(--cc-teal); color: #fff; }
.wm-app.is-grid .wm-pnav { display: none; }
.wm-stage-bar .wm-lock { margin-left: auto; }
.wm-stage-bar .wm-all { margin-left: 0; }
.wm-lock.is-on { border-color: #0F172A; background: #0F172A; color: #fff; }
html:not(.cf-light) .wm-lock.is-on { border-color: #475569; background: #475569; }
.wm-app.is-locked .wm-layer { cursor: not-allowed; touch-action: pan-x pan-y pinch-zoom; }
.wm-app.is-locked .wm-pos { opacity: .4; pointer-events: none; }
.wm-app.is-locked .wm-drag-hint i { color: var(--cc-ink-2); }
.wm-layer-tag { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: var(--cc-teal-soft); color: var(--cc-teal); font-size: .7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not(.cf-light) .wm-layer-tag { color: var(--cc-bright); }
.wm-layer-tag.is-top { background: rgba(217, 119, 6, .12); color: #B45309; }
html:not(.cf-light) .wm-layer-tag.is-top { color: #FBBF24; }
.wm-layer-tag:empty { display: none; }
.wm-pnav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 3px; border: 1px solid var(--cc-line); border-radius: 999px; background: var(--cc-card); }
.wm-pnav button { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--cc-teal-soft); color: var(--cc-teal); font-size: 11px; cursor: pointer; transition: background .2s, color .2s; }
html:not(.cf-light) .wm-pnav button { color: var(--cc-bright); }
.wm-pnav button:hover { background: var(--cc-teal); color: #fff; }
.wm-pnav button:disabled { opacity: .35; pointer-events: none; }
.wm-pnav span { min-width: 54px; text-align: center; font-size: .74rem; font-weight: 700; color: var(--cc-ink); }

.wm-stage { display: flex; align-items: center; justify-content: center; min-height: 420px; padding: 20px; border: 1px solid var(--cc-line); border-radius: 16px; background: var(--cc-soft); overflow: hidden; }
.wm-sheet { position: relative; line-height: 0; background: #fff; box-shadow: 0 8px 28px rgba(15, 23, 42, .14); }
.wm-sheet canvas { display: block; }
.wm-layer { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.wm-layer.is-drag { cursor: grabbing; }
.wm-app.is-tile .wm-layer { cursor: default; }
.wm-load { position: absolute; top: 50%; left: 50%; margin: -20px 0 0 -20px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.wm-load.is-on { opacity: 1; }
.wm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 14px; max-height: 760px; padding: 16px; overflow-y: auto; border: 1px solid var(--cc-line); border-radius: 16px; background: var(--cc-soft); scrollbar-width: thin; }
.wm-grid[hidden] { display: none; }
.wm-gcard { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.wm-gsheet { position: relative; width: 100%; line-height: 0; background: #fff; box-shadow: 0 4px 14px rgba(15, 23, 42, .12); }
.wm-gsheet::before { content: ''; display: block; padding-top: var(--ar, 141.4%); }
.wm-gsheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wm-gsheet .wm-layer { cursor: grab; }
.wm-gsheet .pm-spin { position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-width: 2px; }
.wm-gnum { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--cc-ink-2); font: 600 .72rem 'Poppins', sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.wm-gnum:hover { background: var(--cc-teal-soft); color: var(--cc-teal); }
.wm-gcard.is-off .wm-gnum { color: var(--cc-ink-3); }
.wm-drag-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-size: .72rem; color: var(--cc-ink-3); }
.wm-drag-hint i { color: var(--cc-teal); }
html:not(.cf-light) .wm-drag-hint i { color: var(--cc-bright); }

.wm-opts { gap: 14px; }
.wm-panel { display: grid; gap: 14px; min-width: 0; }
.wm-panel[hidden] { display: none; }
.wm-page .wm-in input, .wm-page .wm-in select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--cc-line); border-radius: 11px; outline: 0; background-color: var(--cc-soft); color: var(--cc-ink); font: 500 .84rem/1.2 'Poppins', sans-serif; transition: border-color .2s, box-shadow .2s; }
.wm-page .wm-in > span { font-size: .76rem; font-weight: 600; color: var(--cc-ink-2); }
.wm-page .wm-in select { padding-right: 30px; -webkit-appearance: none; appearance: none; background: var(--cc-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
.wm-page .wm-in input:focus, .wm-page .wm-in select:focus { border-color: var(--cc-teal); box-shadow: 0 0 0 3px rgba(6, 147, 139, .15); }
.wm-txt > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wm-txt > span:first-child b { min-width: 34px; padding: 2px 8px; border-radius: 999px; background: var(--cc-teal-soft); color: var(--cc-teal); font-size: .72rem; font-weight: 700; line-height: 1.5; text-align: center; }
html:not(.cf-light) .wm-txt > span:first-child b { color: var(--cc-bright); }
.wm-txt-box { position: relative; display: block; }
.wm-txt-box > i { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); font-size: 12px; color: var(--cc-ink-3); pointer-events: none; transition: color .2s; }
.wm-txt-box:focus-within > i { color: var(--cc-teal); }
html:not(.cf-light) .wm-txt-box:focus-within > i { color: var(--cc-bright); }
.wm-page .wm-txt-box input { padding: 0 40px 0 36px; font-size: .9rem; letter-spacing: .01em; text-overflow: ellipsis; }
.wm-txt-clr { position: absolute; top: 50%; right: 7px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; transform: translateY(-50%); border: 0; border-radius: 50%; background: transparent; color: var(--cc-ink-3); font-size: 12px; cursor: pointer; transition: background .2s, color .2s; }
.wm-txt-clr:hover { background: rgba(239, 68, 68, .1); color: #EF4444; }
.wm-txt-clr[hidden] { display: none; }
.wm-page .wm-in input::placeholder { font-size: .8rem; font-weight: 400; color: var(--cc-ink-3); opacity: .8; }
html:not(.cf-light) .wm-page .wm-styles button.is-on { color: var(--cc-bright); background: rgba(45, 212, 191, .12); }
.wm-styles button { gap: 6px; }
.wm-styles button i { font-size: 11px; }
.wm-page .wm-styles button.is-on { background: var(--cc-teal-soft); color: var(--cc-teal); box-shadow: inset 0 0 0 1px rgba(6, 147, 139, .35); }
html:not(.cf-light) .wm-page .wm-styles button.is-on { color: var(--cc-bright); background: rgba(45, 212, 191, .12); }
.wm-pick { position: relative; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px dashed var(--cc-ink-3); border-radius: 50%; background: transparent; color: var(--cc-ink-2); font-size: 11px; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.wm-pick:hover { transform: scale(1.08); }
.wm-pick.is-on { border: 2px solid var(--cc-card); background: var(--sw, #DC2626); color: #fff; box-shadow: 0 0 0 2px var(--cc-teal); }
.wm-pick.is-on i::before { content: '\f00c'; }
.wm-hex { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; margin-top: 2px; }
.wm-hex[hidden] { display: none; }
.wm-hex-sw { position: relative; height: 42px; overflow: hidden; border: 1px solid var(--cc-line); border-radius: 11px; cursor: pointer; }
.wm-hex-sw span { position: absolute; inset: 4px; border-radius: 8px; }
.wm-hex-sw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.wm-hex-in { position: relative; display: block; }
.wm-hex-in i { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); font-style: normal; font-weight: 700; font-size: .84rem; color: var(--cc-ink-3); pointer-events: none; }
.wm-hex-in input { width: 100%; height: 42px; padding: 0 12px 0 26px; border: 1px solid var(--cc-line); border-radius: 11px; outline: 0; background: var(--cc-soft); color: var(--cc-ink); font: 600 .84rem 'Poppins', sans-serif; letter-spacing: .04em; text-transform: uppercase; transition: border-color .2s, box-shadow .2s; }
.wm-hex-in input:focus { border-color: var(--cc-teal); box-shadow: 0 0 0 3px rgba(6, 147, 139, .15); }
.wm-hex-in input.is-bad { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }

.wm-pos-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.wm-pos { display: grid; grid-template-columns: repeat(3, 30px); grid-template-rows: repeat(3, 30px); gap: 4px; padding: 6px; border: 1px solid var(--cc-line); border-radius: 12px; background: var(--cc-card); }
.wm-pos button { display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 7px; background: var(--cc-soft); cursor: pointer; transition: background .2s; }
.wm-pos button i { width: 6px; height: 6px; border-radius: 50%; background: var(--cc-ink-3); opacity: .45; transition: background .2s, opacity .2s, transform .2s; }
.wm-pos button:hover { background: var(--cc-teal-soft); }
.wm-pos button:hover i { background: var(--cc-teal); opacity: 1; }
.wm-pos button.is-on { background: var(--cc-teal); }
.wm-pos button.is-on i { background: #fff; opacity: 1; transform: scale(1.3); }
.wm-app.is-tile .wm-pos { opacity: .4; pointer-events: none; }
.wm-tile { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'ico sw' 'txt txt'; align-content: space-between; align-items: start; gap: 8px; padding: 10px 12px; border: 1px solid var(--cc-line); border-radius: 12px; background: var(--cc-card); cursor: pointer; transition: border-color .2s, background .2s; -webkit-tap-highlight-color: transparent; }
.wm-tile:hover { border-color: rgba(6, 147, 139, .45); }
.wm-tile.is-on { border-color: var(--cc-teal); background: var(--cc-teal-soft); }
.wm-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wm-tile input:focus-visible ~ .qg-switch { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.wm-tile input:checked ~ .qg-switch { background: var(--cc-teal); }
.wm-tile input:checked ~ .qg-switch::after { transform: translateX(16px); }
.wm-tile-ico { grid-area: ico; width: 34px; height: 34px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 3px; padding: 6px; border-radius: 9px; background: var(--cc-soft); }
.wm-tile-ico i { border-radius: 2px; background: var(--cc-ink-3); opacity: .45; }
.wm-tile.is-on .wm-tile-ico { background: var(--cc-teal); }
.wm-tile.is-on .wm-tile-ico i { background: #fff; opacity: .9; }
.wm-tile-t { grid-area: txt; display: grid; gap: 1px; min-width: 0; }
.wm-tile .qg-switch { grid-area: sw; justify-self: end; margin-top: 6px; }
.wm-tile-t b { font-size: .8rem; color: var(--cc-ink); }
.wm-tile-t small { font-size: .68rem; line-height: 1.35; color: var(--cc-ink-3); }

.wm-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.wm-img-drop { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px; border: 2px dashed var(--cc-line); border-radius: 14px; background: var(--cc-soft); cursor: pointer; transition: border-color .2s, background .2s; }
.wm-img-drop:hover, .wm-img-drop.is-over { border-color: var(--cc-teal); background: var(--cc-teal-soft); }
.wm-img-prev { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 10px; background: var(--cc-card) repeating-conic-gradient(#E2E8F0 0 25%, transparent 0 50%) 0 0 / 12px 12px; color: var(--cc-ink-3); font-size: 18px; }
.wm-img-prev img { max-width: 100%; max-height: 100%; display: block; }
.wm-img-t { display: grid; gap: 2px; min-width: 0; }
.wm-img-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--cc-ink); }
.wm-img-t small { font-size: .7rem; color: var(--cc-ink-3); }

.wm-range { width: 100%; height: 42px; margin-top: 2px; padding: 0 12px; border: 1px solid var(--cc-line); border-radius: 11px; outline: 0; background: var(--cc-soft); color: var(--cc-ink); font: 500 .84rem 'Poppins', sans-serif; }
.wm-range[hidden] { display: none; }
.wm-range:focus { border-color: var(--cc-teal); box-shadow: 0 0 0 3px rgba(6, 147, 139, .15); }
.wm-range.is-bad { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.wm-range::placeholder { font-size: .8rem; color: var(--cc-ink-3); opacity: .8; }

.wm-page .pm-dl-row { display: flex; }
.wm-page #wmPreview { flex: 1.7 1 0; }
.wm-page #wmRedo { flex: 1 1 0; }
.wm-page #wmShareFile { flex: 0 0 44px; padding: 0; }
.wm-page #wmShareFile span { display: none; }

.wm-page .pm-pv-box { overflow: auto; display: flex; align-items: flex-start; justify-content: flex-start; scrollbar-width: thin; overscroll-behavior: contain; }
.wm-page .pm-pv-box canvas { flex-shrink: 0; margin: auto; }
.wm-page .pm-pv-box.is-zoomed { cursor: grab; }
.wm-page .pm-pv-box.is-pan { cursor: grabbing; }
.wm-zoom { position: absolute; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--cc-line); border-radius: 999px; background: var(--cc-card); }
.wm-zoom[hidden] { display: none; }
.wm-zoom button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--cc-ink-2); font-size: 12px; cursor: pointer; transition: background .2s, color .2s; }
.wm-zoom button:hover { background: var(--cc-teal-soft); color: var(--cc-teal); }
.wm-zoom button:disabled { opacity: .35; pointer-events: none; }
.wm-zoom .pc-zoom-t { width: auto; min-width: 52px; padding: 0 6px; border-radius: 999px; font: 700 .72rem 'Poppins', sans-serif; color: var(--cc-ink); }

.wm-page .qg-toast-text.pm-tt { display: flex; min-width: 0; overflow: hidden; }
.wm-page .pm-tt-pre, .wm-page .pm-tt-ext { flex-shrink: 0; white-space: pre; }
.wm-page .pm-tt-stem { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 761px) {
    .wm-page .qg-note { gap: 6px; font-size: .68rem; white-space: nowrap; letter-spacing: -.01em; }
}
@media (max-width: 760px) {
    .wm-page .pm-tt-pre { display: none; }
    .wm-zoom { display: none !important; }
    .wm-page .pm-pv-box { overflow: hidden; align-items: center; justify-content: center; }
    .wm-page .wm-in input, .wm-page .wm-in select, .wm-range, .wm-hex-in input { font-size: 16px; height: 46px; }
    .wm-hex-sw { height: 46px; }
    .wm-hex { grid-template-columns: 46px minmax(0, 1fr); }
    .wm-stage-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
    .wm-stage-bar { display: contents; }
    .wm-layer-tag { order: 1; flex: 0 1 auto; min-width: 0; white-space: normal; }
    .wm-stage-wrap::after { content: ''; order: 1; flex: 0 0 100%; height: 0; }
    .wm-stage-bar .wm-all { order: 2; margin: 10px auto 0 0; }
    .wm-stage-bar .wm-lock { order: 3; margin: 10px 0 0 auto; }
    .wm-stage, .wm-grid { order: 4; flex: 1 1 100%; min-width: 0; margin-top: 10px; }
    .wm-pnav { order: 5; margin: 10px auto 0; }
    .wm-drag-hint { order: 6; flex: 1 1 100%; margin-top: 10px; }
    .wm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 70vh; padding: 12px; gap: 12px 10px; }
    .wm-stage { min-height: 300px; padding: 14px; }
}
@media (max-width: 600px) {
    .wm-stage { padding: 12px; border-radius: 14px; }
    .wm-layer-tag { font-size: .66rem; }
}