.ls-phone {
    position: absolute;
    z-index: 10;
    width: 31cqi;
    aspect-ratio: 200 / 420;
    padding: 1.1cqi;
    background: #0d1117;
    border-radius: 5.5cqi;
    box-shadow: 0 4cqi 9cqi rgba(0, 0, 0, 0.3);
}

.ls-phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 4.4cqi;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--ls-text);
}

.ls-phone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1cqi;
    padding: 1.8cqi 2cqi;
    border-bottom: 1px solid var(--ls-border);
    flex-shrink: 0;
    opacity: 0; /* hidden while scanning; WAAPI/`.is-joined` shows it */
}

.ls-phone.is-joined .ls-phone-head {
    opacity: 1;
}

.ls-phone-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8cqi;
    white-space: nowrap;
}

.ls-phone-mark {
    width: 3cqi;
    height: 3cqi;
    flex-shrink: 0;
    display: block;
    transform: translateY(0.45cqi); /* sit a little lower, aligned with the wordmark baseline */
}

.ls-phone-name {
    font-size: 1.9cqi;
    font-weight: 700;
    color: var(--ls-text);
}

.ls-phone-brand-suffix {
    font-size: 1.7cqi;
    color: color-mix(in srgb, var(--ls-text) 55%, transparent);
}

/* camera viewfinder — fills the screen below the header; the QR slides in
   from the top of the phone as the phone rises */
.ls-phone-scan {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1622;
    opacity: 1;
}

.ls-scan-qr {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17cqi;
    height: 17cqi;
    padding: 1cqi;
    background: #fff;
    border-radius: 1cqi;
    transform: translate(-50%, -50%) translateY(-260%);
}

.ls-scan-qr svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ls-scan-frame {
    position: relative;
    width: 19cqi;
    height: 19cqi;
    z-index: 2;
}

.ls-scan-corner {
    position: absolute;
    width: 3.6cqi;
    height: 3.6cqi;
    border: 0.6cqi solid #fff;
}

.ls-scan-corner.ls-tl { top: 0; left: 0; border-right: none; border-bottom: none; border-top-left-radius: 1cqi; }
.ls-scan-corner.ls-tr { top: 0; right: 0; border-left: none; border-bottom: none; border-top-right-radius: 1cqi; }
.ls-scan-corner.ls-bl { bottom: 0; left: 0; border-right: none; border-top: none; border-bottom-left-radius: 1cqi; }
.ls-scan-corner.ls-br { bottom: 0; right: 0; border-left: none; border-top: none; border-bottom-right-radius: 1cqi; }

.ls-scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    height: 0.5cqi;
    border-radius: 1cqi;
    background: linear-gradient(90deg, transparent, var(--ls-primary), transparent);
    box-shadow: 0 0 2cqi var(--ls-primary);
    animation: ls-scan-sweep 1.3s ease-in-out infinite;
}

@keyframes ls-scan-sweep {
    0%   { top: 0; opacity: 0.3; }
    50%  { top: calc(100% - 0.5cqi); opacity: 1; }
    100% { top: 0; opacity: 0.3; }
}

/* join screen (revealed after scan) — start-aligned, small text */
.ls-phone-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1.6cqi;
    padding: 2.4cqi;
    text-align: start;
    opacity: 0;
}

.ls-phone.is-joined .ls-phone-scan { opacity: 0; pointer-events: none; }
.ls-phone.is-joined .ls-phone-body { opacity: 1; }

.ls-phone-title {
    margin: 0 0 0.4cqi;
    font-size: 2.2cqi;
    font-weight: 600;
    color: var(--ls-text);
}

.ls-phone-line {
    display: flex;
    align-items: center;
    gap: 1.2cqi;
    font-size: 1.45cqi;
    color: var(--ls-text);
}

.ls-phone-line svg {
    width: 2cqi;
    height: 2cqi;
    flex-shrink: 0;
    color: color-mix(in srgb, var(--ls-text) 55%, transparent);
}

.ls-phone-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1cqi;
}

.ls-phone-label {
    font-size: 1.4cqi;
    color: var(--ls-text);
}

