/* search.css — "Site search" dashboard (EA v2, web/search.js): only what is the page's own. The
   shared parts (top bar, hero, switch, panels, rows, tiles, compare tiles, skeletons, toast, motion)
   are the kit: web/ea-ui.css. Scoped under .ss.
   Colour carries meaning: searches = coral (the asista search colour), nothing found = rose,
   found = mint, keyboard-layout fix = violet, words dropped = amber, staff = sky. */

.ss {
    --ss-accent: #ff8a5b;
    --ss-accent-2: #ffb38a;
    --ss-zero: #fb7185;
    --ss-found: #5eead4;
    --ss-layout: #a78bfa;
    --ss-relax: #fbbf24;
    --ss-staff: #60a5fa;
    --ea-accent: #ff8a5b;
}

/* ---------- kept as before: where the page differs from the kit today ----------
   Deleting a line here = the page takes the kit's value: a visible change, Sasha's call
   (plan step 1b / Q21, before/after first). */
.ss {
    /* fainter grey text than the kit (.70 / .56 / .36): the Cloudflare page's values */
    --ea-ink-2: rgba(236, 236, 248, 0.68);
    --ea-ink-3: rgba(236, 236, 248, 0.46);
    --ea-ink-4: rgba(236, 236, 248, 0.26);
}
/* the chart sits 14 px under the hero row (kit 18) */
.ss .ss-chart { margin-top: 14px; }
/* the ring is 88 px with an 18 px rose value (kit 84 / 20) */
.ss .ss-ring { width: 88px; height: 88px; }
.ss .ss-ring .ea-ring__val { font-size: 18px; color: #ffd0d8; }
/* the three numbers under the chart: rows line up across the cells (subgrid), labels may wrap on a
   narrow phone instead of being cut, and the labels are tracked +0.06em */
.ss .ss-stats { grid-template-rows: auto auto auto; }
.ss .ss-stats .ea-stat { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; }
.ss .ss-stats .ea-stat__k { align-self: end; white-space: normal; line-height: 1.25; letter-spacing: 0.06em; }
.ss .ss-stats .ea-stat__s { white-space: normal; line-height: 1.3; }
/* the stores' small lines are 11.5 px (kit 12) */
/* the current store's tint as exact rgba (the kit mixes --ea-accent, which rounds a hair differently) */

/* top bar: the mark glows in the search colour */
.ss .ss-mark { filter: drop-shadow(0 0 10px rgba(255, 138, 91, 0.45)); }

/* hero shadow in the search colour (the page accent); the number in a soft gradient */
.ss .ss-hero { box-shadow: 0 24px 60px -30px rgba(255, 138, 91, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.ss .ss-big { background: linear-gradient(180deg, #ffffff 30%, #ffc9ad 100%); -webkit-background-clip: text; background-clip: text; }
.ss .ea-big__sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* period switch (sticky, not compacting) and the audience switch inside the hero */
.ss .ss-switch-wrap { margin-top: 2px; margin-bottom: 10px; }
.ss .ss-switch--aud { flex: 1; padding: 3px; border-radius: 12px; }
.ss .ss-switch--aud .ea-switch__thumb { top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 9px; }
.ss .ss-switch--aud .ea-switch__btn { height: 30px; font-size: 12.5px; }

/* change chips: an arrow + «9%» or «0,2 в.п.» (the kit's change pill is .ea-delta; this one is the
   page's own until its rework, and it also sits on the Integrations card) */
.ss-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.ss-trend--good { color: #4ade80; background: rgba(74, 222, 128, 0.12); }
.ss-trend--bad { color: #fb7185; background: rgba(244, 63, 94, 0.13); }
.ss-trend--flat { color: rgba(236, 236, 248, 0.5); background: rgba(255, 255, 255, 0.06); font-weight: 600; }
.ss .ea-ringwrap .ss-trend { margin-top: -2px; padding: 1px 6px; font-size: 11px; }

/* chart: a fixed 360-wide viewBox, tap a column to read it; the nothing-found numbers in rose */
.ss .ss-chart--still .ea-col rect { animation: none; }
.ss .ss-chart .ea-col { cursor: pointer; }
.ss .ss-cap-zero b { color: var(--ss-zero); }

/* nothing found per day */
.ss .ss-zr { margin-top: 14px; }
.ss .ss-zr__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 8px; font-size: 11.5px; color: var(--ea-ink-3); }
.ss .ss-zr__title { letter-spacing: 0.02em; }
.ss .ss-zr__stat b { color: var(--ea-ink); font-weight: 650; }
.ss .ss-zr__stat b.is-peak { color: #ffd0d8; }
.ss .ss-zr svg { display: block; width: 100%; height: auto; overflow: visible; }
.ss .ss-zr__track { fill: rgba(255, 255, 255, 0.035); }
.ss .ss-zr__bar {
    fill: var(--ss-zero);
    opacity: 0.85;
    transform-box: fill-box;
    transform-origin: center bottom;
    animation: eaGrowY 0.8s var(--ea-ease) both;
    animation-delay: calc(0.15s + var(--k, 0) * 22ms);
}
.ss .ss-zr__col.is-peak .ss-zr__bar { opacity: 1; filter: drop-shadow(0 0 4px rgba(251, 113, 133, 0.6)); }
.ss .ss-zr__col.is-thin .ss-zr__bar { opacity: 0.3; }
.ss .ss-zr__avg { stroke: rgba(255, 255, 255, 0.4); stroke-width: 1; stroke-dasharray: 3 3; }
.ss .ss-zr__axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--ea-ink-4); }

/* rows: queries wrap, codes in mono; nothing-found rows are buttons that copy the query */
.ss .ss-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 500; letter-spacing: 0.01em; }
.ss .ss-row .ea-row__name { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.ss .ss-row .ea-row__top { align-items: center; }
.ss .ss-row--copy {
    display: block;
    width: calc(100% + 16px);
    margin: -6px -8px;
    padding: 6px 8px;
    border-radius: 12px;
    text-align: left;
    transition: background 0.2s, transform 0.15s var(--ea-ease);
}
.ss .ss-row--copy:active { transform: scale(0.985); background: rgba(255, 255, 255, 0.05); }
.ss .ss-row--copy.is-copied { background: rgba(255, 138, 91, 0.12); }
.ss .ss-row--copy .ea-row__note { display: flex; align-items: center; gap: 6px; }
.ss .ss-zero-val { color: var(--ss-zero); font-size: 14px; }
.ss .ss-x { font-size: 11px; font-weight: 600; margin-left: 1px; opacity: 0.7; }
.ss .ss-lead-sm { margin-top: 10px; font-size: 12.5px; color: var(--ea-ink-3); }

/* fixed searches: one line, the kept words (cut if long) + the dropped words highlighted (never cut
   away: they are the part worth reading) */
.ss .ss-fix__line { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; font-size: 13.5px; }
.ss .ss-fix__kept { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ea-ink-2); font-weight: 500; }
.ss .ss-fix__drop {
    flex: 0 0 auto; /* a short dropped word keeps its width; the kept part gives way */
    max-width: 62%;
    padding: 1px 7px;
    border-radius: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ss-relax);
    background: rgba(251, 191, 36, 0.13);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.22);
    font-weight: 650;
}
.ss .ss-fix__typed { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px; font-size: 11.5px; color: var(--ea-ink-3); }
.ss .ss-fix__typed-q { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* customers vs staff: one-column key/value; each audience tile carries its colour as a 3 px stripe
   (kept as before — the kit has no stripe: Sasha's "no accent line on the left edge" rule; step 1b) */
.ss .ss-kvs { grid-template-columns: minmax(0, 1fr); }
.ss .ss-aud-tile { position: relative; overflow: hidden; padding-left: 16px; }
.ss .ss-aud-tile::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ss-accent);
}
.ss .ss-aud-tile--staff::before { background: var(--ss-staff); }

/* stores: the kit's compare tiles; the current store's name in the light search colour */

/* messages */
.ss .ss-msg-ico { color: var(--ea-watch); display: inline-flex; }
.ss .ss-note { margin: 0 0 12px; }

/* copy toast: the kit's, with the search colour on its edge */
.ea-toast.ss-toast { border-color: rgba(255, 138, 91, 0.35); }

/* Integrations card */
.integration-card__icon--search {
    border-radius: 14px;
    background: radial-gradient(circle at 30% 25%, rgba(255, 179, 138, 0.28), rgba(255, 107, 74, 0.08));
    color: #ff8a5b;
}
.integration-card__metric-pill--search { color: #ff8a5b; background: rgba(255, 138, 91, 0.13); }
.ss-cardspark { display: flex; align-items: flex-end; gap: 1.5px; height: 36px; }
.ss-cardspark__bar { flex: 1; display: flex; flex-direction: column-reverse; gap: 1px; height: 100%; }
.ss-cardspark__bar.is-partial { opacity: 0.5; }
.ss-cardspark__f,
.ss-cardspark__z {
    border-radius: 2px;
    height: calc(var(--h) * 1%);
    transform-origin: bottom;
    animation: eaGrowY 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--k, 0) * 18ms);
}
.ss-cardspark__f { background: linear-gradient(180deg, #ffb38a, #ff6b4a); }
.ss-cardspark__z { background: #fb7185; min-height: 1px; }
#integration-search-card .ea-cardmeta .ss-trend { padding: 0 5px; font-size: 10.5px; }

@media (prefers-reduced-motion: reduce) {
    #integration-search-card * {
        animation: none !important;
        transition: none !important;
    }
}
