.desktop-files {
    position: absolute;
    top: 12px;
    right: 112px;
    bottom: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    pointer-events: none;
}

.desktop-files .desk-icon {
    pointer-events: auto;
}

.desktop-files .desk-icon span {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    word-break: break-word;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.desk-icon .fm-glyph {
    width: 56px;
    height: 56px;
}

.desk-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.desk-rename {
    box-sizing: border-box;
    width: 100%;
    padding: 2px 4px;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid var(--accent);
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    text-align: center;
    outline: 0;
}

.fm-thumb {
    object-fit: cover;
    background: #fff;
    border-radius: 6px;
    pointer-events: none;
}

.is-viewer .uwin-body,
.is-paint .uwin-body,
.is-music .uwin-body {
    overflow: hidden;
}

.ud-overlay {
    position: absolute;
    inset: 0;
    z-index: 150;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
    outline: 0;
}

.ud-dialog {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(460px, 100%);
    max-height: 100%;
    padding: 16px;
    color: var(--fg);
    background: var(--win-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    -webkit-user-select: text;
    user-select: text;
}

.ud-dialog h3 {
    margin: 0;
    font-size: 16px;
}

.ud-name {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 12px;
    color: var(--fg);
    background: var(--input-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    font: inherit;
    outline: 0;
}

.ud-name:focus {
    border-color: var(--accent);
}

.ud-path {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ud-where {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.75;
}

.ud-list {
    min-height: 120px;
    max-height: 200px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    list-style: none;
    background: var(--view-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.ud-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.ud-list li:hover {
    background: var(--hover);
}

.ud-list li.chosen {
    background: color-mix(in srgb, var(--accent) 38%, transparent);
}

.ud-list li.muted,
.ud-list li.empty {
    cursor: default;
    opacity: 0.4;
}

.ud-list li.muted:hover,
.ud-list li.empty:hover {
    background: transparent;
}

.ud-thumb {
    width: 24px;
    height: 24px;
    object-fit: cover;
    background: #fff;
    border-radius: 4px;
}

.ud-kind {
    width: 24px;
    text-align: center;
}

.ud-error {
    min-height: 0;
    margin: 0;
    color: #ffb4a3;
    font-size: 13px;
}

.ud-error:empty {
    display: none;
}

.ud-foot {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ud-spacer {
    flex: 1;
}

.ud-btn {
    padding: 7px 16px;
    color: var(--fg);
    background: var(--btn-bg);
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ud-btn:hover:not(:disabled) {
    background: var(--btn-hover);
}

.ud-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.ud-btn.primary {
    color: #fff;
    background: var(--accent);
}

.iv {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--fg);
    background: var(--view-bg);
    outline: 0;
}

.iv-bar,
.pt-bar {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
}

.iv-btn,
.pt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
    color: var(--fg);
    background: var(--btn-bg);
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.iv-btn:hover:not(:disabled),
.pt-btn:hover:not(:disabled) {
    background: var(--btn-hover);
}

.iv-btn:disabled,
.pt-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.iv-btn .sym,
.pt-btn .sym {
    width: 16px;
    height: 16px;
}

.iv-spacer,
.pt-spacer {
    flex: 1;
}

.iv-stage {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.iv-stage.zoomed {
    overflow: auto;
}

.iv-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    object-fit: contain;
    background: #fff;
}

.iv-stage.zoomed .iv-img {
    max-width: none;
    max-height: none;
}

.iv-img.pixels {
    image-rendering: pixelated;
}

.iv-status,
.pt-status {
    flex: none;
    padding: 4px 12px;
    font-size: 12px;
    border-top: 1px solid var(--border);
    opacity: 0.7;
}

.pt {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--fg);
    background: var(--view-bg);
    outline: 0;
}

.pt-sep {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--border);
}

.pt-main {
    display: flex;
    flex: 1;
    min-height: 0;
}

.pt-tools {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: 14px;
    width: 150px;
    padding: 10px;
    overflow-y: auto;
    background: var(--side-bg);
    border-right: 1px solid var(--border);
}

.pt-toolgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pt-tool {
    padding: 7px 4px;
    color: var(--fg);
    background: var(--btn-bg);
    border: 2px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.pt-tool:hover {
    background: var(--btn-hover);
}

.pt-tool.active {
    border-color: var(--accent);
}

.pt-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.pt-field input {
    accent-color: var(--accent);
}

.pt-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.pt-canvaswrap {
    flex: 1;
    min-width: 0;
    padding: 12px;
    overflow: auto;
    background: color-mix(in srgb, var(--side-bg) 70%, #000);
}

.pt-sheet {
    position: relative;
    width: max-content;
    height: max-content;
    line-height: 0;
    cursor: crosshair;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
    touch-action: none;
}

.pt-canvas {
    display: block;
    background: #fff;
}

.pt-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.pt-colors {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: var(--header-bg);
    border-top: 1px solid var(--border);
}

.pt-current {
    position: relative;
    width: 46px;
    height: 38px;
}

.pt-primary,
.pt-secondary {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 2px solid var(--border);
    border-radius: 6px;
}

.pt-primary {
    top: 0;
    left: 0;
    z-index: 1;
}

.pt-secondary {
    top: 10px;
    left: 16px;
}

.pt-palette {
    display: grid;
    grid-template-columns: repeat(10, 22px);
    gap: 3px;
}

.pt-swatch {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(128, 128, 128, 0.6);
    border-radius: 4px;
    cursor: pointer;
}

.pt-swatch:hover {
    transform: scale(1.12);
}

.pt-custom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
}

.pt-custom input {
    width: 34px;
    height: 22px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.pt-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
}

.pt-layer[hidden] {
    display: none;
}

.pt-dims {
    display: flex;
    gap: 10px;
}

.pt-dims label {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.mp {
    display: flex;
    height: 100%;
    color: var(--fg);
    background: var(--view-bg);
}

.mp-now {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: min(46%, 320px);
    padding: 20px 18px;
    overflow-y: auto;
    background: var(--side-bg);
    border-right: 1px solid var(--border);
}

.mp-cover {
    width: 100%;
    max-width: 230px;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.mp-title {
    margin-top: 8px;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    overflow-wrap: anywhere;
}

.mp-artist {
    font-size: 13px;
    opacity: 0.65;
}

.mp-seek {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    font-size: 11px;
}

.mp-bar,
.mp-vol {
    flex: 1;
    min-width: 0;
    accent-color: var(--accent);
}

.mp-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mp-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--fg);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.mp-btn:hover {
    background: var(--hover);
}

.mp-btn.big {
    width: 52px;
    height: 52px;
    color: #fff;
    background: var(--accent);
}

.mp-btn.big:hover {
    filter: brightness(1.1);
}

.mp-btn.big .sym {
    width: 24px;
    height: 24px;
}

.mp-btn.small {
    width: 32px;
    height: 32px;
    opacity: 0.55;
}

.mp-btn.small.on {
    color: var(--accent);
    opacity: 1;
}

.mp-one {
    position: absolute;
    right: 3px;
    bottom: 1px;
    display: none;
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
}

.mp-btn.one .mp-one {
    display: block;
}

.mp-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 80%;
    margin-top: 4px;
}

.mp-list {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    list-style: none;
}

.mp-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 10px;
    cursor: pointer;
}

.mp-row:hover {
    background: var(--hover);
}

.mp-row img {
    flex: none;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.mp-row.playing {
    background: color-mix(in srgb, var(--accent) 25%, transparent);
}

.mp-row.playing .mp-name {
    color: var(--accent);
    font-weight: 700;
}

.mp-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-artist-small {
    flex: none;
    font-size: 12px;
    opacity: 0.55;
}

.mp-empty {
    padding: 24px;
    text-align: center;
    opacity: 0.6;
}

.bt-pic {
    display: block;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: zoom-in;
}

.bt-pic img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    margin: 0 auto;
}

.bt-note {
    margin: 0;
    font-size: 12px;
    opacity: 0.6;
}

.bt-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: 10px;
}

.bt-banner img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    background: #fff;
    border-radius: 6px;
}

.bt-banner span {
    flex: 1;
    min-width: 0;
}

.bt-attachrow {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.bt-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px;
    background: var(--btn-bg);
    border-radius: 8px;
}

.bt-chip[hidden] {
    display: none;
}

.bt-chip img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    background: #fff;
    border-radius: 4px;
}

.bt-chipname {
    max-width: 180px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bt-x {
    padding: 0 6px;
    color: var(--fg);
    background: none;
    border: 0;
    font-size: 16px;
    cursor: pointer;
}

.bt-dialog.bt-big {
    width: min(640px, 100%);
}

.bt-big img {
    align-self: center;
    max-width: 100%;
    max-height: 340px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.help {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--fg);
    background: var(--view-bg);
}

.help-tabs {
    display: flex;
    flex: none;
    gap: 4px;
    padding: 8px 12px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
}

.help-tab {
    padding: 6px 16px;
    color: var(--fg);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.help-tab:hover {
    background: var(--hover);
}

.help-tab.active {
    background: var(--btn-bg);
}

.help-page {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.help-page[hidden] {
    display: none;
}

.help-page .about {
    height: auto;
    min-height: 100%;
    box-sizing: border-box;
}

.guide {
    box-sizing: border-box;
    max-width: 440px;
    margin: 0 auto;
    padding: 30px 28px 34px;
    line-height: 1.6;
    -webkit-user-select: text;
    user-select: text;
}

.guide h1 {
    margin: 0 0 18px;
    font-size: 22px;
    line-height: 1.3;
}

.guide p {
    margin: 0 0 14px;
}

.guide-sign {
    margin-top: 22px;
    font-weight: 700;
}

.mp-seek .mp-bar:disabled {
    opacity: 0.5;
}

.ad-pic {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .pt-main {
        flex-direction: column;
    }

    .pt-tools {
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .pt-toolgrid {
        flex: 1;
        grid-template-columns: repeat(4, 1fr);
        min-width: 240px;
    }

    .mp {
        flex-direction: column;
    }

    .mp-now {
        width: auto;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .mp-cover {
        max-width: 120px;
    }
}
