/* Raro.Help ops view. Desk-first: a fixed list beside a full-bleed map,
   collapsing to a bottom sheet on a phone. Dark, because it sits over
   satellite imagery all day. */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #101214;
    color: #f2f4f7;
}

#map {
    position: absolute;
    inset: 0;
}

#panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    display: flex;
    flex-direction: column;
    background: rgba(20, 22, 26, 0.94);
    box-shadow: 2px 0 14px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

#panel-head {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #2a2e35;
}

#panel-head h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

#feed-status {
    margin-top: 3px;
    font-size: 12px;
    color: #8b93a0;
}

/* Never let a dead feed read as a fresh one. */
#feed-status.bad { color: #ff8a80; }

#share-list, #recent-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The live list takes the room it needs; history scrolls under it. */
#share-list { flex: 0 0 auto; }
#recent-list { overflow-y: auto; }

#recent-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#recent-body[hidden] { display: none; }

/* Collapsed by default — the live list is the job. */
#recent-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 11px 16px;
    border: none;
    border-top: 1px solid #2a2e35;
    border-bottom: 1px solid #23272e;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    color: #8b93a0;
    background: #16191e;
    cursor: pointer;
}

#recent-head:hover { color: #c3c9d2; }

#recent-caret { font-size: 10px; }

#recent-count {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 9px;
    background: #2a2e35;
    color: #c3c9d2;
    font-size: 11px;
}

#recent-count:empty { display: none; }

#recent-empty {
    margin: 0;
    padding: 14px 16px;
    font-size: 13px;
    color: #6f7783;
}

#recent-empty[hidden] { display: none; }

/* History: dimmer than anything live, so the eye goes to the live list. */
.share.ended { opacity: 0.72; }
.share.ended .code { font-size: 19px; color: #c3c9d2; }

.share {
    padding: 12px 16px 12px 20px;
    border-bottom: 1px solid #23272e;
    border-left: 4px solid transparent;
    cursor: pointer;
}

.share:hover { background: #1b1f25; }
.share.selected { background: #1f2937; border-left-color: #00ffff; }

.share .code {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
}

.share .meta {
    margin-top: 2px;
    font-size: 12px;
    color: #9aa2ad;
}

/* Contact state: how long since the last fix. */
.share.live .code { color: #7ee787; }
.share.hidden .code { color: #ffcc66; }
.share.quiet .code { color: #9aa2ad; }
.share.nofix .code { font-size: 17px; color: #ff8a80; }

#empty {
    margin: 0;
    padding: 20px 16px;
    font-size: 14px;
    color: #8b93a0;
}

#empty[hidden] { display: none; }

/* Map markers, coloured by the same contact bands as the list. */
.share-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #9aa2ad;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.share-dot.live { background: #2ecc71; }
.share-dot.hidden { background: #f1c40f; }
.share-dot.quiet { background: #9aa2ad; }
.share-dot.ended { background: #5b6270; border-color: #c3c9d2; }
.share-dot.selected { width: 24px; height: 24px; border-color: #00ffff; }

@media (max-width: 700px) {
    #panel {
        top: auto;
        right: 0;
        width: auto;
        max-height: 45%;
        box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.5);
    }
}
