/* CoverTree Rewards — the staff view of the agent store (agent.html only; js/agent/staff-view.js). A staff member looks at
   one agent's store, read only. The colours, the type and the kit (.btn, .field, .notice, .pill, .panel …) are
   css/shop.css's; everything here starts with sv-.
   1. The staff bar: a blue strip above the store's header that says in words whose store this is and that it is read
      only, with its buttons (Pick another agent, Staff console, Exit).
   2. The picker (#staff-view): the search box, the matches, the agents looked at lately.
   3. The staff sign-in's code step.
   4. The read-only note (a toast). */

/* ───────── 1. the staff bar ───────── */
/* the info blue, never the store's own white or teal: nobody takes this strip for part of the agent's own page */
.sv-bar { position: relative; z-index: 60; border-bottom: 3px solid var(--info); background: var(--info-soft); color: var(--ink); font-size: 0.95rem; line-height: 1.4; }
.sv-bar__in { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; padding-block: 0.4rem; }
.sv-bar__say { flex: 1 1 18rem; display: flex; align-items: flex-start; gap: 0.5rem; min-width: 0; }
.sv-bar__say > .icon { margin-top: 0.05em; color: var(--info); }
.sv-bar__label { color: var(--info); font-weight: 700; }
.sv-bar__name { font-weight: 700; }
.sv-bar__ag { color: var(--ink-2); }
/* an agent the agent list has as inactive, or whose account is turned off (staff only) */
.sv-bar__flag { display: inline-flex; align-items: flex-start; gap: 0.4rem; padding: 0.25rem 0.75rem; border: 1px solid var(--warn-edge); border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: 0.9rem; font-weight: 600; }
.sv-bar__flag .icon { margin-top: 0.05em; }
.sv-bar__flag-more { font-weight: 400; }
.sv-bar__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
/* the bar's buttons are the kit's small outline button, on the page's ground so each stands clear of the strip */
.sv-bar__btn { background: var(--bg); }
.sv-bar__btn .icon { color: var(--info); }
/* Staff console while its one-time ticket is on the way (the new tab is already open) */
.sv-bar__btn[aria-busy="true"] { cursor: progress; opacity: 0.7; }

/* With room for it, the bar stays at the top of the window and the store's header sits under it: --sv-h on BODY is the
   bar's height there (js/agent/staff-view.js measures it into --sv-bar-h on the root; one line of the bar until it has).
   On a phone, or in a short window, three buttons in words take a second line, and a tall strip fixed over a small screen
   would hide the store staff came to look at: there the bar scrolls away with the page, covers nothing, and --sv-h
   stays 0. */
@media (min-width: 56em) and (min-height: 32em) {
  .sv-bar { position: sticky; top: 0; }
  body.is-staff-view { --sv-h: var(--sv-bar-h, 3.5rem); }
  /* what the keyboard or a link scrolls into view stops below the bar (css/shop.css sets this on the root, where --sv-h
     is always 0) */
  html:has(> body.is-staff-view) { scroll-padding-top: calc(var(--sv-bar-h, 3.5rem) + 1rem); }
}
/* ...and below the store's header too, where that header stays at the top: a wide window with text at its normal size
   (css/shop.css: under 75em, or with larger text, the header scrolls away with the page) */
@media (min-width: 75em) and (min-height: 32em) {
  html:not([data-text]):has(> body.is-staff-view) { scroll-padding-top: calc(var(--head-h) + var(--sv-bar-h, 3.5rem) + 1rem); }
}

/* ───────── 2. the picker ───────── */
.sv-pick { --wrap: 54rem; }
/* "Back to <name>'s store" as a button (their store needs a fresh token first): it looks like the kit's back link */
.sv-pick__back { border: 0; background: none; color: var(--brand-ink); cursor: pointer; }
.sv-pick__back:hover { color: var(--brand-ink-2); }
.sv-find { margin-bottom: 1.5rem; }
/* why a pick did not open: a red notice above the search, gone again with the next pick */
.sv-why:empty { display: none; }
.sv-why { margin-bottom: 1.5rem; }
/* the matches, or the agents looked at lately: rows from edge to edge of the panel */
.sv-res { padding: 0; overflow: hidden; }
.sv-res__t { display: flex; align-items: center; gap: 0.5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.sv-res__t .icon { color: var(--info); }
/* the heading takes the focus after "Try again": its ring sits inside, where the panel's overflow cannot clip it */
.sv-res__t:focus-visible { outline-offset: -3px; }
.sv-msg { padding: 1rem 1.25rem; color: var(--ink-2); }
/* one agent: the whole row is the button. On a phone its parts sit one under another; with room, side by side. */
.sv-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 0.35rem 1.25rem; width: 100%; min-height: var(--tap); padding: 0.9rem 1.25rem; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.sv-row:hover { background: var(--soft); }
.sv-row:focus-visible { outline-offset: -3px; }
.sv-row.is-current { box-shadow: inset 4px 0 0 var(--info); }
.sv-row[aria-busy="true"] { background: var(--info-soft); }
.sv-row[disabled] { cursor: progress; }
.sv-row__main, .sv-row__org { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.sv-row__org:empty { display: none; }
.sv-row__name { font-weight: 600; overflow-wrap: anywhere; }
/* an agent the report has no name for: the row says so (the id shows once, on the line below) */
.sv-row__name--none { font-style: italic; font-weight: 400; color: var(--ink-2); }
.sv-row__sub, .sv-row__wh { color: var(--ink-2); font-size: 0.9rem; overflow-wrap: anywhere; }
.sv-row__ag { display: inline-flex; align-items: flex-start; gap: 0.4rem; font-size: 0.95rem; }
.sv-row__ag .icon { margin-top: 0.1em; color: var(--ink-3); }
.sv-row__end { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.sv-row__go { display: inline-flex; align-items: center; gap: 0.2rem; color: var(--brand-ink); font-weight: 600; white-space: nowrap; }
@media (min-width: 56em) {
  .sv-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; }
  .sv-row__org:empty { display: flex; }
  .sv-row__end { justify-content: flex-end; }
}
/* grey lines where the matches are loading */
.sv-skelrow { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.25rem; }
.sv-skel__line { width: min(20rem, 70%); height: 1.1rem; }
.sv-skel__line--short { width: min(12rem, 45%); }

/* ───────── 3. the staff sign-in's code step ───────── */
/* drawn in place of the sign-in form: as wide as that page's card, and a column of its own where there is none */
.sv-code, .sv-open { width: 100%; max-width: 30rem; margin-inline: auto; }
.sv-code > .sh-brand, .sv-open > .sh-brand { align-self: flex-start; }
.sv-code__head { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
/* six digits, big and evenly spaced, in a box sized for them */
.sv-code__input { max-width: 13rem; font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.3em; }
.sv-code__more { justify-content: space-between; }
.sv-open__line { display: flex; align-items: center; gap: 0.5rem; color: var(--ink-2); }

/* ───────── 4. the read-only note ───────── */
.toast.sv-note { border: 2px solid var(--info); background: var(--info-soft); color: var(--ink); }
.toast.sv-note .icon { color: var(--info); }
