.lop-card {
    position: relative;
    background: #fff;
    border: 4px solid;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.lop-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.1rem;
}

.lop-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.1rem;
}

.lop-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.lop-rectangle {
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
}

.lop-status-text {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.lop-rectangle-sm {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.lop-fbi {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

.lop-meta {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.tomorrow-section {
    display: none;
    margin-top: 0.75rem;
}

body.show-tomorrow .tomorrow-section {
    display: block;
}

/* Agency selector — LOPs are agency-specific; a single dropdown over the agencies with regions. */
.lop-agency-select { max-width: 20rem; }

/* "Enable LOP tracking" empty state for an agency with no LOPs yet. */
.lop-enable { max-width: 36rem; margin: 0 auto; }

/* "This is my region" tick — top-left of an overview region card. Picks which region's LOP shows
   in the top-bar status strip. Becomes prominent when this region is the chosen one. */
.lop-myregion {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.18rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    background: var(--bs-secondary-bg);
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.lop-myregion:hover { opacity: 1; }
.lop-myregion-input { cursor: pointer; margin: 0; }
.lop-myregion:has(.lop-myregion-input:checked) {
    opacity: 1;
    color: var(--bs-body-color);
    background: var(--ft-accent-weak, var(--bs-tertiary-bg));
}

/* Full-screen launcher — small button overlaid top-right of an overview region card. Opens THIS
   region's card in the fullscreen wall/tablet overlay (ftLopSolo). */
.lop-fs-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 8px;
    color: var(--bs-secondary-color);
    background: var(--bs-secondary-bg);
    text-decoration: none;
    opacity: 0.65;
    transition: opacity 0.15s, background 0.15s;
}
.lop-fs-btn:hover {
    opacity: 1;
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
}

/* Focused single-region view (the tablet/wall layout): the region card is dominant; the State card
   rides alongside as small context and can be toggled off. Stacks on narrow screens. */
.lop-focus {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: center;
}
.lop-focus-main {
    flex: 1 1 26rem;
    min-width: 0;
    max-width: 46rem;
}
.lop-focus-aside {
    flex: 0 0 18rem;
    max-width: 22rem;
}
/* "Show State LOP" off → drop the focused-view aside AND the overview's State card. */
body.lop-hide-state .lop-focus-aside,
body.lop-hide-state .lop-overview-state { display: none; }

/* The focus card is larger (legible across a room); the mini state card is compact. The status word
   never wraps — "NOT EXPECTED" stays on one line so the coloured rectangle keeps its shape. */
.lop-card-focus { padding: 2.25rem 2rem; cursor: default; }
.lop-card-focus .lop-title { font-size: 2.25rem; }
.lop-card-focus .lop-status-text { font-size: 3.25rem; white-space: nowrap; }
.lop-card-focus .lop-rectangle { padding: 2.75rem 1rem; }

.lop-card-mini { padding: 1rem; cursor: default; }
.lop-card-mini .lop-title { font-size: 1.2rem; margin-bottom: 0.1rem; }
.lop-card-mini .lop-label { font-size: 0.75rem; margin-bottom: 0.6rem; }
.lop-card-mini .lop-rectangle { padding: 1rem 0.75rem; }
.lop-card-mini .lop-status-text { font-size: 1.6rem; }
.lop-card-mini .lop-fbi { font-size: 0.8rem; margin-top: 0.5rem; }

/* Modal LOP selector buttons */
.lop-btn {
    border: 3px solid transparent;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, opacity 0.15s;
    width: 100%;
    display: block;
    margin-bottom: 0.5rem;
}

.lop-btn:hover {
    opacity: 0.85;
}

.lop-btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.lop-btn-check:checked + .lop-btn {
    border-color: #212529;
    box-shadow: 0 0 0 2px #212529;
}

.lop-btn-sublabel {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.9;
}

/* NO CHANGE button */
.lop-nochange-btn {
    border: 3px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    text-align: center;
    width: 100%;
    display: block;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    color: #495057;
    transition: border-color 0.15s;
}

.lop-btn-check:checked + .lop-nochange-btn {
    border-color: #212529;
    box-shadow: 0 0 0 2px #212529;
    background: #e9ecef;
}

/* Staleness banner */
#staleness-banner {
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* Connectivity badge */
.connectivity-connected {
    color: #198754;
}

.connectivity-disconnected {
    color: #dc3545;
}

/* Region cards grid - make cards uniform height */
.lop-region-grid .col {
    display: flex;
}

.lop-region-grid .lop-card {
    flex: 1;
}

/* Dark mode overrides */
[data-bs-theme="dark"] .lop-card {
    background: var(--bs-body-bg);
}

[data-bs-theme="dark"] .lop-title,
[data-bs-theme="dark"] .lop-subtitle,
[data-bs-theme="dark"] .lop-label {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .lop-nochange-btn {
    background: #2b3035;
    border-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .lop-btn-check:checked + .lop-nochange-btn {
    background: #343a40;
    border-color: #f8f9fa;
    box-shadow: 0 0 0 2px #f8f9fa;
}

[data-bs-theme="dark"] .lop-btn-check:checked + .lop-btn {
    border-color: #f8f9fa;
    box-shadow: 0 0 0 2px #f8f9fa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lop-status-text {
        font-size: 1.75rem;
    }

    .lop-title {
        font-size: 1.35rem;
    }

    .lop-rectangle {
        padding: 1.25rem 0.75rem;
    }
}

/* ──────────────── Fullscreen single-region overlay ("solo" display) ────────────────
   The wall/tablet view: one region's card filling the screen. The overlay (#lop-solo) sits above
   all app chrome; opening it, keep-awake and (true) full screen are handled in lop-display.js. */
.lop-solo {
    position: fixed;
    inset: 0;
    z-index: 2000;                 /* above the top bar (1050) — covers all chrome */
    background: var(--bs-body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vmin, 3rem);
}
.lop-solo[hidden] { display: none; }
.lop-solo-cards { width: 100%; display: flex; justify-content: center; }

/* The change modal must sit above the overlay when opened from within it. */
body.lop-solo-open .modal { z-index: 2030; }
body.lop-solo-open .modal-backdrop { z-index: 2020; }

/* In the overlay the region card is the whole stage — the State LOP shows as a corner pill (below),
   not the side card. EVERY dimension below is in vmin so the card scales as ONE unit: the proportions
   (and the main page's nice rectangle ratio) are preserved at any screen size and the status word —
   which never wraps — always fits inside its rectangle. */
.lop-solo .lop-focus { align-items: center; justify-content: center; width: 100%; }
.lop-solo .lop-focus-main { flex: 0 0 auto; max-width: none; width: 78vmin; }
.lop-solo .lop-focus-aside { display: none; }
.lop-solo .lop-card-focus { width: 100%; padding: 4vmin; cursor: default; }
.lop-solo .lop-card-focus .lop-title { font-size: 4.6vmin; margin-bottom: 0.3vmin; }
.lop-solo .lop-card-focus .lop-subtitle { font-size: 2vmin; margin-bottom: 0.3vmin; }
.lop-solo .lop-card-focus .lop-label { font-size: 1.8vmin; margin-bottom: 2.6vmin; }
.lop-solo .lop-card-focus .lop-rectangle { padding: 6vmin 2vmin; }
.lop-solo .lop-card-focus .lop-status-text { font-size: 6.4vmin; white-space: nowrap; letter-spacing: 0.02em; }
.lop-solo .lop-card-focus .lop-fbi { font-size: 2.2vmin; margin-top: 2vmin; }
.lop-solo .lop-card-focus .lop-meta { font-size: 1.5vmin; margin-top: 1.4vmin; }

/* Overlay controls (full-screen + exit) — top-right. */
.lop-solo-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0.6rem;
    z-index: 2010;
    width: 44px;
    height: 44px;
    border: 0.5px solid var(--bs-border-color, #ced4da);
    border-radius: 0.5rem;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s;
}
.lop-solo-control:hover { opacity: 1; }
.lop-solo-exit { right: 0.6rem; }
.lop-solo-fs { right: 3.7rem; }
.lop-solo-control[hidden] { display: none; }

/* Today's State LOP pill — glanceable, bottom-right, only in the overlay and only when "Show State
   LOP" is on (body.lop-hide-state hides it). */
.lop-solo-state { display: none; }
.lop-solo .lop-solo-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 2010;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
body.lop-hide-state .lop-solo-state { display: none; }
.lop-solo-state-label { font-size: 0.8rem; font-weight: 700; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: 0.03em; }
.lop-solo-state-badge {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
}
