/*----------------------------------------------------------------------------
  Copyright (C) 2021-2026 by RealiseMotion Limited. All rights reserved.
----------------------------------------------------------------------------*/

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--rm-page);
}

body.mu-locate-body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 0%, var(--rm-primary-soft), transparent 34rem),
        var(--rm-page) !important;
    color: var(--rm-text) !important;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.mu-locate-skip {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--rm-surface);
    color: var(--rm-text);
    font-size: .82rem;
    font-weight: 800;
    transform: translateY(-150%);
}

.mu-locate-skip:focus {
    transform: translateY(0);
}

.mu-locate-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    min-height: 100svh;
}

.mu-locate-header,
.mu-locate-footer {
    width: min(100% - 36px, 1120px);
    margin-inline: auto;
}

.mu-locate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 82px;
    padding-block: 14px;
}

.mu-locate-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--rm-text);
    text-decoration: none;
}

.mu-locate-brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 2px solid var(--rm-primary);
    border-radius: 50%;
    color: var(--rm-primary);
    font-size: .69rem;
    font-weight: 900;
    letter-spacing: .05em;
}

.mu-locate-brand-copy {
    display: grid;
    gap: 2px;
}

.mu-locate-brand-copy strong {
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: -.015em;
}

.mu-locate-brand-copy em {
    color: var(--rm-primary);
    font-style: normal;
}

.mu-locate-brand-copy small {
    color: var(--rm-text-secondary);
    font-size: .61rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mu-locate-header-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--rm-primary) 28%, var(--rm-border));
    border-radius: 999px;
    background: var(--rm-primary-soft);
    color: var(--rm-primary);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mu-locate-main {
    display: grid;
    width: 100%;
    padding: clamp(16px, 4vw, 48px) 18px 44px;
    place-items: center;
}

.mu-locate-card {
    width: min(100%, 720px);
    padding: clamp(22px, 4vw, 38px);
    border: 1px solid var(--rm-border);
    border-radius: 18px;
    background: var(--rm-surface);
    box-shadow: 0 24px 64px rgba(15, 23, 42, .11);
}

.mu-locate-card-heading {
    max-width: 620px;
}

.mu-locate-eyebrow,
.mu-locate-list-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--rm-primary);
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mu-locate-card h1,
.mu-locate-card h2,
.mu-locate-card p {
    margin-top: 0;
}

.mu-locate-card h1 {
    margin-bottom: 10px;
    color: var(--rm-text);
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    line-height: 1.12;
    letter-spacing: -.035em;
}

.mu-locate-card-heading > p {
    margin-bottom: 0;
    color: var(--rm-text-secondary);
    font-size: .92rem;
    line-height: 1.65;
}

.mu-locate-guidance {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 11px;
    margin: 24px 0 28px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--rm-primary) 22%, var(--rm-border));
    border-radius: 12px;
    background: var(--rm-primary-soft);
}

.mu-locate-guidance-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--rm-primary);
    color: var(--rm-on-primary);
    font-size: 1.1rem;
    font-weight: 900;
}

.mu-locate-guidance p {
    align-self: center;
    margin-bottom: 0;
    color: var(--rm-text-secondary);
    font-size: .77rem;
    line-height: 1.5;
}

.mu-locate-list-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.mu-locate-list-heading h2 {
    margin-bottom: 0;
    font-size: 1rem;
    letter-spacing: -.01em;
}

.mu-locate-list-kicker {
    margin-bottom: 3px;
    color: var(--rm-text-secondary);
    font-size: .57rem;
}

.mu-locate-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 2px;
    color: var(--rm-text-secondary);
    font-size: .67rem;
    font-weight: 750;
    white-space: nowrap;
}

.mu-locate-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rm-success);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--rm-success) 16%, transparent);
}

.mu-locate-device-list {
    display: grid;
    gap: 9px;
    min-height: 74px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mu-locate-device-item {
    margin: 0;
}

.mu-locate-device {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 72px;
    padding: 11px 14px;
    border: 1px solid var(--rm-border);
    border-radius: 12px;
    background: var(--rm-surface);
    color: var(--rm-text);
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.mu-locate-device:hover {
    border-color: var(--rm-primary);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    color: var(--rm-text);
    transform: translateY(-1px);
}

.mu-locate-device-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 10px;
    background: var(--rm-primary-soft);
    color: var(--rm-primary);
    font-size: 1.1rem;
    font-weight: 900;
}

.mu-locate-device-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.mu-locate-device-copy strong {
    overflow: hidden;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mu-locate-device-copy small {
    color: var(--rm-text-secondary);
    font-size: .66rem;
}

.mu-locate-device-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--rm-primary-soft);
    color: var(--rm-primary);
    font-size: .57rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.mu-locate-device-badge-possible {
    background: var(--rm-surface-muted);
    color: var(--rm-text-secondary);
}

.mu-locate-empty {
    display: grid;
    gap: 5px;
    min-height: 86px;
    place-content: center;
    padding: 18px;
    border: 1px dashed var(--rm-border-strong);
    border-radius: 12px;
    color: var(--rm-text-secondary);
    text-align: center;
}

.mu-locate-empty strong {
    color: var(--rm-text);
    font-size: .82rem;
}

.mu-locate-empty span {
    font-size: .69rem;
    line-height: 1.45;
}

.mu-locate-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 22px;
}

