/* ================================================================
   FriendsByChance — people.css
   The People feature: The Map's People mode (map-people.js) — its left
   pane and a marker's card — and a person's Homes (people.js), in My
   Profile and in a ghost's view.  The person MARKER itself is the map
   engine's, in map.css.
   ================================================================ */

/* ── The Map: People mode's left pane ──────────────────────────────── */

.map-people {
    display:        flex;
    flex-direction: column;
    gap:            14px;
    padding:        12px;
}

/* Its search and its selection: the shared picker (people-select.css). */

/* One person alone (map-people.js ONE PERSON): who, and "Show everyone". */
.map-people-only {
    display:     flex;
    align-items: center;
    gap:         8px;
    margin:      6px 0;
    font-size:   0.85rem;
    color:       var(--color-text-secondary);
}
.map-people-only[hidden] { display: none; }
.map-people-only-words { flex: 1 1 auto; min-width: 0; }
.map-people-note {
    margin:    0;
    font-size: 0.8rem;
    color:     var(--color-text-secondary);
}

/* What each ring colour means. */
.map-people-legend {
    display:        flex;
    flex-direction: column;
    gap:            4px;
    padding-top:    10px;
    border-top:     1px solid var(--color-divider);
    font-size:      0.76rem;
    color:          var(--color-text-secondary);
}
.map-people-legend-item { display: flex; align-items: center; gap: 8px; }
.map-people-legend-ring {
    flex:          0 0 auto;
    width:         10px;
    height:        10px;
    border:        3px solid;
    border-radius: 50%;
    background:    #ececec;
}

/* Their journeys, under the picks: a world of journeys (map-journeys.js)
   in the pane, which scrolls as one — its tree does not scroll apart. */
.map-people-journeys {
    display:        flex;
    flex-direction: column;
    margin:         0 -12px;          /* the pane's own edge, as My journeys' parts */
    border-top:     1px solid var(--color-divider);
}
.map-people-journeys .map-mode-body {
    flex:       none;
    overflow-y: visible;
}

/* ── The Map: a person marker's card ──────────────────────────────── */

