/* Search results — the pieces both search surfaces draw: the typeahead row,
   the page card, highlights, brand badges, status pills, and the empty,
   loading and failure states. Rebuilt 2026-09-16 with search-results.js.

   Every colour is a theme-aware token, so light and dark come from base.css.
   Gold is chrome here (the highlight, the focus ring); brand identity is the
   brand badge, which carries its initials and a tooltip, never colour alone. */

/* ===== highlight ===== */
.gs-hl { background: transparent; color: inherit; font-weight: var(--fw-bold); padding: 0; text-decoration: underline;
         text-decoration-color: var(--accent-line); text-decoration-thickness: 2px; text-underline-offset: 2px; }

/* ===== the lead icon ===== */
.gs-lead {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--r-sm);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--inset); color: var(--text-soft); font-size: var(--fs-lg);
}
.gs-lead.is-business { background: var(--accent-weak); color: var(--accent-ink); }
.gs-lead.is-person { border-radius: var(--r-circle); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .02em; }
.gs-lead.is-hist { background: transparent; color: var(--text-dim); }

/* ===== small pieces ===== */
.gs-brands { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.gs-brands .bbadge { transform: scale(.86); transform-origin: center; }
.gs-dot { color: var(--text-dim); margin: 0 .35rem; }
.gs-soft { color: var(--text-dim); }
.gs-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; font-weight: var(--fw-medium); }
.gs-pill {
    display: inline-flex; align-items: center; padding: .08rem .5rem; border-radius: var(--r-pill);
    font-size: var(--fs-2xs); font-weight: var(--fw-medium); line-height: var(--lh-snug); white-space: nowrap;
    background: var(--inset); color: var(--text-soft); border: 1px solid var(--border-soft);
}
.gs-pill.is-ok   { background: var(--ok-weak);   color: var(--ok-ink);   border-color: var(--ok-line); }
.gs-pill.is-warn { background: var(--warn-weak); color: var(--warn-ink); border-color: var(--warn-line); }
.gs-pill.is-bad  { background: var(--bad-weak);  color: var(--bad-ink);  border-color: var(--bad-line); }
.gs-pill.is-dim  { background: transparent;      color: var(--text-soft); border-color: var(--border); }
.gs-btn {
    display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: var(--r-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
    font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.gs-btn:hover:not([disabled]) { border-color: var(--accent-line); background: var(--surface-2); }
.gs-btn[disabled] { opacity: .45; cursor: default; }
.gs-btn:focus-visible, .gs-link:focus-visible, .gs-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gs-link { background: none; border: 0; padding: 0; color: var(--accent-ink); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; }
.gs-link:hover { text-decoration: underline; }

/* ===== the typeahead row ===== */
.gs-row {
    display: flex; align-items: center; gap: var(--sp-4); width: 100%;
    padding: var(--sp-3) var(--sp-5); color: var(--text); text-decoration: none; cursor: pointer;
    border-left: 3px solid transparent; min-width: 0;
}
.gs-row:hover { background: var(--surface-2); color: var(--text); }
.gs-row.is-active { background: var(--accent-weak); border-left-color: var(--accent); }
.gs-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gs-row-top { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.gs-row-t { font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: var(--lh-snug); min-width: 0;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-row-m { font-size: var(--fs-xs); color: var(--text-soft); line-height: var(--lh-snug); min-width: 0;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-row-end { flex: 0 0 auto; display: flex; align-items: center; gap: var(--sp-2); }
.gs-via { display: flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); color: var(--text-soft); min-width: 0;
          overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gs-via .bbadge { transform: scale(.8); }
.gs-via b { font-weight: var(--fw-medium); color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.gs-x {
    flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: var(--r-circle); background: transparent;
    color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.gs-x:hover { background: var(--inset); color: var(--text); }

/* ===== the page card ===== */
/* Three regions laid out by the width of the RESULT LIST, not the window
   (.gs-list is the container, search.css): identity | matched records | aside.
   It was one column hugging the left edge of a 2,000px card. Narrow, the
   regions stack under the name. A card with no records gives the identity the
   records track too, so a person or a product never leaves a hole. */
.gs-card {
    display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "lead id" ". recs" ". aside";
    column-gap: var(--sp-5); row-gap: var(--sp-3); padding: var(--sp-5) var(--sp-6);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--shadow); min-width: 0;
    transition: border-color .15s ease, box-shadow .15s ease;
    animation: gsIn .26s var(--ease-out) backwards;
}
.gs-card:not(.has-recs) { grid-template-areas: "lead id" ". aside"; }
.gs-card + .gs-card { margin-top: var(--sp-3); }
.gs-card:hover { border-color: var(--accent-line); box-shadow: var(--lift-1, var(--shadow)); }
.gs-card > .gs-lead { grid-area: lead; align-self: start; }
.gs-card.is-business .gs-lead { width: 40px; height: 40px; font-size: var(--fs-xl); }
.gs-card-id { grid-area: id; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.gs-card-recs { grid-area: recs; min-width: 0; padding-top: var(--sp-3); border-top: 1px dashed var(--border); }
.gs-card-aside { grid-area: aside; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-6); }
.gs-card-aside:empty { display: none; }
.gs-card-top { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.gs-card-t {
    font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text); line-height: var(--lh-snug);
    text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.gs-card-t:hover { color: var(--accent-ink); text-decoration: underline; }
a.gs-card-t:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.gs-card-end { display: flex; align-items: center; gap: var(--sp-2); flex: 0 0 auto; }
.gs-card-m { font-size: var(--fs-sm); color: var(--text-soft); line-height: var(--lh-snug); }
.gs-kind { color: var(--text); font-weight: var(--fw-medium); }
.gs-facts { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-7); margin: 0; min-width: 0; }
.gs-fact { display: flex; flex-direction: column; min-width: 0; }
.gs-fact dt { font-weight: var(--fw-normal); font-size: var(--fs-2xs); color: var(--text-dim); line-height: var(--lh-snug); }
.gs-fact dd { margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); line-height: var(--lh-snug);
              max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gs-fact a { color: var(--accent-ink); }
.gs-na { color: var(--text-dim); font-weight: var(--fw-normal); }
.gs-recs-h { font-size: var(--fs-2xs); font-weight: var(--fw-normal); color: var(--text-dim); margin-bottom: var(--sp-1); }
.gs-recs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
/* WRAPS, never pushes: on a phone a long Zoho id and a status pill beside the
   name squeezed the name to nothing and ran the pill past the screen edge. */
.gs-recs li { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--sp-3); row-gap: 1px; font-size: var(--fs-sm); min-width: 0; }
.gs-recs .bbadge { transform: scale(.82); flex: 0 0 auto; }
.gs-rec-t { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-rec-id { color: var(--text-soft); font-size: var(--fs-xs); white-space: nowrap; }
.gs-recs-more { color: var(--text-soft); font-size: var(--fs-xs); padding-left: 2px; }
.gs-why { display: flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); color: var(--text-soft); }
.gs-why .bi { color: var(--accent); }

/* A row: identity | aside, records under the identity. The aside is a fixed
   column so status pills and figures line up down the whole list. */
@container gslist (min-width: 760px) {
    .gs-card, .gs-card:not(.has-recs) {
        grid-template-columns: 40px minmax(0, 1fr) 320px;
        grid-template-areas: "lead id aside" ". recs aside";
        align-items: start;
    }
    .gs-card:not(.has-recs) { grid-template-areas: "lead id aside"; }
    .gs-card-aside { flex-direction: column; flex-wrap: nowrap; align-items: flex-end; text-align: right; gap: var(--sp-3); }
    /* One equal slot per figure, in a fixed-width column: the figures line
       up down the list like a table instead of wrapping per card. */
    .gs-facts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: var(--sp-5); width: 100%; }
    .gs-fact { align-items: flex-end; }
    /* An email is the one long figure: it takes most of a person's column. */
    .gs-card.is-person .gs-facts { grid-template-columns: minmax(0, 1fr) auto; }
}
/* Wide: the matched records take their own column between the two. */
@container gslist (min-width: 1150px) {
    .gs-card, .gs-card:not(.has-recs) { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 340px; grid-template-areas: "lead id id aside"; }
    .gs-card.has-recs { grid-template-areas: "lead id recs aside"; }
    .gs-card-recs { padding-top: 0; border-top: 0; padding-left: var(--sp-6); border-left: 1px dashed var(--border); }
}
@keyframes gsIn { from { opacity: 0; transform: translateY(4px); } }

/* ===== skeleton ===== */
.gs-sk { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-2) 0; }
.gs-sk.is-compact { padding: var(--sp-3) var(--sp-5); }
.gs-sk-row { display: flex; align-items: center; gap: var(--sp-4); }
.gs-sk:not(.is-compact) .gs-sk-row { padding: var(--sp-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.gs-sk-a { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--inset); flex: 0 0 auto; }
.gs-sk-b { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.gs-sk-b i { display: block; height: 10px; border-radius: 5px; background: var(--inset); }
.gs-sk-b i:first-child { width: 46%; }
.gs-sk-b i:last-child { width: 28%; }
.gs-sk-a, .gs-sk-b i { animation: gsPulse 1.1s ease-in-out infinite alternate; }
@keyframes gsPulse { from { opacity: 1; } to { opacity: .55; } }

/* ===== empty and failed ===== */
.gs-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2);
    padding: var(--sp-9) var(--sp-7); color: var(--text-soft);
}
.gs-empty.is-compact { padding: var(--sp-7) var(--sp-6); }
.gs-empty > .bi { font-size: var(--fs-3xl); color: var(--text-dim); }
.gs-empty.is-error > .bi { color: var(--bad); }
.gs-empty b { font-size: var(--fs-lg); color: var(--text); }
.gs-empty span { max-width: 44ch; font-size: var(--fs-sm); line-height: var(--lh-normal); }
.gs-empty .gs-btn { margin-top: var(--sp-3); }

/* ===== tips ===== */
.gs-tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); }
.gs-tip { display: flex; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--border-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.gs-tip > .bi { color: var(--accent); font-size: var(--fs-lg); flex: 0 0 auto; }
.gs-tip span { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--text-soft); line-height: var(--lh-normal); }
.gs-tip b { color: var(--text); font-weight: var(--fw-medium); }

@media (prefers-reduced-motion: reduce) {
    .gs-card { animation: none; }
    .gs-sk-a, .gs-sk-b i { animation: none; }
}

/* ==================== THE HOME VOICE (2026-09-17) ==========================
   Global Search set the way Home sets itself: the field and its button as
   pills, the filter card headed in bold with counts in small pills, result
   cards that lift -3px on hover with Home's 36px icon tile, bold figures,
   and a short staggered rise on the first screenful. Everything is scoped to
   #page-search, so the header typeahead (which shares these row classes) is
   left exactly as it is. */
@keyframes gsRise { from { opacity: 0; transform: translateY(10px); } }

/* ---- the band ---- */
#page-search .gs-band { border-radius: var(--r); animation: gsRise .5s var(--ease-out) backwards; }
#page-search .gs-hero { border-radius: var(--r-pill); padding-left: 1.3rem; min-height: 54px; }
#page-search .gs-hero-btn { border-radius: var(--r-pill); height: 40px; padding: 0 1.4rem; transition: filter .2s var(--ease), transform .2s var(--ease); }
#page-search .gs-hero-btn:hover { transform: translateY(-1px); }
#page-search .gs-hero-clear { border-radius: 50%; }
#page-search .gs-hero-hint { padding-left: 1.3rem; }

/* ---- the filters ---- */
#page-search .gs-filters { padding: 1.1rem 1.15rem; animation: gsRise .5s var(--ease-out) backwards; animation-delay: 60ms; }
#page-search .gs-f-legend { font-size: var(--fs-2xs); letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); margin-bottom: .45rem; }
#page-search .gs-f-opt {
    padding: .28rem .45rem; margin: 0 -.45rem; border-radius: var(--r-sm);
    transition: background .2s var(--ease);
}
#page-search .gs-f-opt:hover { background: var(--inset); }
#page-search .gs-f-n {
    min-width: 28px; text-align: center; padding: .02rem .45rem; border-radius: var(--r-pill);
    background: var(--inset); color: var(--text-soft); font-weight: var(--fw-bold); font-size: var(--fs-2xs);
}
#page-search .gs-f-opt.is-zero .gs-f-n { background: transparent; color: var(--text-dim); font-weight: var(--fw-medium); }

