/* ─── Third-party machine view (js/modules/third-party-view.js) ─────────────
   Sits in the device viewer's frame (.device-viewer, toolbar) in place of the
   machine screen a Rapid Fusion machine opens. */

.third-party-view .tpv-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.tpv-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    max-width: 960px;
    width: 100%;
}

.tpv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.tpv-head-text {
    min-width: 0;
}

.tpv-facts {
    font-size: var(--font-size-md);
    color: var(--text-body);
}

.tpv-seen,
.tpv-muted {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.tpv-card p {
    margin: 0 0 var(--space-sm);
}

.tpv-card p:last-child {
    margin-bottom: 0;
}

.tpv-muted code {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-size-xs);
}

.tpv-title {
    margin: 0 0 var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.tpv-alarm {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.tpv-alarm:last-child {
    margin-bottom: 0;
}

.tpv-severity {
    margin-left: auto;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
}

.tpv-job-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-xs);
}

.tpv-job-name {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tpv-readings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-sm);
}

.tpv-reading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}

.tpv-reading-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.tpv-reading-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-size-lg);
    color: var(--text-strong);
}

@media (max-width: 600px) {
    .third-party-view .tpv-body {
        padding: var(--space-sm);
    }

    .tpv-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Repainted on every status change; Recent jobs sits after it, outside. */
.tpv-main {
    display: contents;
}
