/* theme.css gives .topbar-nav a display, which beats the [hidden] default, so
   the signed-out state needs saying explicitly. */
.topbar-nav[hidden] { display: none !important; }

/* Member search, sitting in the topbar next to the greeting. Shrinkable rather
   than a fixed width: the topbar wraps when its items no longer fit, and a rigid
   search box pushes the nav onto a second row on a laptop. */
.topbar-brand { min-width: 0; }

/* Home only, so the shared chrome is untouched: with the brand shrinkable, the
   greeting would otherwise wrap to two lines before the search box gave up any
   width. The search is the thing that should shrink. */
.topbar-brand .brand-title { white-space: nowrap; }

.member-search {
    position: relative;
    flex: 0 1 190px;
    min-width: 110px;
}

.member-search[hidden] { display: none !important; }

.member-search-input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.82rem;
    font-family: inherit;
}

.member-search-input::placeholder { color: var(--text-muted); }
.member-search-input:focus { outline: none; border-color: var(--primary); }

.member-search-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 200;
    width: 270px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 4px;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.member-search-list[hidden] { display: none; }

.member-search-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text);
}

.member-search-item:hover,
.member-search-item.active {
    background: var(--surface-2);
    color: var(--primary);
}

/* Both halves truncate rather than widening the row: a long faction name would
   otherwise force the whole list to scroll sideways. The name gets what it
   needs first, since that is what is being matched against. */
.member-search-name,
.member-search-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-search-name { flex: 1 1 auto; min-width: 0; }

.member-search-meta {
    flex: 0 1 auto;
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.member-search-empty {
    padding: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.home-login {
    max-width: 560px;
    margin: 48px auto;
    text-align: center;
}

.home-login-title {
    margin: 0 0 6px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.home-login-lead {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.home-login-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.home-login-row .api-input { flex: 1 1 auto; }
.home-login-row button { flex: 0 0 auto; }

.home-keynote {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    text-align: left;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.home-keynote p { margin: 0 0 8px; }
.home-keynote p:first-child { color: var(--primary); text-align: center; }
.home-keynote strong { color: var(--primary); }
.home-keynote ul { margin: 0; padding-left: 20px; }
.home-keynote li { margin-bottom: 3px; }

.home-login-error {
    margin: 12px 0 0;
    padding: 8px 10px;
    border: 1px solid var(--status-hosp);
    border-radius: var(--radius-sm);
    color: #f0a49c;
    font-size: 0.78rem;
    text-align: left;
}

#result > * { margin-bottom: 16px; }

@media (max-width: 700px) {
    /* .topbar-brand goes full width here, so the search takes the room the
       greeting leaves rather than a fixed 190px it may not have. */
    .topbar-brand { flex-wrap: wrap; }
    .member-search { flex: 1 1 140px; min-width: 0; }
    .member-search-input { width: 100%; }
    /* Anchored to the right rather than the left: the box sits at the end of a
       full-width brand row, so a list wider than the input has to grow inwards
       or it runs off the screen and gives the page a sideways scroll. */
    .member-search-list {
        left: auto;
        right: 0;
        width: auto;
        min-width: 220px;
        max-width: 86vw;
    }
}

@media (max-width: 520px) {
    .home-login { margin: 24px auto; }
    .home-login-row { flex-wrap: wrap; }
    .home-login-row .api-input { flex: 1 1 100%; }
    .home-login-row button { width: 100%; }
}
