body[data-module-theme="stageplot"] {
    --stageplot-accent: var(--module-page-accent, #b49ceb);
    --stageplot-on-accent: var(--module-page-on-accent, #000000);
    --stageplot-accent-soft: color-mix(in srgb, var(--stageplot-accent) 14%, var(--app-surface));
    --stageplot-accent-strong: color-mix(in srgb, var(--stageplot-accent) 72%, #332746);
    --stageplot-danger: #d95c4d;
    --stageplot-danger-soft: color-mix(in srgb, var(--stageplot-danger) 12%, var(--app-surface));
}

.stageplot-shell {
    width: var(--app-content-width);
    max-width: var(--app-content-max);
    margin: 0 auto;
}

.stageplot-hero {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 var(--app-section-gap);
    padding: 24px 300px 24px 26px;
    border-radius: var(--app-radius-lg);
    background: var(--stageplot-accent) !important;
    box-shadow: var(--app-shadow-card);
    color: var(--stageplot-on-accent) !important;
}

.stageplot-kicker,
.stageplot-title,
.stageplot-intro {
    margin: 0;
    color: inherit !important;
}

.stageplot-kicker {
    margin-bottom: 8px;
    color: color-mix(in srgb, var(--stageplot-on-accent) 78%, transparent) !important;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.stageplot-title {
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1;
}

.stageplot-intro {
    max-width: 780px;
    margin-top: 10px;
    color: color-mix(in srgb, var(--stageplot-on-accent) 84%, transparent) !important;
    font-size: 16px;
    line-height: 1.5;
}

.stageplot-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: var(--app-section-gap);
    align-items: start;
}

.stageplot-panel,
.stageplot-sidebar {
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-card);
    color: var(--app-text);
}

.stageplot-panel {
    padding: var(--app-card-padding);
}

.stageplot-sidebar {
    position: sticky;
    top: 82px;
    padding: 20px;
}

.stageplot-panel-head,
.stageplot-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--app-line);
}

.stageplot-panel-head h2,
.stageplot-panel-head p,
.stageplot-sidebar-head h2,
.stageplot-sidebar-head p {
    margin: 0;
}

.stageplot-panel-head p,
.stageplot-sidebar-head p {
    margin-top: 6px;
    color: var(--app-muted);
    font-size: 14px;
    font-weight: 700;
}

.stageplot-head-actions {
    display: flex;
    gap: 10px;
}

.stageplot-add-button,
.stageplot-primary,
.stageplot-secondary,
.stageplot-danger,
.stageplot-plot-button,
.stageplot-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--stageplot-accent) 44%, var(--app-line));
    border-radius: 999px;
    background: var(--stageplot-accent-soft);
    color: var(--stageplot-accent-strong);
    font-weight: 900;
    cursor: pointer;
}

.stageplot-add-button {
    width: 54px;
    height: 54px;
    padding: 0;
    border-color: var(--stageplot-accent) !important;
    background: var(--stageplot-accent) !important;
    color: var(--stageplot-on-accent) !important;
    box-shadow: 0 14px 30px color-mix(in srgb, var(--stageplot-accent) 26%, transparent);
}

.stageplot-add-button.small {
    width: 44px;
    height: 44px;
}

.stageplot-add-button svg,
.stageplot-close-button svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.7;
}

.stageplot-meta-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) minmax(130px, .5fr) minmax(130px, .5fr);
    gap: 12px;
    margin-top: 18px;
}

.stageplot-meta-grid label,
.stageplot-form label {
    display: grid;
    gap: 7px;
    color: var(--app-text);
    font-weight: 900;
}

.stageplot-meta-grid span,
.stageplot-form span {
    color: var(--app-muted);
    font-size: 13px;
    text-transform: uppercase;
}

.stageplot-canvas-wrap {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--stageplot-accent) 38%, var(--app-line));
    border-radius: var(--app-radius-lg);
    background:
        radial-gradient(circle at 22% 18%, color-mix(in srgb, var(--stageplot-accent) 10%, transparent), transparent 34%),
        color-mix(in srgb, var(--stageplot-accent) 5%, var(--app-surface-strong));
    overflow: auto;
    scrollbar-color: var(--stageplot-accent) color-mix(in srgb, var(--stageplot-accent) 12%, var(--app-surface-strong));
}

.stageplot-canvas-wrap::-webkit-scrollbar,
.stageplot-form::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.stageplot-canvas-wrap::-webkit-scrollbar-track,
.stageplot-form::-webkit-scrollbar-track {
    border-radius: 999px;
    background: color-mix(in srgb, var(--stageplot-accent) 12%, var(--app-surface-strong));
}

.stageplot-canvas-wrap::-webkit-scrollbar-thumb,
.stageplot-form::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--stageplot-accent);
}