.map-person-card       { min-width: 160px; max-width: 240px; }
.map-person-card-head  { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.map-person-card-photo {
    width:         32px;
    height:        32px;
    border-radius: 50%;
    object-fit:    cover;
}
.map-person-card-name  { font-weight: 700; }
/* Them, further: Open in Contacts, or in the right pane — at the head's end. */
.map-person-card-go    { display: flex; gap: 4px; margin-left: auto; padding-left: 6px; }
.map-person-card-line  { font-size: 0.85rem; }
.map-person-card-sub   { font-size: 0.78rem; color: var(--color-text-muted); }

/* ── A pick opened (map-people.js): a person's overlay, a tag's ────── */

/* What the map says of a person, first in who they are (openProfile). */
.map-person-where {
    display:        flex;
    flex-direction: column;
    gap:            2px;
    margin:         12px 0 4px;
}
/* The LINE under the picture and names (map-people.js _rule): the head's
   end, as wide as what is written — in the colour of their journeys,
   pressed to change it (a hit area taller than the line); plain for a
   ghost or a tag. */
.map-pick-rule { margin: 0 0 12px; }
.map-pick-rule-line {
    display:    block;
    width:      100%;
    height:     4px;
    border-radius: 2px;
    background: var(--color-divider);
}
button.map-pick-rule-line {
    height:     18px;
    padding:    0;
    border:     0;
    background: transparent;
    cursor:     pointer;
    position:   relative;
}
button.map-pick-rule-line::before {
    content:       '';
    position:      absolute;
    left:          0;
    right:         0;
    top:           7px;
    height:        4px;
    border-radius: 2px;
    background:    var(--rule-colour, var(--color-divider));
}
button.map-pick-rule-line:hover::before { top: 6px; height: 6px; border-radius: 3px; }
button.map-pick-rule-line:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.map-person-colour-error { font-size: 0.8rem; color: var(--color-danger); }

/* A pick's CARD (a popover over the left pane, map-people.js): its bar
   held at the edge nearest the chip — on top, or at the foot when the
   card is above the chip — while its body scrolls. */
.fbc-popover.fbc-popover--span.map-pick-card {
    padding:  0;
    overflow: hidden;
    gap:      0;
}
.map-pick-card > * {
    display:        flex;
    flex-direction: column;
    flex:           1 1 auto;
    min-height:     0;
}
.map-pick-card .map-pick-bar {
    flex:    0 0 auto;
    margin:  0;
    padding: 10px 14px 8px;
}
.map-pick-card .map-pick-body {
    flex:       1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding:    4px 14px 12px;
}
.map-pick-card.fbc-popover--above .map-pick-bar  { order: 2; padding: 8px 14px 10px; }
.map-pick-card.fbc-popover--above .map-pick-body { padding: 12px 14px 4px; }

/* A tag's card: the bar, the tag, the line, and everyone it names, each
   with what the map says of them. */
.map-tag-people { display: flex; flex-direction: column; }
.map-tag-people-head {
    display:     flex;
    align-items: center;
    flex-wrap:   wrap;
    gap:         6px 10px;
    margin:      4px 0 12px;
}
.map-tag-people-count { font-size: 0.85rem; color: var(--color-text-secondary); }
.map-tag-people-list {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    margin:         0;
    padding:        0;
    list-style:     none;
}
.map-tag-person {
    display:     flex;
    align-items: center;
    flex-wrap:   wrap;
    gap:         4px 10px;
}
.map-tag-person-status,
.map-tag-people-none { font-size: 0.8rem; color: var(--color-text-muted); }

/* ── Homes (people.js), in My Profile and in a ghost's view ────────── */

.people-homes {
    margin-top:    24px;
    padding:       14px 16px;
    border:        1px solid var(--color-border);
    border-radius: 10px;
}
.people-homes-title { display: flex; align-items: center; gap: 6px; }   /* its look: .fbc-section-title (components/shared.css) */
.people-homes-hint { margin: 4px 0 10px; }
.people-homes-list {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    margin-bottom:  10px;
}
.people-homes-none,
.people-homes-error { margin: 0; font-size: 0.85rem; color: var(--color-text-muted); }
.people-homes-error { color: var(--color-danger); }

.people-home {
    display:       flex;
    flex-wrap:     wrap;
    align-items:   center;
    gap:           6px 10px;
    padding:       6px 0;
    border-bottom: 1px solid var(--color-border);
}
.people-home-name    { font-weight: 600; }
.people-home-chips   { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.people-home-actions { display: flex; gap: 2px; margin-left: auto; }
.people-home--past .people-home-name,
.people-home--past .people-home-chips { opacity: 0.6; }
.people-home-badge {
    padding:       1px 7px;
    border-radius: 999px;
    background:    var(--color-hover);
    font-size:     0.72rem;
    color:         var(--color-text-secondary);
}
.people-home-missing,
.people-home-any { font-size: 0.82rem; color: var(--color-text-muted); font-style: italic; }

/* A row being written: one field per line, the same rhythm throughout. */
.people-home-form {
    display:        flex;
    flex-direction: column;
    gap:            10px;
    padding:        10px 12px;
    border:         1px solid var(--color-border);
    border-radius:  8px;
    background:     var(--color-bg);
}
.people-home-field {
    display:     flex;
    flex-wrap:   wrap;
    align-items: center;
    gap:         8px;
}
.people-home-label {
    flex:        0 0 4.5em;
    font-size:   0.82rem;
    font-weight: 600;
    color:       var(--color-text-secondary);
}
.people-home-name-input { flex: 1; min-width: 10em; }
.people-home-slot       { display: inline-flex; min-width: 0; }
.people-home-form-actions { display: flex; gap: 8px; }
.people-home-banner:empty { display: none; }
