/* -------------------------------------------------------------------
 * premium-lock.css — the shared premium-lock idiom (#57's 4-part
 * pattern). Extracted from alerts.css so surfaces OTHER than
 * Settings→Alerts can reuse it verbatim without duplicating the
 * rules: #52's forecast gating (FC-5) on section/river pages reuses
 * .pchip / .pchip-lock / .tip / .upsell exactly as the settings
 * channel matrix does.
 *
 * Loaded by any page that renders a Premium chip or the inline upsell
 * note (account_alerts.html, section.html). Builds only on global
 * tokens (tokens.css); light + dark come from the tokens. Nothing
 * here renders unless the markup opts in — the classes are inert on
 * pages that don't emit them.
 * ------------------------------------------------------------------- */

/* Premium chip — replaces a control (a toggle, or the empty forecast
 * zone) with an <a href="/app">, brand-tinted, never a greyed/disabled
 * control. Hosts the CSS tooltip (.tip) shown on hover / focus-visible. */
.pchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 11px var(--font-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--brand-700);
  background: var(--brand-050);
  border: 1px solid color-mix(in srgb, var(--brand-500) 32%, transparent);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  text-decoration: none;
  position: relative;
  cursor: pointer;
}
.pchip-lock { flex-shrink: 0; }
.pchip:hover { border-color: var(--brand-500); }
.pchip:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* Tooltip — pure CSS, revealed on chip hover / keyboard focus. Names
 * the requirement + price; no CTA inside (the chip itself is the link). */
.tip {
  position: absolute;
  /* Renders BELOW the chip: the enclosing container may be
     overflow:hidden (for rounded corners), so an upward tooltip on a
     top row would be clipped. Downward keeps the tooltip inside the
     container bounds. */
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  z-index: 20;
  font: 500 11.5px var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  color: var(--text-primary);
  background: var(--surface-overlay);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-3);
  padding: 8px 10px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  pointer-events: none;
}
.pchip:hover .tip,
.pchip:focus-visible .tip {
  opacity: 1;
  visibility: visible;
}

/* Inline upsell note — sunken card, lock glyph, non-subscribers only.
 * Max one per surface; never a modal/toast; no dismissal. States
 * what's premium AND what stays free in the same breath. */
.upsell {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  margin: 0 0 var(--space-3);
}
.upsell-lock {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--brand-600);
}
.upsell strong { color: var(--text-primary); font-weight: 700; }
.upsell a {
  color: var(--brand-600);
  text-decoration: none;
  white-space: nowrap;
}
.upsell a:hover { text-decoration: underline; }
