/* ---------- KOFA relay: device list, header bar, PWA install gate ---------- */

.auth-card:has(.relay-devices) {
    max-width: 640px;
}

.relay-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.relay-device-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.relay-device {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--neutral-stroke-rest, #d1d1d1);
    border-radius: 8px;
}

.relay-device.offline {
    opacity: 0.7;
}

.relay-device-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.relay-device-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.relay-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9e9e9e;
}

.relay-device.online .relay-dot {
    background: #107c10;
}

.relay-device-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.relay-members {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--neutral-stroke-rest, #d1d1d1);
}

.relay-member {
    display: flex;
    align-items: center;
    gap: 10px;
}

.relay-member > span:first-child {
    flex: 1;
}

.relay-claim {
    margin-bottom: 12px;
}

/* Out-of-band e-stop: big, red, always reachable. */
.relay-estop {
    min-width: 64px;
    min-height: 36px;
    padding: 0 12px;
    border: 2px solid #8a0000;
    border-radius: 6px;
    background: #c50f1f;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.relay-estop:active {
    background: #8a0000;
}

.relay-estop:disabled {
    opacity: 0.4;
    cursor: default;
}

.relay-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.relay-bar .server-name {
    margin-right: 0;
}

.relay-latency {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.relay-bar-message {
    font-size: 0.8rem;
    color: #c50f1f;
    cursor: pointer;
}

.latency-good {
    color: #107c10;
}

.latency-fair {
    color: #bc4b09;
}

.latency-poor {
    color: #c50f1f;
}

.pwa-gate ol {
    padding-left: 20px;
}

@media (max-width: 600px) {
    .relay-bar .server-name {
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.relay-pairing-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
}