.ls-phone-select {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1cqi;
    padding: 1.4cqi 1.8cqi;
    border: 1px solid var(--ls-border);
    border-radius: 999px;
    font-size: 1.55cqi;
    color: var(--ls-text);
    background: var(--ls-bg);
    transition: border-color 0.2s ease;
}

.ls-phone-select.is-open {
    border-color: color-mix(in srgb, var(--ls-primary) 55%, transparent);
}

.ls-phone-caret {
    width: 1.6cqi;
    height: 1.6cqi;
    color: color-mix(in srgb, var(--ls-text) 55%, transparent);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.ls-phone-select.is-open .ls-phone-caret { transform: rotate(180deg); }

/* menu (list) — mirrors maestra-captioner AppMenu: el1 bg, tinted border, large
   radius, soft shadow, padded, gap between pill items */
.ls-phone-menu {
    position: absolute;
    top: calc(100% + 0.8cqi);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4cqi;
    background: var(--ls-el1);
    border: 1px solid color-mix(in srgb, var(--ls-primary) 15%, #fff);
    border-radius: 2.4cqi;
    box-shadow: 0 1cqi 3cqi rgba(0, 0, 0, 0.13);
    padding: 0.8cqi;
    z-index: 5;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-1cqi);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ls-phone-select.is-open .ls-phone-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ls-phone-option {
    display: flex;
    align-items: center;
    gap: 0.8cqi;
    padding: 1cqi 1.6cqi;
    border-radius: 999px;
    font-size: 1.4cqi;
    font-weight: 500;
    color: var(--ls-text);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ls-phone-option-label {
    flex: 1;
    min-width: 0;
}

.ls-phone-check {
    width: 1.7cqi;
    height: 1.7cqi;
    margin-left: auto;
    color: var(--ls-primary);
    opacity: 0;
    flex-shrink: 0;
}

/* hover: subtle dark highlight + primary text (captioner --cHoverHighlight) */
.ls-phone-option[data-hover] {
    background: rgba(0, 0, 0, 0.04);
    color: var(--ls-primary);
}

/* active/selected: primary 10% bg, primary text, semibold, checkmark shown */
.ls-phone-option.is-current {
    background: color-mix(in srgb, var(--ls-primary) 10%, transparent);
    color: var(--ls-primary);
    font-weight: 600;
}

.ls-phone-option.is-current .ls-phone-check {
    opacity: 1;
}

.ls-phone-option.is-current[data-hover] {
    background: color-mix(in srgb, var(--ls-primary) 20%, transparent);
}

.ls-phone-join {
    margin-top: 0.6cqi;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1cqi;
    padding: 1.6cqi;
    border: none;
    border-radius: 999px;
    background: var(--ls-primary);
    color: var(--ls-on-primary);
    font: inherit;
    font-size: 1.6cqi;
    font-weight: 600;
    cursor: default;
    transition: transform 0.12s ease, filter 0.2s ease;
}

.ls-phone-join svg {
    width: 2.2cqi;
    height: 2.2cqi;
    flex-shrink: 0;
}

.ls-phone-join.is-pressed {
    transform: scale(0.96);
    filter: brightness(0.92);
}

/* disabled "Session not started" state (before the host starts the session) */
.ls-phone-join.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ---------------- Live caption state (ongoing-session main phone) ---------------- */
.ls-phone-caption {
    position: absolute;
    left: 0;
    right: 0;
    top: 6.6cqi;
    bottom: 0;
    padding: 2.6cqi;
    /* block so the revealed word <span>s wrap (a flex container would lay them
       out in a single non-wrapping row) and stack from the top (start-aligned) */
    display: block;
    overflow: hidden;
    font-size: 2cqi;
    line-height: 1.45;
    color: var(--ls-text);
    text-align: start;
    opacity: 0;
    pointer-events: none;
}

.ls-phone.is-caption .ls-phone-caption {
    opacity: 1;
}

.ls-phone.is-caption .ls-phone-body {
    opacity: 0;
    pointer-events: none;
}

.ls-phone-caption .word {
    opacity: 0;
}

.ls-phone-caption.is-revealed .word {
    opacity: 1;
}
