/* ── BASE TYPOGRAPHY & PAGE HEADERS ── */
body {
    font-family: 'Times New Roman', Times, serif;
    background: #fafafa;
}

.page-header {
    padding: 16px 50px 0;
}

.page-header p {
    font-size: xx-large;
    margin: 0;
}

.section-title {
    font-size: xx-large;
}

/* ── LAYOUT & PANELS ── */
.page-shell {
    max-width: 1560px;
    margin: 0 auto;
    padding: 10px 14px 18px;
}

.top-split {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 960px) {
    .top-split {
        grid-template-columns: 1fr;
    }
}

.col-flat {
    min-width: 0;
}

.panel {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px;
    margin: 0;
    min-width: 0;
}

.panel > p:first-child {
    margin-top: 0;
}

/* ── BOTTOM TAB STRIP ── */
.bottom-tabs-wrap {
    margin-top: 12px;
}

.bottom-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
    font-family: sans-serif;
}

.bottom-tab-btn {
    padding: 5px 12px;
    border: 1px solid #bbb;
    border-radius: 5px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.bottom-tab-btn:hover {
    background: #f0f4ff;
    border-color: #1565c0;
}

.bottom-tab-btn[aria-selected="true"] {
    background: #1565c0;
    color: #fff;
    border-color: #1565c0;
}

.bottom-tab-panel {
    padding-top: 10px;
}

.bottom-tab-panel[hidden] {
    display: none;
}

.explorer-todo {
    padding: 18px 8px;
    text-align: center;
    font-family: sans-serif;
    color: #555;
}

.explorer-todo-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a237e;
    margin: 0 0 4px;
}

.explorer-todo-sub {
    font-size: 13px;
    margin: 0;
}

/* ── HARDWARE ERROR BANNER ── */
#hardware-error-banner {
    display: none;
    background: #fdecea;
    color: #b71c1c;
    border-bottom: 2px solid #f44336;
    padding: 12px 50px;
    font-family: sans-serif;
    font-size: 15px;
    font-weight: bold;
}

/* ── POSITION CONFIRMATION MODAL ── */
#position-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#position-modal-overlay.active {
    display: flex;
}

#position-modal {
    background: #fff;
    border: 2px solid #1565C0;
    border-radius: 10px;
    padding: 28px 32px;
    max-width: 420px;
    width: 90%;
    font-family: sans-serif;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    text-align: center;
}

#position-modal .modal-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

#position-modal h3 {
    margin: 0 0 10px;
    color: #1a237e;
    font-size: 1.15em;
}

#position-modal p {
    color: #444;
    font-size: 0.95em;
    margin-bottom: 20px;
}

.modal-btn-yes {
    background: #1565C0;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 28px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
}

.modal-btn-yes:hover {
    background: #0D47A1;
}

.modal-btn-no {
    background: #eee;
    color: #333;
    border: 2px solid #bbb;
    border-radius: 6px;
    padding: 9px 28px;
    font-size: 14px;
    cursor: pointer;
}

.modal-btn-no:hover {
    background: #ddd;
}

/* ── ACCESS BADGE & CONTROL LOCK ── */
/* Floating pill, top center. Sits below the modal overlay (z-index 1000). */
#access-bar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 20px);
    padding: 5px 6px 5px 12px;
    background: #fff;
    border: 1px solid #d0d4dc;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
    font-family: sans-serif;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
}

#access-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
}

#access-status::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9aa0a6;
}

#access-bar.is-controlling #access-status::before { background: #2e9e4f; box-shadow: 0 0 0 3px rgba(46, 158, 79, 0.2); }
#access-bar.is-free #access-status::before        { background: #1565c0; }
#access-bar.is-blocked #access-status::before     { background: #d9822b; }

#access-bar button,
#access-bar input {
    font: inherit;
    border-radius: 999px;
    padding: 3px 12px;
}

#access-bar button {
    border: 1px solid #1565c0;
    background: #1565c0;
    color: #fff;
    cursor: pointer;
}

#access-bar button:disabled { opacity: 0.45; cursor: not-allowed; }
#access-bar #btn-release-control,
#access-bar #btn-logout { background: #fff; color: #1565c0; }

#access-bar input {
    width: 150px;
    border: 1px solid #c4c8d0;
    outline: none;
}

#access-bar input:focus { border-color: #1565c0; }

#login-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
#login-form[hidden], #access-bar button[hidden] { display: none; }

#access-message {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    background: #fdecea;
    color: #b71c1c;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

#access-message:empty { display: none; }

/* Room for the floating badge */
.page-shell { padding-top: 54px; }

@media (max-width: 600px) {
    #access-bar { flex-wrap: wrap; justify-content: center; border-radius: 18px; white-space: normal; }
    #access-bar input { width: 120px; }
}

/* Downloads and full-resolution views: shown only to logged-in users */
body[data-authed="0"] .login-only { display: none !important; }

.needs-control[inert] {
    opacity: 0.5;
    user-select: none;
}
