/* The members bar, and what a visitor sees instead of the numbers
   (2026-09-16, DESIGN_entitlement.md).

   A separate stylesheet on purpose. Kept inside app.css this had to be
   merged every time main changed a line near it, and the demo silently
   missed fixes that had shipped. Additive, so the branch only ever adds
   files and app.css is byte-identical to main's. */

/* The members bar, and what a visitor does not see (2026-09-16,
   DESIGN_entitlement.md). Presentation only: market.json is public, so this
   decides what is drawn, never what can be obtained. */
.gate-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 4px; padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--violet) 45%, transparent); border-left: 3px solid var(--violet);
  border-radius: var(--radius); background: color-mix(in srgb, var(--violet) 8%, var(--surface)); }
.gate-bar[hidden] { display: none; }
.gate-bar.gate-owner-only { border-color: var(--border); border-left-color: var(--text-faint); background: var(--surface); }
.gate-txt { min-width: 0; flex: 1 1 280px; }
.gate-k { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--violet); }
.gate-d { margin-top: 2px; font-size: 13px; color: var(--text-dim); line-height: 1.45; }
.gate-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.gate-cta { font-size: 13px; color: var(--text-dim); }
.gate-owner { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--text-faint); }
.gate-owner button { all: unset; cursor: pointer; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--text-dim); }
.gate-owner button[aria-pressed="true"] { color: var(--text); border-color: var(--sky); background: color-mix(in srgb, var(--sky) 12%, transparent); }
.gate-owner button:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* What a visitor sees (2026-09-16, DESIGN_entitlement.md).

   The line is: today is public, time is the product. Anything true right
   now from a public source stays readable; anything that needed the price
   history we collected is the membership.

   HOW it is withheld changed on 2026-09-16, on the owner's note: "I want to
   understand what I would get if I paid without reading anything, just by
   seeing … blurred, not aggressively, but enough that I can't see the
   value." The first version replaced each number with a grey block. It read
   as something still loading, nearly vanished in dark mode, and made a
   membership look like it bought one faint line per card. Now every
   member-only value sits exactly where a member sees it, in its own colour,
   softly out of focus: you can tell there is a green 30-day move, a red
   drawdown, a price axis, five movers with their numbers. You cannot read
   them. 0.22em left prices half guessable; 0.3em does not.

   Three things about the engine, each learned the slow way:

   1. A blurred text-shadow over transparent text draws nothing in WebKit.
      filter: blur() on the element is what works.
   2. filter: blur() is ignored on SVG <text> in WebKit even though the
      computed style reports it. An SVG <filter> referenced by url() is
      honoured, so gate.js injects one (#gateBlur) and marks the body
      gate-svgblur. Without that mark the labels fall back to hidden, so a
      failure never turns into a leak.
   3. A filter is a compositing layer. 515 cards carry about 1,500 gated
      values, so a card's values are blurred only while the card is near the
      screen (gate.js adds gate-near) and simply not painted while it is
      far. Nothing is ever readable in between.

   None of this withholds anything technically: market.json is public. This
   is presentation, recorded as such in DESIGN_entitlement.md. No id may
   appear in these lists; one once outranked the rule beneath it. */
body[data-gate="visitor"] { --gate-blur: 0.3em; }

/* A. Values outside cards and table rows. Few, so always blurred. */
body[data-gate="visitor"] :is(
  .mk-pct:not(.s-card *):not(.mk-table tr *),
  [id="mkBrief"],
  .mk-pulse-sum,
  .mk-pulse-signals .mk-signal > b,
  .mk-mover-price,
  .mk-score .mk-breadth,
  .mk-score b,
  .family-heading .fam-traj,
  .family-heading .s-ctx:is(.ctx-near_high, .ctx-recovering, .ctx-reprint_wave),
  .mk-compare-sum,
  .mk-idx-game,
  .chart-stats .cs-m .cs-v,
  .chart-stats .cs-sig small,
  .chart-sub:not(.cmp-sub)
) {
  filter: blur(var(--gate-blur));
  user-select: none;
}

/* B. Values inside a card, and the gated cells of a table row: not painted
   while far from the screen, blurred while near it. */
body[data-gate="visitor"] .s-card :is(
  .mk-value,
  .mk-pct-lbl,
  .mk-pct,
  .s-ctx:is(.ctx-near_high, .ctx-recovering, .ctx-reprint_wave),
  .s-read-ctx:is(.ctx-near_high, .ctx-recovering, .ctx-reprint_wave)
),
body[data-gate="visitor"] .mk-table tbody td:not(.name, .cmp, .price):not(:has(.mk-signal)) {
  visibility: hidden;
  user-select: none;
}
body[data-gate="visitor"] :is(.s-card.gate-near, .gate-all-near .s-card) :is(
  .mk-value,
  .mk-pct-lbl,
  .mk-pct,
  .s-ctx:is(.ctx-near_high, .ctx-recovering, .ctx-reprint_wave),
  .s-read-ctx:is(.ctx-near_high, .ctx-recovering, .ctx-reprint_wave)
),
body[data-gate="visitor"] :is(.mk-table tbody tr.gate-near, .gate-all-near .mk-table tbody tr) td:not(.name, .cmp, .price):not(:has(.mk-signal)) {
  visibility: visible;
  filter: blur(var(--gate-blur));
}

/* C. Chart labels. The price axis and the "high" marker are member data;
   dates, "released", the MSRP line and event numbers are not. A sweep with
   exceptions, so a label added later is withheld by default. */
body[data-gate="visitor"] .chart text:not(.cx):not(.crel-l):not(.cretail-l):not(.cev-n) { display: none; }
body[data-gate="visitor"].gate-svgblur .chart text:not(.cx):not(.crel-l):not(.cretail-l):not(.cev-n) { display: initial; filter: url(#gateBlur); }
