.nihao-device-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(0, 41, 51, 0.28);
}
.nihao-device-card {
    width: min(440px, 100%);
    max-height: min(92dvh, 760px);
    overflow: auto;
    padding: 18px 18px 16px;
    border: 1px solid #d5efe9;
    border-radius: 16px;
    background: #fff;
    color: #14343a;
    text-align: left;
    box-shadow: 0 18px 40px -28px rgba(0, 41, 51, 0.45);
}
.nihao-device-kicker {
    margin: 0 0 4px;
    color: #1f6f64;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.nihao-device-card h2 {
    margin: 0 0 6px;
    color: #14343a;
    font-size: 1.15rem;
    line-height: 1.35;
}
.nihao-device-lead,
.nihao-device-prompt,
.nihao-device-status,
.nihao-device-tip,
.nihao-device-save {
    margin: 0;
    color: #4f6970;
    font-size: 0.86rem;
    line-height: 1.5;
}
.nihao-device-prompt {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f3fbf9;
    color: #155e63;
}
.nihao-device-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 14px 0 12px;
}
.nihao-device-steps span {
    min-width: 0;
    padding: 6px 0;
    border-bottom: 2px solid #e4f1ee;
    color: #7a9094;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}
.nihao-device-steps span.is-on { border-color: #0f766e; color: #0f766e; }
.nihao-device-steps span.is-done { border-color: #83d7ca; color: #1f6f64; }
.nihao-device-preview {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin: 0 0 10px;
    border: 1px solid #d5efe9;
    border-radius: 12px;
    background: #f3fbf9;
    object-fit: cover;
}
.mic-meter {
    height: 8px;
    margin: 8px 0 0;
    overflow: hidden;
    border-radius: 999px;
    background: #e7f3f1;
}
.mic-meter span {
    display: block;
    width: 0;
    height: 100%;
    background: #83d7ca;
}
.nihao-device-status { margin-top: 10px; color: #14343a; font-weight: 800; }
.nihao-device-tip {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f7fcfb;
}
.nihao-device-actions,
.nihao-device-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}
.nihao-device-actions button,
.nihao-device-choice button,
.nihao-device-next {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #b7e4dc;
    border-radius: 999px;
    background: #fff;
    color: #155e63;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
}
.nihao-device-actions .is-primary,
.nihao-device-choice .is-yes {
    border-color: transparent;
    background: #83d7ca;
    color: #002933;
}
.nihao-device-next { width: 100%; margin-top: 10px; }
.nihao-device-actions button:only-child,
.nihao-device-choice button:only-child { grid-column: 1 / -1; }
.nihao-device-results { display: grid; gap: 6px; margin-top: 12px; }
.nihao-device-results p {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    color: #14343a;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
}
.nihao-device-results p b { flex: 0 0 3.2em; font-weight: 800; }
.nihao-device-save { margin-top: 8px; }
.calendar-lesson-actions > .device-check-launch,
.teacher-calendar-lesson-actions > .device-check-launch,
.teacher-trial-card-actions > .device-check-launch {
    width: auto;
    min-height: 28px;
    height: 28px;
    padding: 0 11px;
    border: 1px solid #b7e4dc;
    border-radius: 999px;
    background: #f3fbf9;
    color: #155e63;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
}
.nihao-recheck-bar {
    position: fixed;
    z-index: 160;
    left: 16px;
    right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: flex-start;
    pointer-events: none;
}
.nihao-recheck-bar[hidden] { display: none !important; }
.nihao-recheck-bar button {
    pointer-events: auto;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #b7e4dc;
    border-radius: 999px;
    background: #f3fbf9;
    color: #0f766e;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 24px -18px rgba(0, 41, 51, 0.45);
}
.device-check-admin {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #d7efe9;
    border-radius: 12px;
    background: #f3fbf9;
}
.device-check-admin-title,
.device-check-admin-note {
    margin: 0;
    color: #4f6970;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.35;
}
.device-check-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 0;
    color: #14343a;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.35;
}
.device-check-side .who { min-width: 2.2em; color: #0f766e; font-weight: 800; }
.device-check-side .is-miss { color: #7a9094; font-weight: 700; }
.device-check-side .is-mid { color: #1f6f64; }
.device-check-admin-note { color: #7a9094; font-weight: 700; }
body.nihao-classroom .nihao-device-modal { z-index: 2147483646; }
body.nihao-classroom .nihao-recheck-bar,
.teacher-recheck-slot .nihao-recheck-bar {
    position: static;
    z-index: auto;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
}
.teacher-recheck-slot {
    min-height: 0;
}
.teacher-recheck-slot:empty,
.teacher-recheck-slot .nihao-recheck-bar[hidden] {
    display: none;
}
body.nihao-sidebar .nihao-recheck-bar {
    left: calc(var(--nihao-side, 252px) + 16px);
    right: 16px;
    bottom: 16px;
    justify-content: flex-start;
}
#nihaoTopbarEnd .teacher-recheck-slot,
#nihaoTopbarEnd .nihao-recheck-bar {
    position: static;
    z-index: auto;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    display: flex;
    justify-content: flex-end;
    pointer-events: auto;
}
#nihaoTopbarEnd .teacher-recheck-slot:empty,
#nihaoTopbarEnd .nihao-recheck-bar[hidden] {
    display: none;
}
#nihaoTopbarEnd .nihao-recheck-bar button {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.78rem;
    box-shadow: none;
}
@media (min-width: 800px) {
    .nihao-device-modal { align-items: center; }
    .nihao-recheck-bar {
        right: auto;
        bottom: 16px;
        left: max(16px, calc(50% - 560px));
    }
    body.nihao-sidebar .nihao-recheck-bar {
        left: calc(var(--nihao-side, 252px) + 16px);
    }
}
@media (max-width: 600px) {
    .nihao-device-card { padding: 16px 14px 14px; }
    .nihao-device-actions,
    .nihao-device-choice { grid-template-columns: 1fr 1fr; }
}
