/**
 * High Intent Report — SGM-225.
 *
 * Only the pieces the cr-* report idiom does not already provide: a CLICKABLE
 * KPI card, the view switch, the engagement pills and the pager. Everything else
 * (cr-pagehead, cr-filters, cr-kpis, cr-tablewrap, cr-notice, cr-attr-note)
 * comes from the existing report styles, so this page looks like its siblings.
 *
 * ZERO hardcoded colours. Every value is a token from app.css :root.
 *
 * The -text / -fill split is load-bearing, not decoration. SGM-218 measured the
 * brand palette and found NONE of it meets WCAG AA as text or as a fill under a
 * white label — --primary as text is 3.54:1 against a tinted surface. So text
 * uses --primary-text / --success-text, and anything carrying a white label uses
 * --primary-fill. Reaching for --primary here would silently reintroduce exactly
 * the failure that audit fixed.
 */

/* ── A KPI card that is a link ─────────────────────────────────────────────
   Maddy 2026-08-22: "if you are giving any card, those should be clickable to
   respective report." Three properties make it a real affordance:
     1. the chevron + destination line are visible WITHOUT hover — a link that
        only reveals itself on hover is undiscoverable on a first visit;
     2. it is a real <a>, so it is keyboard-reachable, and :focus-visible gets a
        ring rather than relying on the hover styling;
     3. a card reading zero still navigates and still says what it would show.  */
a.hi-card {
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
a.hi-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
a.hi-card:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}
.hi-card-go {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  transition: color var(--transition);
}
a.hi-card:hover .hi-card-go { color: var(--primary-text); }
.hi-card-dest {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  transition: color var(--transition);
}
a.hi-card:hover .hi-card-dest { color: var(--primary-text); }

/* Respect a reduced-motion preference — the lift is decorative, the colour
   change carries the meaning, so only the transform is dropped. */
@media (prefers-reduced-motion: reduce) {
  a.hi-card, a.hi-card:hover { transition: none; transform: none; }
}

/* ── View switch ───────────────────────────────────────────────────────── */
.hi-viewbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}
.hi-seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hi-segbtn {
  border: 0;
  background: transparent;
  padding: 7px 13px;
  font: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.hi-segbtn:hover { background: var(--bg-card-hover); }
/* White label on a fill, so it must be the AA-safe -fill variant. */
.hi-segbtn.on {
  background: var(--primary-fill);
  color: var(--text-inverse);
  font-weight: 600;
}
.hi-segbtn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.hi-count { font-size: 12.5px; }

/* ── Engagement pills ──────────────────────────────────────────────────────
   A click is the signal worth acting on and reads in the accent hue; an open is
   informational and reads in the calmer brand blue. Both use the -text variants
   over an 8% tint, which is the pairing SGM-218 measured at 4.8:1.            */
.hi-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.hi-click { background: var(--success-bg); color: var(--success-text); }
.hi-open  { background: var(--info-bg);    color: var(--primary-text); }

/* ── Pager — pagination, never a silent cap ────────────────────────────── */
.hi-pager {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin: 16px 0 4px;
  font-size: 13px;
}

/* Numeric columns read right-aligned so magnitudes line up. */
.data-table th.num, .data-table td.num { text-align: right; }

/* ── Resolution awareness ──────────────────────────────────────────────────
   Gate 0.2: the page is designed for a RANGE, not a point. The card grid is
   already fluid via cr-kpis; below the laptop band the filter bar is the thing
   that breaks first, so it wraps rather than forcing a horizontal scroll. The
   table keeps its own overflow container (cr-tablewrap) at every width.       */
@media (max-width: 1024px) {
  .hi-viewbar { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* The card's info affordance. Deliberately NOT .cr-tip: app-wide that class is
   a muted 11px italic CAPTION paragraph (app.css) used for "No data in this
   range" lines, not an interactive trigger. Reusing it here rendered a raw
   U+24D8 that the server's font stack has no glyph for — it shipped as a tofu
   box beside every card label. Lucide only, per the project icon rule. */
.hi-info {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: var(--text-muted);
  cursor: help;
  vertical-align: middle;
}
.hi-info i,
.hi-info svg { width: 13px; height: 13px; }
.hi-info:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius); }

/* A timestamp is one token. At 1280 the column squeezed and every row wrapped
   to "Aug 22, 08:39 / AM", which doubles the row height across the whole table
   for no information gained. */
.hi-ts { white-space: nowrap; }