/* ---- the results head and the pager ---- */
#page-search .gs-count { font-size: var(--fs-sm); }
#page-search .gs-count b { font-weight: var(--fw-bold); }
#page-search .gs-sort .form-select {
    border-radius: var(--r-pill); background-color: var(--surface); border-color: var(--border-soft);
    font-size: var(--fs-sm); font-weight: var(--fw-medium); padding-left: .95rem; padding-right: 2.1rem;
    background-position: right .8rem center; box-shadow: var(--shadow);
}
#page-search .gs-sort .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
#page-search .gs-chip { padding: .24rem .7rem; font-weight: var(--fw-medium); }
#page-search .gs-btn { border-radius: var(--r-pill); font-weight: var(--fw-bold); padding: .38rem 1rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
#page-search .gs-btn:hover:not([disabled]) { transform: translateY(-2px); box-shadow: var(--lift-2); background: var(--surface); }

/* ---- a result ---- */
#page-search .gs-card {
    border-radius: var(--r); padding: 1.1rem 1.35rem;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
    animation: gsRise .45s var(--ease-out) backwards;
}
#page-search .gs-card:nth-child(2) { animation-delay: 30ms; }
#page-search .gs-card:nth-child(3) { animation-delay: 60ms; }
#page-search .gs-card:nth-child(4) { animation-delay: 90ms; }
#page-search .gs-card:nth-child(5) { animation-delay: 120ms; }
#page-search .gs-card:nth-child(6) { animation-delay: 150ms; }
#page-search .gs-card:nth-child(7) { animation-delay: 180ms; }
#page-search .gs-card:nth-child(8) { animation-delay: 210ms; }
#page-search .gs-card:hover { transform: translateY(-3px); box-shadow: var(--lift-2); border-color: var(--accent-line); }
#page-search .gs-card + .gs-card { margin-top: .8rem; }
#page-search .gs-card > .gs-lead,
#page-search .gs-card.is-business .gs-lead { width: 36px; height: 36px; border-radius: 10px; font-size: var(--fs-lg); }
#page-search .gs-card > .gs-lead.is-person { border-radius: 50%; font-size: var(--fs-xs); }
#page-search .gs-card-t { letter-spacing: -.01em; }
#page-search .gs-fact dt { font-size: var(--fs-2xs); color: var(--text-soft); }
#page-search .gs-fact dd { font-size: var(--fs-md); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; letter-spacing: -.005em; }
#page-search .gs-fact dd .gs-na { font-weight: var(--fw-normal); }
#page-search .gs-recs-h { font-size: var(--fs-2xs); color: var(--text-soft); }
#page-search .gs-pill { font-weight: var(--fw-bold); }

/* ---- the landing state ---- */
#page-search .gs-land-sec { box-shadow: var(--shadow); padding: 1.15rem 1.25rem; animation: gsRise .5s var(--ease-out) backwards; }
#page-search .gs-tip { border-radius: var(--r); background: var(--inset); border-color: transparent; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease); }
#page-search .gs-tip:hover { transform: translateY(-2px); background: var(--surface); box-shadow: var(--lift-2); }
#page-search .gs-tip > .bi {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: var(--accent-weak); color: var(--accent-ink); font-size: var(--fs-lg);
}
#page-search .gs-tip b { font-weight: var(--fw-bold); }
#page-search .gs-empty > .bi {
    width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
    background: var(--inset); font-size: var(--fs-3xl); margin-bottom: .3rem;
}

@media (prefers-reduced-motion: reduce) {
    #page-search .gs-band, #page-search .gs-filters, #page-search .gs-card, #page-search .gs-land-sec { animation: none; }
    #page-search .gs-card:hover, #page-search .gs-tip:hover, #page-search .gs-btn:hover:not([disabled]),
    #page-search .gs-hero-btn:hover { transform: none; }
}
