.sw {
    --glow: #33445c44;
    --line: #ffffff13;
    --muted: #a3adba;
    --accent: #b6f35e;
    --surface: #12161d;
    --control: #191f28;
    max-width: 1640px;
    padding: 0 24px;
    margin: 24px auto 48px;
    color: #edf0f5;
}
.sw:has(+ .s3-editor:not([hidden])) { margin-bottom: 0; }
.sw [hidden], .s3-editor[hidden] { display: none !important; }
.sw button, .sw input, .sw select {
    color: inherit;
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--control);
    padding: 9px 13px;
}
.sw select { color-scheme: dark; }
.sw button { cursor: pointer; }
.sw button:hover:not(:disabled) { border-color: #b6f35e75; }
.sw button:disabled { opacity: .5; cursor: default; }
.sw :is(button, a, input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sw small { color: var(--muted); font-size: 12px; }
.sw h1, .sw h2, .sw p { margin: 0; }
.sw .sw-page-title { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.035em; font-weight: 700; }
.sw h2 { font-size: 17px; font-weight: 650; }
.sw-top, .sw-side-head, .sw-toolbar, .sw-market-head, .sw-card-title, .sw-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sw-top { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.sw-tabs {
    display: flex;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--line);
    background: #10141b;
    border-radius: 12px;
}
.sw-tabs button { border-color: transparent; background: transparent; font-weight: 600; white-space: nowrap; }
.sw-tabs button[aria-pressed=true] { color: var(--accent); border-color: #b6f35e40; background: #b6f35e14; }
.sw-tabs .bi { margin-right: 4px; }
.sw-demo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.sw-demo a { color: #d6e0ec; text-decoration: none; border-radius: 6px; padding: 5px 8px; }
.sw-demo a[aria-current] { color: var(--accent); background: #b6f35e16; }
.sw-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); align-items: start; gap: 18px; }
.sw-sidebar, .sw-panel, .sw-market-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.sw-sidebar { display: grid; gap: 12px; padding: 14px; }
.sw-side-head { padding: 4px; }
.sw-counter, .sw-tag { padding: 4px 8px; border-radius: 6px; background: #ffffff10; color: #dddfea; font-size: 11px; }
.sw-set-list { display: grid; gap: 5px; }
.sw button.sw-set-row {
    display: grid; align-items: center; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px;
    padding: 7px; text-align: left; border-color: transparent; background: transparent;
}
.sw button.sw-set-row[aria-pressed=true] { background: #b6f35e0c; border-color: #b6f35e45; }
.sw-set-row strong, .sw-set-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-set-row strong { font-size: 13px; }
.sw-set-row i { color: var(--accent); }
.sw-cover { height: 41px; display: grid; place-items: center; border-radius: 7px; background: var(--glow, #ffffff12); }
.sw-cover img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.sw .sw-archive { background: transparent; border-color: transparent; color: var(--muted); padding: 3px; }
.sw .sw-picker { display: none; }
.sw-panel { overflow: hidden; }
.sw-set-hero {
    display: grid; align-items: center; position: relative; min-height: 188px; overflow: hidden;
    padding: 25px 24px; background: radial-gradient(ellipse at 83% 50%, var(--glow), transparent 67%), #151b23;
    border-bottom: 1px solid var(--line);
}
.sw-hero-info { z-index: 1; width: min(54%, 500px); overflow-wrap: anywhere; }
.sw-hero-info .sw-page-title { margin: 7px 0 3px; }
.sw-hero-art {
    position: absolute; width: min(42%, 430px); height: auto; inset: 12px 3% 12px auto; background: transparent;
    filter: drop-shadow(0 18px 18px #0009);
}
.sw-toolbar { padding: 14px 16px 0; }
.sw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sw .sw-primary { background: var(--accent); color: #17220d; font-weight: 700; border-color: var(--accent); }
.sw-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(137px, 1fr)); padding: 14px 16px 16px; gap: 9px; }
.sw-skin { min-width: 0; min-height: 139px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: radial-gradient(ellipse at 70% 10%, var(--glow), transparent 90%), #171c25; }
.sw-skin img { display: block; width: 100%; height: 92px; object-fit: contain; padding: 4px 10px; filter: drop-shadow(0 8px 8px #0008); }
.sw-skin div { padding: 5px 10px 10px; }
.sw-skin small, .sw-skin strong { display: block; overflow-wrap: anywhere; }
.sw-skin strong { font-size: 12px; }
.sw .tone-blue { --glow: #4775cb3b; }
.sw .tone-green { --glow: #48a96b36; }
.sw .tone-red { --glow: #c557593b; }
.sw .tone-silver { --glow: #bac8db29; }
.sw .tone-amber { --glow: #c8944838; }
.sw-market-head { margin-bottom: 14px; }
.sw-filters { display: flex; gap: 10px; margin-bottom: 13px; }
.sw-filters label { display: flex; align-items: center; flex: 1; gap: 10px; padding-left: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--control); }
.sw-filters input { width: 100%; border: 0; padding-left: 0; background: transparent; }
.sw-filters label i { color: var(--muted); }
.sw-author-filter { margin: -3px 0 14px; }
.sw-author-filter a { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 12px; border: 1px solid #b6f35e38; border-radius: 9px; background: #b6f35e10; color: #d7edb8; text-decoration: none; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.sw-author-filter a:hover { border-color: var(--accent); }
.sw-author-filter span { font-size: 19px; font-weight: 400; }
.sw-market { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.sw-market-card { overflow: hidden; min-width: 0; }
.sw button.sw-open-card { display: block; padding: 0; border: 0; border-radius: 0; width: 100%; background: transparent; }
.sw-open-card:hover img { filter: brightness(1.12) drop-shadow(0 8px 8px #0007); }
.sw-mosaic, .sw-craft-art { background: radial-gradient(ellipse at 50% 38%, var(--glow), transparent 100%), #1a212c; }
.sw-mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); height: 168px; gap: 5px; padding: 9px; }
.sw-mosaic div { min-width: 0; min-height: 0; border: 1px solid #ffffff0b; border-radius: 7px; background: #0b0f1638; }
.sw-mosaic div:first-child { grid-column: span 2; grid-row: span 2; }
.sw-mosaic img { width: 100%; height: 100%; object-fit: contain; padding: 4px; filter: drop-shadow(0 8px 8px #0007); }
.sw-craft-art { position: relative; isolation: isolate; overflow: hidden; height: 168px; }
.sw-craft-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sw-card-details { padding: 12px; }
.sw-card-title { align-items: start; }
.sw button.sw-name-button { display: block; text-align: left; font-weight: 700; padding: 0; background: transparent; border: 0; overflow-wrap: anywhere; }
.sw-stats { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sw-stats button { padding: 3px 5px; background: transparent; border-color: transparent; }
.sw-stats button[aria-pressed=true] { color: #f39eae; }
.sw-card-tags { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 9px; }
.sw-card-tags button { font-size: 11px; padding: 3px 7px; color: #bac5d5; }
.sw-compatible { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sw-compatible button { font-size: 12px; }
.sw-empty { padding: 24px; color: var(--muted); grid-column: 1 / -1; }

.sw-dialog {
    width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 30px); padding: 16px;
    color: #edf0f5; border: 1px solid #ffffff25; background: var(--surface); border-radius: 16px;
}
.sw-dialog::backdrop { background: #050810bc; }
.sw-dialog-head { position: relative; justify-content: flex-start; min-height: 38px; padding-right: 46px; margin-bottom: 12px; }
.sw button.sw-close { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 36px; height: 36px; line-height: 1; font-size: 22px; padding: 0; }
.sw-form { display: grid; gap: 12px; }
.sw-visibility { display: flex; align-items: center; gap: 8px; }
.sw-visibility input { accent-color: var(--accent); }
.sw-detail-art { border-radius: 10px; height: 210px; }
.sw-detail-actions { margin-top: 12px; }
.sw-locked { color: #f0ca82; padding-top: 10px; }
.sw-viewer { height: min(390px, 52dvh); display: grid; place-items: center; position: relative; overflow: hidden; touch-action: none; border-radius: 10px; background: radial-gradient(ellipse at 50% 65%, #3a4145, #171c24 75%); }
.sw-viewer canvas { display: block; width: 100%; height: 100%; }
.sw-view-status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 2; color: #e7edf5; pointer-events: none; text-align: center; }
.sw-toast { position: fixed; bottom: 24px; left: 24px; max-width: calc(100% - 48px); z-index: 1050; background: #222a31; box-shadow: 0 8px 35px #0008; border: 1px solid #b6f35e45; border-radius: 10px; padding: 12px 16px; }
@media (max-width: 1120px) {
    .sw-market { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .sw { padding: 0 12px; margin-top: 14px; }
    .sw-top, .sw-market-head { align-items: stretch; flex-direction: column; }
    .sw-top .sw-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sw-top .sw-tabs button { font-size: 12px; padding: 8px 4px; }
    .sw-top .sw-tabs .bi { display: none; }
    .sw-demo { justify-content: end; }
    .sw-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .sw-sidebar { grid-template-columns: 1fr auto; gap: 8px; }
    .sw-side-head { grid-column: 1 / -1; }
    .sw .sw-picker { display: block; width: 100%; min-width: 0; }
    .sw-set-list { display: none; }
    .sw-sidebar .sw-archive { grid-column: 1 / -1; justify-self: start; }
    .sw-set-hero { padding: 16px; min-height: 131px; }
    .sw-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sw-market { grid-template-columns: minmax(0, 1fr); }
    .sw-filters select { max-width: 46%; }
    .sw-filters :is(input, select) { font-size: 13px; }
}

.sw-top { padding-bottom: 0; border-bottom: 0; }
.sw-top-controls { display: flex; align-items: center; gap: 16px; }
.sw-top-controls .s3-team button { flex-direction: row; min-width: 0; padding: 7px 10px; }
.sw-top-controls .s3-team button img { width: 24px; height: 24px; }
.sw-top-controls .s3-team button.active { background: #b6f35e17; border-color: #b6f35e66; color: var(--accent); }
.sw-workshop-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sw-workshop-tabs img { width: 34px; height: 24px; object-fit: contain; }
.sw .sw-sidebar-title { font-size: 16px; letter-spacing: -.02em; }
.sw .sw-author { display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; color: #b8c3d0; text-decoration: none; font-size: 13px; }
.sw .sw-author:hover { color: var(--accent); text-decoration: underline; }
.sw-author-avatar { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; }
.sw-author-avatar > img, .sw-author-avatar .plus-frame > img:not(.plus-frame__ring) { display: block; width: 24px; height: 24px; object-fit: cover; border-radius: 50%; }
.sw-author-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-card-title > div:first-child { min-width: 0; }
.sw .sw-author { max-width: 100%; }
.sw .sw-renew { display: inline-flex; align-items: center; padding: 9px 13px; border-radius: 9px; text-decoration: none; }
.sw-form label > input:not([type]) { display: block; width: 100%; margin-top: 5px; }
.sw-cover-sample { display: grid; place-items: center; height: 108px; border-radius: 10px; background: radial-gradient(ellipse, var(--glow), #171c25 82%); border: 1px solid var(--line); }
.sw-cover-sample .sw-cover { background: transparent; width: 180px; height: 100px; }
.sw-form fieldset { min-width: 0; }
.sw-form legend { font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.sw-colors, .sw-cover-options > div { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-colors label, .sw-cover-options label { position: relative; cursor: pointer; }
.sw-colors label input, .sw-cover-options label input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; }
.sw-swatch { display: block; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 30px; background: var(--glow); }
.sw-cover-options label { display: grid; place-items: center; width: 63px; height: 47px; border: 1px solid var(--line); border-radius: 8px; background: var(--control); }
.sw-cover-options img { width: 100%; height: 42px; object-fit: contain; }
.sw-colors label:has(input:checked) .sw-swatch, .sw-cover-options label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sw-colors label:has(input:focus-visible), .sw-cover-options label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sw-feed-end { display: grid; place-items: center; min-height: 20px; margin-top: 8px; }
.sw-spinner { display: inline-block; width: 32px; aspect-ratio: 1; border: 3px solid #ffffff24; border-top-color: var(--accent); border-radius: 50%; animation: sw-spin .7s linear infinite; }
.sw-open-card:has(.sw-image-pending) { background: #1a212c; }
.sw-open-card :is(.sw-mosaic div, .sw-craft-art):has(.sw-image-pending) { background: #252e39; }
.sw-open-card .sw-image-pending { opacity: 0; }
@keyframes sw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sw-spinner { animation: none; } }
@media (max-width: 700px) {
    .sw-top-controls { justify-content: space-between; }
    .sw-top-controls:has(#swEditorTeam[hidden]) { justify-content: flex-end; }
    .sw-workshop-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sw-workshop-tabs button { font-size: 12px; padding: 6px 4px; line-height: 1.25; white-space: normal; }
    .sw-workshop-tabs img { width: 25px; }
}
.sw-top .sw-tabs button { display: flex; justify-content: center; align-items: center; gap: 6px; }
.sw-nav-art, .sw-library-art { display: inline-grid; place-items: center; position: relative; flex: none; width: 30px; height: 22px; }
.sw-nav-art img, .sw-library-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px #0009); }
.sw-nav-workshop img { display: block; width: 23px; height: 23px; }
.sw-nav-loadout img:first-child { position: absolute; top: 0; left: 0; width: 24px; height: 16px; }
.sw-nav-loadout img:nth-child(2) { position: absolute; bottom: 0; right: 0; width: 18px; height: 15px; }
.sw-library-art img { position: absolute; width: 19px; height: 19px; }
.sw-library-art img:first-child { left: 1px; top: 0; transform: rotate(-14deg); }
.sw-library-art img:nth-child(2) { right: 0; bottom: 0; transform: rotate(13deg); }
.sw-form .sw-color-picker { display: inline-grid; grid-template-columns: 32px auto; align-items: center; gap: 6px; font-size: 12px; }
.sw-form .sw-color-picker input { position: static; opacity: 1; width: 32px; height: 30px; padding: 3px; cursor: pointer; }
.sw-draft-details { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.sw-draft-details img { width: 26px; height: 26px; object-fit: contain; }
.sw-craft-art.sw-draft-art { display: grid; place-items: center; padding: 10px 18px 32px; }
.sw-craft-art.sw-draft-art > img { object-fit: contain; }
.sw-draft-art .sw-draft-details { position: absolute; bottom: 6px; left: 12px; }
.s3-editor .sw-craft-shortcuts { margin-bottom: 10px; }
@media (max-width: 700px) {
    .sw-top .sw-tabs button { flex-direction: column; gap: 3px; }
}
.sw-form-error { color: #ffadb6; }
.sw-form-error:empty, .sw-craft-hint:empty { display: none; }
.sw .sw-detail-author { margin: 0 0 10px; }
.sw-craft-hint { color: var(--muted); padding-top: 8px; }
.sw-create-viewer { height: min(205px, 28dvh); }
.sw-item-fallback { display: grid; place-items: center; width: 100%; height: 100%; min-height: 35px; color: var(--muted); }

.sw-active-status { display: inline-flex; align-items: center; padding: 0 4px; color: var(--accent); font-size: 13px; }
.sw .sw-card-preview { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 9px; padding: 5px 9px; font-size: 12px; }
.sw-collection-switch { padding-top: 13px; margin-top: 14px; border-top: 1px solid var(--s3-line); }
.sw-collection-switch[hidden] { display: none; }
.sw-collection-switch h2 { margin: 0 0 7px; color: var(--s3-muted); font-size: 12px; font-weight: 600; }
.sw-collection-switch details { position: relative; }
.sw-collection-switch summary, .s3-editor .sw-quick-option {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; width: 100%;
    padding: 6px 8px; border: 1px solid var(--s3-line); border-radius: 9px; background: #191f28;
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.sw-collection-switch summary::-webkit-details-marker { display: none; }
.sw-collection-switch summary:focus-visible { outline: 2px solid var(--s3-accent); outline-offset: 3px; }
.sw-collection-switch summary:hover, .s3-editor .sw-quick-option:hover { border-color: #b6f35e75; }
.sw-quick-current { min-width: 0; }
.sw-quick-label { display: flex; align-items: center; gap: 8px; min-width: 0; text-align: left; }
.sw-quick-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-quick-label .sw-cover { width: 41px; height: 32px; flex: 0 0 41px; overflow: hidden; }
.sw-quick-label .sw-cover img { height: 30px; }
.sw-quick-options {
    position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 8; display: grid; gap: 3px;
    max-height: 240px; overflow-y: auto; padding: 4px; border: 1px solid var(--s3-line); border-radius: 10px;
    background: #12161d; box-shadow: 0 12px 30px #0009;
}
.sw-collection-switch details:not([open]) .sw-quick-options { display: none; }
.s3-editor .sw-quick-option[aria-current] { color: var(--s3-accent); border-color: #b6f35e66; }
@media (max-width: 700px) {
    .sw-toolbar { align-items: flex-start; }
    .sw-toolbar .sw-actions { justify-content: flex-end; }
}

.sw-detail-teams { width: fit-content; margin-bottom: 10px; }
.sw-detail-set .sw-items { padding: 0; grid-template-columns: repeat(auto-fill,minmax(112px,1fr)); }
.sw-craft-target { margin-bottom: 9px; }
.sw-craft-target select:first-child { min-width: 0; flex: 1; }
.sw-author-avatar .clan-outline img { display: block; }
@media (max-width: 700px) { .sw-detail-set .sw-items { grid-template-columns: repeat(2,minmax(0,1fr)); } }

.sw-author-badges { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.sw-author-badges > :is(.profile-name-icon, .profile-custom-badge, .profile-staff-badge, .admin-report-streak-badge, .ps-badge) {
    margin: 0 !important;
    flex: none;
}
.sw-author-badges > :is(.profile-custom-badge, .profile-staff-badge) { line-height: 1.25; }
.sw-author-badges > .profile-name-icon { object-fit: contain !important; }
.sw .sw-fallback-label { display: none; }
.sw-skin > .sw-item-fallback {
    height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    padding: 8px; text-align: center;
}
.sw-skin .sw-fallback-label { display: block; font-size: 11px; line-height: 1.25; }
.sw-hero-art .sw-fallback-label { display: block; font-size: 12px; text-align: center; }
.sw-hero-art .sw-item-fallback { align-content: center; gap: 5px; }
.sw .sw-item-lock { color: #efca80; margin-top: 4px; line-height: 1.3; }
.sw-limit-note { grid-column: 1 / -1; }