.stageplot-canvas {
    position: relative;
    min-width: 760px;
    max-width: 100%;
    border: 2px solid color-mix(in srgb, var(--stageplot-accent) 68%, var(--app-line));
    border-radius: 18px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--stageplot-accent) 16%, transparent) 1px, transparent 1px),
        linear-gradient(0deg, color-mix(in srgb, var(--stageplot-accent) 16%, transparent) 1px, transparent 1px),
        color-mix(in srgb, var(--app-surface) 92%, var(--stageplot-accent));
    background-size: 10% 10%;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.stageplot-canvas::before {
    content: "Bühne";
    position: absolute;
    top: 12px;
    left: 16px;
    z-index: 1;
    color: color-mix(in srgb, var(--stageplot-accent-strong) 72%, var(--app-muted));
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.stageplot-audience {
    position: absolute;
    right: 16px;
    bottom: 12px;
    z-index: 1;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stage-item {
    position: absolute;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(42px, .62fr) minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 68px;
    min-height: 44px;
    padding: 8px 9px;
    border: 1px solid color-mix(in srgb, var(--stageplot-accent) 56%, var(--app-line));
    border-radius: 14px;
    background: color-mix(in srgb, var(--app-surface) 88%, var(--stageplot-accent));
    box-shadow: 0 12px 28px color-mix(in srgb, #000 12%, transparent);
    color: var(--app-text);
    cursor: grab;
}

.stage-item:active {
    cursor: grabbing;
}

.stage-item.is-dragging {
    z-index: 10;
    box-shadow: 0 18px 36px color-mix(in srgb, var(--stageplot-accent) 28%, transparent);
}

.stage-item-graphic {
    display: grid;
    min-width: 40px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--stageplot-accent) 18%, var(--app-surface));
    color: var(--stageplot-accent-strong);
}

.stage-item-graphic svg {
    width: 100%;
    max-width: 66px;
    height: 38px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3.1;
}

.stage-item-graphic svg text {
    fill: currentColor;
    stroke: none;
    font-size: 14px;
    font-weight: 1000;
}

.stage-item-label {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 1000;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stage-item-remove {
    position: absolute;
    top: -9px;
    right: -9px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--stageplot-danger) !important;
    border-radius: 999px;
    background: var(--stageplot-danger-soft) !important;
    color: var(--stageplot-danger) !important;
    font-size: 16px;
    font-weight: 1000;
    line-height: 1;
    cursor: pointer;
}

.stage-item--drums {
    border-radius: 999px;
}

.stage-item--microphone,
.stage-item--monitor,
.stage-item--pedalboard {
    border-radius: 999px;
}

.stageplot-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.stageplot-plot-button {
    width: 100%;
    justify-content: flex-start;
    padding: 13px 14px;
    border-radius: var(--app-radius-md);
    background: var(--app-surface-strong);
    color: var(--app-text);
    text-align: left;
}

.stageplot-plot-button.is-active {
    border-color: var(--stageplot-accent) !important;
    background: color-mix(in srgb, var(--stageplot-accent) 16%, var(--app-surface)) !important;
}

.stageplot-plot-button strong,
.stageplot-plot-button span {
    display: block;
}

.stageplot-plot-button span {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 12px;
}

.stageplot-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--app-line);
}

.stageplot-primary,
.stageplot-secondary,
.stageplot-danger {
    min-height: 44px;
    padding: 0 18px;
}

.stageplot-primary {
    border-color: var(--stageplot-accent) !important;
    background: var(--stageplot-accent) !important;
    color: var(--stageplot-on-accent) !important;
}

.stageplot-danger {
    border-color: var(--stageplot-danger) !important;
    background: var(--stageplot-danger-soft) !important;
    color: var(--stageplot-danger) !important;
}

.stageplot-modal[hidden] {
    display: none;
}

.stageplot-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.stageplot-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 18, .62);
}

.stageplot-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    border: 1px solid color-mix(in srgb, var(--stageplot-accent) 42%, var(--app-line));
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.stageplot-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    background: var(--stageplot-accent);
    color: var(--stageplot-on-accent);
}

.stageplot-dialog-head p,
.stageplot-dialog-head h2 {
    margin: 0;
    color: inherit !important;
}

.stageplot-dialog-head p {
    margin-bottom: 5px;
    color: color-mix(in srgb, var(--stageplot-on-accent) 78%, transparent) !important;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stageplot-close-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--stageplot-on-accent) 32%, transparent) !important;
    background: color-mix(in srgb, var(--stageplot-on-accent) 10%, transparent) !important;
    color: var(--stageplot-on-accent) !important;
}

.stageplot-form {
    max-height: calc(100vh - 200px);
    padding: 22px 24px 24px;
    overflow: auto;
    scrollbar-color: var(--stageplot-accent) color-mix(in srgb, var(--stageplot-accent) 12%, var(--app-surface-strong));
}

.stageplot-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.stageplot-form .is-wide {
    grid-column: 1 / -1;
}

.stageplot-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 980px) {
    .stageplot-hero {
        padding-right: 26px;
    }

    .stageplot-layout,
    .stageplot-meta-grid {
        grid-template-columns: 1fr;
    }

    .stageplot-sidebar {
        position: static;
    }

    .stageplot-canvas {
        min-width: 660px;
    }
}

@media (max-width: 640px) {
    .stageplot-panel,
    .stageplot-sidebar {
        padding: 16px;
    }

    .stageplot-form-grid {
        grid-template-columns: 1fr;
    }

    .stageplot-form-actions {
        flex-direction: column-reverse;
    }
}