.mu-locate-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: .73rem;
    font-weight: 850;
    text-decoration: none;
}

.mu-locate-button-primary {
    border-color: var(--rm-primary);
    background: var(--rm-primary);
    color: var(--rm-on-primary);
}

.mu-locate-button-primary:hover {
    border-color: var(--rm-primary-hover);
    background: var(--rm-primary-hover);
    color: var(--rm-on-primary);
}

.mu-locate-button-secondary {
    border-color: var(--rm-border);
    background: var(--rm-surface);
    color: var(--rm-text);
}

.mu-locate-button-secondary:hover {
    border-color: var(--rm-primary);
    color: var(--rm-primary);
}

.mu-locate-privacy {
    margin: 16px 0 0 !important;
    color: var(--rm-text-secondary);
    font-size: .64rem;
    line-height: 1.5;
    text-align: center;
}

/* Compatibility styling for a server that still emits the pre-2026 rows. */
#ulLocalCameras > .EntryWidth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 68px;
    margin: 0 !important;
    padding: 12px 14px;
    border: 1px solid var(--rm-border);
    border-radius: 12px;
    background: var(--rm-surface);
    color: var(--rm-text);
}

#ulLocalCameras > .EntryWidth .MenuEntry {
    font-size: .78rem;
    font-weight: 750;
    line-height: 1.45;
}

.mu-locate-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0 24px;
    border-top: 1px solid var(--rm-border);
    color: var(--rm-text-secondary);
    font-size: .62rem;
}

.mu-locate-footer span:first-child {
    color: var(--rm-text);
    font-weight: 850;
}

@media (max-width: 620px) {
    .mu-locate-header,
    .mu-locate-footer {
        width: min(100% - 28px, 1120px);
    }

    .mu-locate-header-badge {
        display: none;
    }

    .mu-locate-main {
        align-items: start;
        padding: 10px 12px 28px;
    }

    .mu-locate-card {
        padding: 22px 17px;
        border-radius: 14px;
    }

    .mu-locate-list-heading {
        align-items: start;
        flex-direction: column;
        gap: 5px;
    }

    .mu-locate-device {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .mu-locate-device-badge {
        display: none;
    }

    .mu-locate-actions {
        grid-template-columns: 1fr;
    }

    .mu-locate-footer {
        align-items: center;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mu-locate-device {
        transition: none;
    }
}

/* Explicit selected-Camera feedback. Locate continues to use browser probing as
   the reachability boundary; these rules are presentation only. */
.mu-locate-selection {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    padding: 13px 14px;
    border: 1px solid color-mix(in srgb, var(--rm-primary) 42%, var(--rm-border));
    border-radius: 12px;
    background: var(--rm-primary-soft);
}

.mu-locate-selection[hidden] {
    display: none;
}

.mu-locate-selection-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: var(--rm-primary);
    color: var(--rm-on-primary);
    font-size: .9rem;
    font-weight: 900;
}

.mu-locate-selection-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.mu-locate-selection-copy strong {
    color: var(--rm-text);
    font-size: .8rem;
}

.mu-locate-selection-copy span {
    color: var(--rm-text-secondary);
    font-size: .69rem;
    line-height: 1.45;
}

.mu-locate-device-selected,
.mu-locate-device-selected:hover {
    border-color: var(--rm-primary);
    background: var(--rm-primary-soft);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--rm-primary) 18%, transparent),
        0 10px 24px rgba(15, 23, 42, .08);
    transform: none;
}

.mu-locate-selected-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 2px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--rm-primary);
    color: var(--rm-on-primary);
    font-size: .55rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.mu-locate-status[data-state="waiting"] i,
.mu-locate-status[data-state="selected"] i {
    background: var(--rm-warning);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--rm-warning) 16%, transparent);
}

.mu-locate-status[data-state="available"] i {
    background: var(--rm-success);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--rm-success) 16%, transparent);
}

@media (max-width: 620px) {
    .mu-locate-selection {
        grid-template-columns: 34px minmax(0, 1fr);
        padding: 12px;
    }

    .mu-locate-selection-icon {
        width: 32px;
        height: 32px;
    }
}
