/*--------------------------------------------------------------
    # Search (panel + /search page)
--------------------------------------------------------------*/
.ts {
    --ts-text: #262626;
    --ts-muted: #737373;
    --ts-border: #dbdbdb;
    --ts-field: #efefef;
    --ts-hover: #f5f5f5;
    --ts-accent: #0095f6;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    color: var(--ts-text);
    font-size: .9rem;
    line-height: 1.3;
}

/* Slide-out panel */
.ts-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    visibility: hidden;
    opacity: 0;
    transform: translateY(.75rem);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}

.ts-open .ts-panel {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
}

.ts-backdrop {
    display: none;
}

@media (min-width: 768px) {
    .ts-panel {
        z-index: 1035;
        width: 24rem;
        max-width: calc(100vw - 3.5rem);
        border-right: 1px solid var(--ts-border, #dbdbdb);
        border-radius: 0 1rem 1rem 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .08);
        transform: translateX(-1rem);
    }

    /* Open beside the admin sidebar: 3.5rem rail, widening to 12rem from 1200px */
    .ts-panel--admin {
        left: 3.5rem;
    }

    .ts-open .ts-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1034;
        display: block;
    }
}

@media (min-width: 1200px) {
    .ts-panel--admin {
        left: 12rem;
        max-width: calc(100vw - 12rem);
    }
}

@media (max-width: 767.98px) {
    .ts-open body {
        overflow: hidden;
    }
}

.ts-head {
    flex: 0 0 auto;
    padding: 1.25rem 1rem .5rem;
}

.ts--page .ts-head {
    padding: 0 0 .5rem;
}

.ts-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ts-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.ts--page .ts-title {
    font-size: 1.75rem;
}

.ts-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ts-text);
    font-size: 1.25rem;
}

    .ts-close:hover {
        background: var(--ts-hover);
    }

/* Field */
.ts-field {
    position: relative;
    display: flex;
    align-items: center;
}

.ts-field-icon {
    position: absolute;
    left: .9rem;
    color: var(--ts-muted);
    pointer-events: none;
}

.ts-input {
    width: 100%;
    height: 2.5rem;
    padding: 0 2.5rem;
    border: 1px solid transparent;
    border-radius: .6rem;
    background: var(--ts-field);
    color: var(--ts-text);
    font-size: 1rem; /* 16px keeps iOS from zooming the page on focus */
    -webkit-appearance: none;
    appearance: none;
}

    .ts-input::placeholder {
        color: var(--ts-muted);
    }

    .ts-input:focus {
        outline: none;
        border-color: var(--ts-border);
        background: #fff;
    }

    .ts-input::-webkit-search-cancel-button,
    .ts-input::-webkit-search-decoration {
        -webkit-appearance: none;
        display: none;
    }

.ts-clear {
    position: absolute;
    right: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ts-muted);
}

    .ts-clear:hover {
        color: var(--ts-text);
    }

    .ts-clear[hidden],
    .ts-spinner[hidden] {
        display: none;
    }

.ts-spinner {
    position: absolute;
    right: 2.4rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--ts-border);
    border-top-color: var(--ts-muted);
    border-radius: 50%;
    animation: ts-spin .7s linear infinite;
}

@keyframes ts-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tabs */
.ts-tabs {
    display: flex;
    gap: 1.5rem;
    margin-top: .75rem;
    border-bottom: 1px solid var(--ts-border);
}

    .ts-tabs[hidden] {
        display: none;
    }

.ts-tab {
    margin-bottom: -1px;
    padding: .5rem 0;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: var(--ts-muted);
    font-weight: 600;
}

    .ts-tab[aria-selected="true"] {
        border-bottom-color: var(--ts-text);
        color: var(--ts-text);
    }

/* Results */
.ts-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 1rem;
}

.ts--page .ts-body {
    overflow: visible;
}

.ts-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 1rem 1rem .35rem;
    font-weight: 600;
}

.ts--page .ts-section-head,
.ts--page .ts-row {
    padding-left: .25rem;
    padding-right: .25rem;
}

