
.sps .pt-bar__main { gap: 18px; }

.sps .wsx-canvas { container-type: size; }
.sps-board { --rule: 22px; position: relative; display: grid; grid-template-columns: var(--rule) minmax(0, 1fr); grid-template-rows: var(--rule) minmax(0, 1fr); width: 100%; height: 100%; border-radius: 18px; overflow: hidden; background: var(--pt-soft); box-shadow: inset 0 0 0 1px var(--pt-line); }
.sps-unit { grid-area: 1 / 1; z-index: 2; width: var(--rule); height: var(--rule); padding: 0; border: 0; border-right: 1px solid var(--pt-line); border-bottom: 1px solid var(--pt-line); background: #fff; color: var(--sw-ink); font-family: var(--font-mono); font-size: 10px; font-weight: 600; cursor: pointer; }
.sps-unit:hover { background: var(--pt-soft-2); }
.sps-ruler { display: block; width: 100%; height: 100%; background: rgba(255, 255, 255, .94); }
.sps-ruler--top { grid-area: 1 / 2; border-bottom: 1px solid var(--pt-line); }
.sps-ruler--left { grid-area: 2 / 1; border-right: 1px solid var(--pt-line); }
.sps-view { grid-area: 2 / 2; position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.sps-view canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.sps .pt-ctrl .pt-dd[hidden], .sps .pt-ctrl .ws-custom[hidden] { display: none; }
.sps .sps-size-btn { gap: 8px; }
.sps-size-shape { flex: 0 0 auto; width: 13px; height: 13px; border: 1.6px solid currentColor; border-radius: 3px; opacity: .5; box-sizing: border-box; }
.sps-grid-pop { width: auto; min-width: 300px; }
.sps-grid-pop .pt-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.sps-grid-pop .pt-pop__head .pt-pop__title { margin: 0; }
.sps .sps-pop-switch { width: auto; }

.sps-empty { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; pointer-events: none; }
.sps-empty > * { pointer-events: auto; }
.sps-empty__title { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; color: var(--sw-ink); }
.sps-empty__text { margin: 0 0 10px; font-size: 14px; color: var(--sw-muted); }
.sps-view.is-over::after { content: ''; position: absolute; inset: 8px; z-index: 4; border: 2px dashed #CFC6BF; border-radius: 14px; pointer-events: none; }


.sps-zoom { gap: 12px; }
.sps-zoom .pt-range { width: 160px; }
.sps-zoom__value { min-width: 48px; height: 28px; padding: 0 4px; border: 0; border-radius: 8px; background: transparent; color: #020817; font-size: var(--t-value-size); font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; }
.sps-zoom__value:hover { background: var(--pt-soft-2); }

.sps-tile-pop { width: 340px; }
.sps-presets { display: grid; gap: 2px; margin-bottom: 12px; }
.sps-presets button { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 42px; padding: 0 12px; border: 0; border-radius: 11px; background: transparent; color: var(--sw-ink); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.sps-presets button:hover { background: var(--pt-soft); }
.sps-presets button.is-active { background: var(--pt-soft-2); font-weight: 700; }
.sps-presets small { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--sw-muted); }
.sps-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sps-tile-head .pt-pop__title { margin: 0; }
.sps-tile-custom { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--pt-line); }
.sps-tile-custom label, .sps-custom label { display: grid; gap: 4px; font-size: 12px; color: var(--sw-muted); }
.sps-tile-custom input, .sps-custom input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #e8e8e8; border-radius: 10px; background: #fff; color: var(--sw-ink); font-family: var(--font-mono); font-size: 13px; }
.sps .sps-units { height: 38px; padding: 3px; border-radius: 11px; }
.sps .sps-units .palette-topbar__format-button { height: 30px; min-width: 0; padding: 0 9px; border-radius: 8px; font-size: 13px; }

.sps-export-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 10px; }
.pt-pop > .sps-export-head:first-child { margin-top: 0; }
.sps-export-head .pt-pop__title { margin: 0; }
.sps-export-head .psx-tile-size { width: 200px; }
.sps-export-size { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--sw-muted); }
.sps-custom { display: flex; align-items: end; gap: 8px; margin-bottom: 10px; }
.sps-custom > span { padding-bottom: 11px; color: var(--sw-muted); font-size: 13px; }
.sps-export-scale { margin: 4px 0 12px; grid-template-columns: 92px minmax(0, 1fr) 64px; }
.sps-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--sw-muted); }
.sps-note:empty { display: none; }
.sps-warn { color: #b42318; }

.sps-row { display: grid; gap: 8px; margin-top: 18px; }
.sps-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sps-acts[hidden] { display: none; }
.sps-acts button { height: 36px; padding: 0 13px; border: 0; border-radius: 999px; background: #F7F5F2; color: var(--sw-muted); font-family: var(--font-ui); font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; cursor: pointer; white-space: nowrap; transition: background .2s ease, color .2s ease; }
.sps-acts button:hover { background: #EDEBE8; color: var(--sw-ink); }
.sps-recolor { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sps-swatch { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px; border: 1px solid #e8e8e8; border-radius: 10px; background: #fff; cursor: pointer; }
.sps-swatch span { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.sps-swatch b { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--sw-ink-2); }
.sps-swatch:disabled { opacity: .45; cursor: default; }
.sps-actions-top { margin-top: 0; margin-bottom: 4px; }
.sps-actions-flat { margin-top: 0; }
.sps-gap { margin-bottom: 14px; }
.sps-gap-top { margin-top: 14px; }
.sps-wide { width: 100%; justify-content: center; height: 46px; }

.sps-drop { width: 100%; display: grid; gap: 6px; padding: 22px 18px; border: 1.5px dashed #DCD4CE; border-radius: 16px; background: var(--pt-soft); color: var(--sw-ink); text-align: center; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.sps-drop:hover { background: var(--pt-soft-2); border-color: #CFC6BF; }
.sps-drop b { font-size: 15px; font-weight: 650; }
.sps-drop span { font-size: 13px; line-height: 1.45; color: var(--sw-muted); }
.sps-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.sps-library:empty { display: none; }
.sps-lib-hint { margin-top: 12px; }
.sps-motif { position: relative; display: grid; gap: 4px; min-width: 0; }
.sps-motif__add { position: relative; width: 100%; aspect-ratio: 1; padding: 6px; border: 1px solid var(--pt-line); border-radius: 12px; background: repeating-conic-gradient(#F3F0ED 0 25%, #fff 0 50%) 0 0 / 12px 12px; cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.sps-motif__add:hover { border-color: #CFC6BF; transform: translateY(-1px); }
.sps-motif__add img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sps-motif__name { font-size: 11.5px; color: var(--sw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sps-motif__remove { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; padding: 0; border: 1px solid var(--pt-line-2); border-radius: 50%; background: #fff; color: var(--sw-muted); font-size: 13px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .2s ease; }
.sps-motif:hover .sps-motif__remove, .sps-motif__remove:focus-visible { opacity: 1; }
@media (hover: none) { .sps-motif__remove { opacity: 1; } }
.sps-motif__warn { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: #f5a524; box-shadow: 0 0 0 2px #fff; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; pointer-events: none; transition: opacity .2s ease; }
.sps-motif:hover .sps-motif__warn { opacity: 0; }
@media (hover: none) { .sps-motif__warn { right: 20px; } .sps-motif:hover .sps-motif__warn { opacity: 1; } }
.sps-warnings { margin: 14px 0 0; padding: 12px 14px; list-style: none; border-radius: 12px; background: #FFF6E8; font-size: 12.5px; line-height: 1.45; color: var(--sw-ink-2); display: grid; gap: 4px; }
.sps-ways { display: grid; gap: 8px; }
.sps-way { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid #e8e8e8; border-radius: 14px; background: #fff; color: var(--sw-ink); text-align: left; cursor: pointer; transition: background .2s ease; }
.sps-way:hover { background: var(--pt-soft); }
.sps-way b { font-size: 14px; font-weight: 650; }
.sps-way span { font-size: 12.5px; line-height: 1.4; color: var(--sw-muted); }
.sps-saved { margin-top: 10px; }

.sps-switches { display: grid; gap: 14px; }
.sps .ws-wide-btn[hidden], .sps #spSelSingle[hidden], .sps #spSelMulti[hidden] { display: none; }
.sps .sps-wide-dark { background: var(--sw-ink); border-color: var(--sw-ink); color: #fff; }
.sps .sps-wide-dark:hover { background: #3a322e; }
.sps .sps-acts-flush { margin-top: 0; }
.sps .sps-choice-gap { margin-top: 18px; }
.sps .ws-choice + .pt-sliders { margin-top: 20px; }
.sps .psx-selected .ws-ft-sub { margin: 22px 0 10px; }
.sps-dot { display: inline-flex; align-items: center; gap: 7px; }
.sps-dot::before { content: ''; width: 9px; height: 9px; flex: none; border-radius: 50%; }
.sps-dot--large::before { background: #2f5bd3; }
.sps-dot--medium::before { background: #c2334d; }
.sps-dot--small::before { background: #2b8a57; }


.sps-dialog { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(17, 17, 17, .55); }
.sps-dialog__card { width: min(880px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; padding: 20px; border-radius: 24px; background: #fff; box-shadow: 0 24px 80px rgba(0, 0, 0, .24); }
.sps-crop { flex: 1; min-height: 240px; position: relative; border-radius: 14px; overflow: hidden; background: repeating-conic-gradient(#F3F0ED 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.sps-crop canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.sps-dialog__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.sps-dialog__left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }


@media (max-width: 1080px) {
  .sps .wsx-canvas { height: auto; container-type: inline-size; }
  .sps-board { width: 100%; height: min(100cqw, 78vh); }
}
@media (max-width: 640px) {
  .sps-tile-pop, .sps .pt-pop--export { width: min(460px, calc(100vw - 24px)); }
}
.sps .pt-btn:disabled { opacity: .4; cursor: default; transform: none; }
.sps #spSelTitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sps .pt-changes { display: none; }
.sps-empty .pt-btn { width: auto; padding: 0 16px; }
@media (max-width: 760px) {
  .sps .pt-ctrl > .palette-topbar__format, .sps .pt-ctrl > .palette-topbar__colors, .sps .pt-ctrl > .ws-size { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .sps .pt-ctrl > .palette-topbar__format .palette-topbar__format-button { flex: 1; min-width: 0; }
  .sps .pt-ctrl > .sps-zoom { flex: 1 1 100%; }
  .sps-zoom .pt-range { flex: 1; width: auto; min-width: 0; }
  .sps .pt-ctrl > .ws-size .ws-size__btn { width: 100%; justify-content: flex-start; }
  .sps .pt-ctrl > .ws-size .pt-chev { margin-left: auto; }
  .sps .pt-ctrl > .pt-dd, .sps .pt-ctrl .sps-size-btn { min-width: 0; }
  .sps .pt-ctrl .sps-size-btn { gap: 6px; padding: 0 10px; }
  .sps .sps-size-btn .ws-size__dims { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.sps .toast { width: max-content; max-width: min(620px, calc(100vw - 32px)); line-height: 1.45; text-align: center; }
.sps .sps-grids { margin-bottom: 4px; }
.sps-grid-card .ws-style__img { overflow: hidden; background: var(--pt-soft); }
.sps-grid-card canvas { display: block; width: 100%; height: 100%; }
.sps-grid-pop { max-width: 360px; }
.sps-field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--sw-muted); }
.sps-field input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #e8e8e8; border-radius: 12px; background: #fff; color: var(--sw-ink); font-size: 14px; font-weight: 600; }
.sps-field input:focus { outline: none; border-color: var(--pt-line-2); box-shadow: 0 0 0 3px var(--pt-soft-2); }
.sps-slot .pt-empty { margin: 0; }
.sps-slot .pt-block__head { margin-bottom: 12px; }
.sps-slot-title { display: inline-flex; align-items: center; gap: 10px; }
.sps-slot-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px var(--pt-line-2); cursor: pointer; }
.sps-slot-dot span { width: 14px; height: 14px; border-radius: 50%; }
.sps [data-grid-only]:not([hidden]) + .sps-zoom-row { margin-top: 14px; }
