.iwm {
    position: relative;
    z-index: 1;
    padding: 104px 0 80px;
    min-height: 100vh
}

.iwm__hero {
    text-align: center;
    margin-bottom: 40px
}

.iwm__hero .section-tag {
    display: inline-block;
    margin-bottom: 12px
}

.iwm__hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    margin-bottom: 12px
}

.iwm__hero p {
    color: var(--text-muted);
    font-size: 16px
}

.iwm__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 24px;
    align-items: start
}

.iwm__stage,
.iwm__panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(12px)
}

.iwm__stage {
    overflow: hidden
}

.iwm__drop {
    min-height: 500px;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    border: 2px dashed transparent;
    border-radius: var(--radius);
    transition: .2s
}

.iwm__drop[hidden] {
    display: none !important
}

.iwm__drop:hover,
.iwm__drop.is-drag {
    background: var(--bg-card-hover);
    border-color: var(--cyan)
}

.iwm__drop-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--gradient);
    box-shadow: var(--btn-primary-shadow);
    margin-bottom: 8px
}

.iwm__drop h2 {
    font-size: 18px
}

.iwm__drop p,
.iwm__hint,
.iwm__status {
    font-size: 13px;
    color: var(--text-muted)
}

.iwm__workspace {
    display: none
}

.iwm__workspace.is-active {
    display: block
}

.iwm__canvas-wrap {
    position: relative;
    height: min(68vh, 620px);
    min-height: 420px;
    overflow: hidden;
    touch-action: none;
    cursor: crosshair
}

.iwm__canvas-wrap.is-panning {
    cursor: grab
}

.iwm__canvas-wrap.is-panning.is-dragging {
    cursor: grabbing
}

.iwm__canvas-stage {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform
}

.iwm__canvas-stage canvas {
    position: absolute;
    inset: 0;
    display: block
}

.iwm__canvas-stage #iwmMask {
    touch-action: none
}

.iwm__toolbar {
    min-height: 58px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap
}

.iwm__toolbar .iwm__info {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted)
}

.iwm__zoom {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto
}

.iwm__zoom button {
    height: 30px;
    min-width: 30px;
    padding: 0 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer
}

.iwm__zoom b {
    min-width: 48px;
    text-align: center;
    font-size: 12px
}

.iwm__side {
    display: grid;
    gap: 16px
}

.iwm__panel {
    padding: 20px
}

.iwm__panel h3 {
    font-size: 15px;
    margin-bottom: 14px
}

.iwm__panel label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin: 18px 0 8px
}

.iwm__panel input[type=range] {
    width: 100%;
    accent-color: var(--cyan)
}

.iwm__modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px
}

.iwm__mode {
    padding: 9px 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer
}

.iwm__mode:hover,
.iwm__mode.is-active {
    border-color: var(--cyan);
    color: var(--cyan);
    background: color-mix(in srgb, var(--cyan) 8%, transparent)
}

.iwm__hint {
    line-height: 1.55;
    margin-top: 14px;
    min-height: 40px
}

.iwm__download {
    width: 100%;
    margin-top: 20px
}

.iwm__status {
    text-align: center;
    margin-top: 12px;
    min-height: 18px
}

.iwm__tips {
    display: grid;
    gap: 9px;
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5
}

.iwm__tips li::marker {
    color: var(--cyan)
}

.iwm__tips li::before {
    content: "·";
    margin-right: 8px;
    color: var(--cyan);
}

@media(max-width:900px) {
    .iwm__layout {
        grid-template-columns: 1fr
    }

    .iwm__drop {
        min-height: 360px
    }

    .iwm__canvas-wrap {
        min-height: 340px;
        height: 58vh
    }
}

@media(max-width:520px) {
    .iwm {
        padding-top: 92px
    }

    .iwm__toolbar .iwm__info {
        width: 100%;
        margin-left: 0
    }

    .iwm__zoom {
        order: 3;
        margin-left: 0
    }

    .iwm__canvas-wrap {
        min-height: 300px;
        height: 52vh
    }
}