.ts-link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ts-accent);
    font-size: .85rem;
    font-weight: 600;
}

    .ts-link-btn:hover {
        color: #00376b;
    }

.ts-item {
    position: relative;
    display: flex;
    align-items: center;
}

.ts-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: .5rem 1rem;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
    text-decoration: none;
}

    .ts-row:hover,
    .ts-row:focus-visible {
        background: var(--ts-hover);
        color: inherit;
        outline: none;
    }

    .ts-row:focus-visible {
        box-shadow: inset 0 0 0 2px var(--ts-accent);
    }

/* Shown from the tap until the next page arrives */
.ts-row.is-navigating {
    background: var(--ts-hover);
    pointer-events: none;
}

    .ts-row.is-navigating::after {
        content: "";
        flex: 0 0 auto;
        width: 1rem;
        height: 1rem;
        border: 2px solid var(--ts-border);
        border-top-color: var(--ts-muted);
        border-radius: 50%;
        animation: ts-spin .7s linear infinite;
    }

.ts-avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 1px solid #efefef;
    border-radius: 50%;
    background: var(--ts-field);
    object-fit: cover;
}

.ts-avatar--initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.ts-avatar--square {
    border-radius: .5rem;
}

.ts-avatar--icon {
    color: var(--ts-muted);
    font-size: 1.1rem;
}

.ts-row-text {
    flex: 1 1 auto;
    min-width: 0;
}

.ts-row-name {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-weight: 600;
}

    .ts-row-name > span:first-child {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.ts-row-sub {
    overflow: hidden;
    color: var(--ts-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ts-verified {
    flex: 0 0 auto;
    color: var(--ts-accent);
    font-size: .75rem;
}

.ts-badge {
    flex: 0 0 auto;
    padding: .1rem .5rem;
    border: 1px solid var(--ts-border);
    border-radius: 999px;
    color: var(--ts-muted);
    font-size: .7rem;
    font-weight: 600;
}

.ts-remove {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-right: .5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ts-muted);
}

    .ts-remove:hover {
        background: var(--ts-hover);
        color: var(--ts-text);
    }

.ts-footer-link {
    display: block;
    padding: .75rem 1rem;
    color: var(--ts-accent);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

    .ts-footer-link:hover {
        color: #00376b;
    }

.ts-empty {
    padding: 2.5rem 1rem;
    color: var(--ts-muted);
    text-align: center;
}

.ts-empty strong {
    display: block;
    margin-bottom: .25rem;
    color: var(--ts-text);
    font-size: 1rem;
}

/* Loading placeholders */
.ts-skeleton {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1rem;
}

.ts-skeleton-avatar,
.ts-skeleton-line {
    background: linear-gradient(90deg, #efefef 25%, #f7f7f7 50%, #efefef 75%);
    background-size: 200% 100%;
    animation: ts-shimmer 1.4s linear infinite;
}

.ts-skeleton-avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.ts-skeleton-lines {
    flex: 1 1 auto;
}

.ts-skeleton-line {
    height: .7rem;
    margin: .3rem 0;
    border-radius: .35rem;
}

    .ts-skeleton-line:first-child {
        width: 40%;
    }

    .ts-skeleton-line:last-child {
        width: 65%;
    }

@keyframes ts-shimmer {
    to {
        background-position: -200% 0;
    }
}

/* Entry points */
.ts-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #262626;
    font-size: 1.1rem;
}

    .ts-nav-btn:hover {
        background: #f3f4f6;
        color: #000;
    }

/* Phone header: the logo, search, both buttons and the menu toggle must share one row */
.ts-nav-btn--compact {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
}

button.admin-nav-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.ts-open .admin-nav-link.ts-open-link {
    background-color: rgba(0, 149, 246, .1);
    color: #0077c8;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .ts-panel {
        transition: none;
    }

    .ts-skeleton-avatar,
    .ts-skeleton-line,
    .ts-spinner,
    .ts-row.is-navigating::after {
        animation: none;
    }
}
