/* Device mockup generator (/device-mockup-generator): the mockup straight on the stage at the picture's shape (--dm-aspect,
   set by the script), the frame colours and backgrounds as round swatches. Panels, chips, sliders and buttons come from
   the app kit. */

/* The stage shows the theme's checkerboard, so a transparent background reads as one. */
.dm-landing-app.ak-app > .filter-landing-stage.ak-stage {
    background: var(--component-checkerboard);
}

.dm-landing-app .dm-frame {
    position: relative;
    width: 100%;
    max-width: min(820px, calc(70vh * var(--dm-aspect, 1)));
}

/* Dragging the picture tilts and turns the device, so the page does not scroll under a finger there. */
.dm-landing-app .dm-canvas {
    display: block;
    width: 100%;
    aspect-ratio: var(--dm-aspect, 1);
    border-radius: var(--ak-radius-sm, 6px);
    touch-action: none;
    cursor: grab;
}

.dm-landing-app .dm-canvas.is-dragging {
    cursor: grabbing;
}

.dm-landing-app .dm-canvas:focus-visible {
    outline: 2px solid var(--ak-accent);
    outline-offset: 2px;
}

.dm-landing-app .dm-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dm-landing-app .dm-swatch {
    --dm-swatch: #888888;
    position: relative;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--ak-text) 25%, transparent);
    border-radius: 50%;
    background: var(--dm-swatch);
    cursor: pointer;
}

.dm-landing-app .dm-swatch[aria-checked="true"] {
    box-shadow: 0 0 0 2px var(--ak-panel, #ffffff), 0 0 0 4px var(--ak-accent);
}

.dm-landing-app .dm-swatch:focus-visible {
    outline: 2px solid var(--ak-accent);
    outline-offset: 3px;
}

/* Custom: the colour picked, with a plus. */
.dm-landing-app .dm-swatch--custom::after {
    content: "+";
    position: absolute;
    right: -0.2rem;
    bottom: -0.25rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: var(--ak-panel, #ffffff);
    color: var(--ak-text);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 0.9rem;
    text-align: center;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ak-text) 25%, transparent);
}

/* Transparent: a checkerboard. */
.dm-landing-app .dm-swatch--transparent {
    background: repeating-conic-gradient(#d4d7dc 0 25%, #ffffff 0 50%) 50% / 0.7rem 0.7rem;
}

.dm-landing-app .dm-color-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dm-landing-app .dm-color-row[hidden] {
    display: none;
}

.dm-landing-app .dm-color-input {
    width: 2.75rem;
    height: 1.9rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--ak-text) 25%, transparent);
    border-radius: var(--ak-radius-sm, 6px);
    background: transparent;
    cursor: pointer;
}

.dm-landing-app .dm-seg {
    flex-wrap: wrap;
}

.dm-landing-app .dm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
