/*
 * Machine UI widget: hosts a live embed of a machine's own interface.
 *
 * The embed is a fixed-size kiosk document scaled to fit the slot (the widget
 * sets the transform), so this file only provides the clipping box, the scaled
 * stage, the interaction veil and the picker chrome.
 */

.fw-body--machine-ui {
    padding: 0;
    overflow: hidden;
}

.fw-mui {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--bg);
}

/* Fixed logical viewport; width/height and transform come from the widget. */
.fw-mui-stage {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
}

.fw-mui-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--bg);
}

/* Too small to hit controls accurately: the embed becomes a live preview.
   Presentation-layer mis-tap guard only — machine safety is enforced by Duet
   firmware, never here. */
.fw-mui--locked .fw-mui-stage {
    pointer-events: none;
}

.fw-mui-veil {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 55%, rgba(var(--panel-rgb), 0.75) 100%);
}

.fw-mui-veil[hidden] {
    display: none;
}

.fw-mui-veil-text {
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: rgba(var(--ink-rgb), 0.75);
    background: rgba(var(--panel-rgb), 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
}

.fw-mui-note {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    background: var(--bg-panel);
}

.fw-mui-note[hidden] {
    display: none;
}

.fw-mui-note-sub {
    font-size: var(--font-size-xs);
    color: var(--text-disabled);
}

/* Header chrome is outside .fw-body, so it has no query container: the width
   is capped with min() against the panel instead of a container query. */
.fw-mui-picker {
    max-width: min(180px, 45%);
    padding: 3px 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-body);
    font-family: inherit;
    font-size: var(--font-size-xs);
}

.fw-mui-picker:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 1px;
}

/* Native full screen: the widget owns the display, so drop the panel inset. */
.fw.fw-mui-fullscreen {
    border-radius: 0;
    border: none;
}
