.mmg-wrap {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
    transition: background-color .4s;
}

.mmg-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 18px;
    background: rgba(28,28,30,.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,.08);
    border-radius: 10px 10px 0 0;
}
.mmg-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mmg-control-group label {
    color: rgba(255,255,255,.6);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mmg-url-row { display: flex; gap: 6px; flex: 1; min-width: 260px; }
.mmg-url-input,
.mmg-device-url-input {
    flex: 1;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
    padding: 8px 12px;
    min-width: 0;
    box-sizing: border-box;
}
.mmg-url-input::placeholder,
.mmg-device-url-input::placeholder { color: rgba(255,255,255,.3); }
.mmg-btn {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    color: rgba(255,255,255,.9);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    outline: none;
    padding: 7px 13px;
    transition: background .15s;
    white-space: nowrap;
}
.mmg-btn:hover { background: rgba(255,255,255,.22); }
.mmg-btn.active { background: rgba(255,255,255,.9); border-color: transparent; color: #111; }
.mmg-btn-primary { background: #0a84ff; border-color: transparent; color: #fff; font-weight: 600; }
.mmg-bg-picker {
    width: 34px;
    height: 34px;
    border: 2px solid rgba(255,255,255,.2);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: transparent;
}

.mmg-device-views {
    padding: 14px 18px 10px;
    background: rgba(20,20,22,.94);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.mmg-device-views.mmg-hidden { display: none; }
.mmg-device-views-head {
    display:flex;
    flex-direction:column;
    gap:4px;
    color:#fff;
    margin-bottom:10px;
}
.mmg-device-views-head span,
.mmg-device-views-note {
    color: rgba(255,255,255,.62);
    font-size: 12px;
    margin: 0;
}
.mmg-device-view-row {
    display:grid;
    grid-template-columns: 82px 1fr auto;
    gap: 8px;
    align-items:center;
    margin-bottom:8px;
}
.mmg-device-view-row label {
    color:#fff;
    font-size:12px;
    font-weight:600;
}

.mmg-stage-outer {
    padding: 10px;
    box-sizing: border-box;
}
.mmg-stage {
    position: relative;
    width: 100%;
    padding-bottom: 58%;
    min-height: 300px;
    overflow: visible;
}

.mmg-device-wrap {
    position: absolute;
    cursor: grab;
    touch-action: none;
}

.mmg-device-inner {
    position: relative;
    width: 100%;
}

.mmg-device-wrap[data-device="ipad"] {
    aspect-ratio: 574 / 407;
}

.mmg-device-wrap:active { cursor: grabbing; }
.mmg-device-wrap.mmg-device-hidden { display: none; }

.mmg-device-frame {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
}

.mmg-screen {
    position: absolute;
    overflow: hidden;
    background: #f0f0f0;
}
.mmg-screen-content {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.mmg-live-viewport {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    background: #fff;
}
.mmg-live-viewport iframe,
.mmg-live-viewport img.mmg-shot {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}
.mmg-live-viewport img.mmg-shot {
    object-fit: fill;
}
.mmg-live-inline-frame {
    pointer-events: auto;
}
.mmg-screen:hover { outline: 2px solid rgba(10,132,255,.4); }
.mmg-screen[data-device="iphone"] { border-radius: 10%; }
.mmg-screen[data-device="iphone"] .mmg-screen-content,
.mmg-screen[data-device="iphone"] .mmg-live-viewport,
.mmg-screen[data-device="iphone"] iframe,
.mmg-screen[data-device="iphone"] img.mmg-shot { border-radius: 10%; }

.mmg-wrap.mmg-bg-transparent {
    background-color: transparent !important;
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.mmg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 300;
    color: #fff;
    font-size: 13px;
    border-radius: 0 0 10px 10px;
}
.mmg-overlay.mmg-hidden { display: none; }
.mmg-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mmg-spin .75s linear infinite;
}
@keyframes mmg-spin { to { transform: rotate(360deg); } }

.mmg-admin-tool-wrap .mmg-wrap { margin-top: 16px; }
.mmg-wrap { overflow: visible !important; box-sizing: border-box; }

@media (max-width: 860px){
    .mmg-device-view-row { grid-template-columns: 1fr; align-items: stretch; }
}

.mmg-screen iframe{pointer-events:auto;}
.mmg-device-wrap{overflow:visible;}
