/* The results bar above a search result: "N results", how long it took, when
   it ran, "Download" and "Add to project". One look for the unified search
   (.tfl-export, js/tf-lookup.js) and the email / username / phone pages
   (#introduction, filled by js/email.js, username.js and phone.html).

   The selectors start with an id (through :is) so they win over the older
   per-page rules (css/results.css, css/tf-export.css, the copy in email.html's
   <style>, Tailwind's border-vivrant-red / bg-white on #introduction). */

:is(#introduction, .tfl-export) {
    --rb-accent: #cf362d;
    --rb-accent-hover: #e0473d;
    --rb-accent-text: #e5564b;
    --rb-border: rgba(255, 255, 255, 0.08);
    --rb-border-strong: rgba(255, 255, 255, 0.16);
    --rb-fg: #f4f4f5;
    --rb-muted: #a1a1aa;
    padding: 12px 12px 12px 18px !important;
    border: 1px solid var(--rb-border) !important;
    border-radius: 14px !important;
    background: #0b0b0d !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 30px rgba(0, 0, 0, 0.35);
    align-items: center;
    column-gap: 16px;
    row-gap: 12px !important;
}

/* ------------------------------------------------------------------ count */
:is(#introduction #result_amount, .tfl-export .tfl-export-info) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--rb-fg);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.tfl-export .tfl-export-count {
    color: var(--rb-fg);
}
/* Status dot: the result is in. */
:is(#introduction #result_amount, .tfl-export .tfl-export-info)::before {
    content: '';
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-radius: 50%;
    background: var(--rb-accent-text);
    box-shadow: 0 0 0 3px rgba(207, 54, 45, 0.18);
}

/* Duration and date: quiet pills next to the count. */
:is(#introduction #time_amount123, #introduction #loadtime, .tfl-export .tfl-export-dim, .tfl-export .tfl-export-time) {
    display: inline-flex;
    align-items: center;
    height: 24px;
    margin: 0;
    padding: 0 9px;
    border: 1px solid var(--rb-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--rb-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
}

/* ---------------------------------------------------------------- buttons */
:is(#introduction, .tfl-export) .tf-dl-btn {
    height: 38px;
    padding: 0 15px;
    gap: 8px;
    border: 1px solid var(--rb-border-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--rb-fg);
    font-size: 13px;
    font-weight: 500;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}
:is(#introduction, .tfl-export) .tf-dl-btn i {
    color: var(--rb-muted);
}
:is(#introduction, .tfl-export) .tf-dl-btn:hover,
:is(#introduction, .tfl-export) .tf-dl-btn.open {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
}
:is(#introduction, .tfl-export) .tf-dl-btn:focus-visible {
    outline: 2px solid var(--rb-accent-text);
    outline-offset: 2px;
}

/* "Add to project" is the main next step: the red accent as an outline,
   with its picker caret joined on as a split button. */
:is(#introduction, .tfl-export) .tf-cl-group {
    gap: 2px;
}
:is(#introduction, .tfl-export) .tf-cl-group > .tf-dl-btn {
    border-color: rgba(207, 54, 45, 0.6);
    background: transparent;
    color: var(--rb-accent-text);
}
:is(#introduction, .tfl-export) .tf-cl-group > .tf-dl-btn i {
    color: var(--rb-accent-text);
}
:is(#introduction, .tfl-export) .tf-cl-group > .tf-dl-btn:hover,
:is(#introduction, .tfl-export) .tf-cl-group > .tf-dl-btn[aria-expanded='true'] {
    border-color: var(--rb-accent);
    background: rgba(207, 54, 45, 0.12);
}
:is(#introduction, .tfl-export) .tf-cl-group > .tf-dl-btn:not(.tf-cl-caret) {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}
:is(#introduction, .tfl-export) .tf-cl-group > .tf-cl-caret {
    padding: 0 11px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* ------------------------------------------------------------------- menu */
:is(#introduction, .tfl-export) .tf-dl-menu {
    min-width: 230px;
    border-color: var(--rb-border-strong);
    border-radius: 12px;
    background: #0c0c0e;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
:is(#introduction, .tfl-export) .tf-dl-item {
    border-radius: 8px;
}
:is(#introduction, .tfl-export) .tf-dl-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Phones: count on its own line, then full-width buttons. */
@media (max-width: 520px) {
    :is(#introduction, .tfl-export) {
        padding: 14px !important;
    }
    :is(#introduction, .tfl-export) .tf-dl-btn {
        height: 42px;
    }
    /* css/main.css lays the old count out as a two-column grid on phones;
       here it wraps like a sentence: dot, count, duration, then the date. */
    #introduction #result_amount {
        display: flex !important;
    }
}
