/* ============================================================================
   room-light-table.css — the interior of the Browse Media Room.

   furnishing-vessel-interiors S7 (DT authoring). Presentation only.
   Spec: docs/room-specs/02-browse-media.md — committed before this file.
   Pattern: the S2-accepted pair, applied to the second SCENE-OWNED host.

   ── THE SEAM ───────────────────────────────────────────────────────────────
   dressScene() stamps the marker classes onto `.browse-media-content` ITSELF
   (room-windows.js:803) — no wrapper between the marker and the room. Every
   rule rides

       .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) <descendant>

   ── THE STAND-DOWN (scene-owned host discipline) ───────────────────────────
   Every rule carries `:not(.ffrw-stripped)`. Stripped, these selectors
   DECLINE TO MATCH and the host's own cool-navy surface returns byte-exact.
   The interior rules STEP ASIDE; they never override the host.

   ── ⛔ THIS ROOM HAS NO TOKEN BLOCK ────────────────────────────────────────
   Browse Media is the only fleet Room absent from --ffvr-admit with no token
   block at all — not even Admin's inert commented one. That is on the record:
   filling-bespoke-vessels used it as its deliberate NEGATIVE CONTROL. So every
   var(--ffvr-*) below resolves TO ITS FALLBACK today.

   The fallbacks are therefore not hand-picked. They were DERIVED by running
   deriveRoom() — the canonical instrument, unmodified — against this Room's
   own modalChrome block in app/data/ffa-launcher-design-manifest.json. Because
   the fallbacks ARE the derived values, admitting this Room later is a no-op
   for everything this file paints. ⚠️ ADMISSION ITSELF IS WITHHELD: it is a
   certifying act, and DT may not certify (spec §6.1 — the identical posture
   the plan mandates for Admin at S9).

   ── WHAT THIS FILE MAY NOT DO ──────────────────────────────────────────────
   ⛔ NOT ONE GEOMETRY DECLARATION, NOT ONE `!important`, no new scroll owner
   (.bm-grid-container keeps the scroll it already owns), no shell background
   (room-windows.css:794 already makes the dressed scene shell transparent, so
   the navy slab is gone before this file loads).

   ⛔ FAMILY MEDIA IS CONTENT, NEVER TEXTURE (D1 §10.4, §6.3). No filter, no
   opacity, no tint, no crop, no blend mode touches .bm-card-thumb, an <img>,
   or a <video>. This Room is nothing BUT family media; the dress works on the
   matte around it and never on it.

   ⛔ THE HEADER BAND IS NOT REPAINTED. `.bm-header` is HEADER_SELECTORS entry
   6, so the overlay's `.ffvl-chromed-header` paints the manifest's warm brown
   band and WINS (launcher-visual.css is runtime-attached, so it lands after
   browse-media.css at equal specificity). Reading browse-media.css:87 alone
   says this Room's rail is emerald; that reading is wrong. Room ink measures
   11.79:1 on the band as it renders. Spec §1.2 — S8 verifies in a browser.

   WITHHELD (spec §6): admission; the four `!important` drag-state borders
   (:1351/:1359/:1364/:1766 — unreachable without an !important this pattern
   forbids); the meaningful hues (in-profile amber, the drag/selection-mode
   blues, the five filter-chip provenance hues, .bm-readiness-ready); the
   Fergi aperture; and every census behavioral finding (BR-08/09/13/23/24/25/
   26/27, BR-01/02/03, BR-05) — zero JS lines changed.

   Single-step revert: delete this file and its one <link> in index.html.
   ============================================================================ */

/* ── Token attach (D1 §11 step 3) ─────────────────────────────────────────
   ⭐ The two supplied properties are this file's highest-leverage move.
   `--surface-elevated` and `--surface-dark` are used 5 and 3 times in
   browse-media.css and are defined NOWHERE in the tree (0 definitions each,
   verified exhaustively) — and are used in NO other file. So supplying them
   room-scoped dissolves the cool navy across all eight sites at once, with no
   per-selector rules and no markup change. The host already wrote
   `var(--surface-elevated, …)`: it asked for a token and none was ever
   supplied. This makes an authored intent real — the .admin-grid argument S6
   accepted for Dashboard, in a stronger form.

   Cool navy #252538 measures 1.24:1 against this Room's warm ground: not
   merely foreign, but nearly invisible as a distinct plane.

   The four derived constants are the FLEET's, verbatim from the six accepted
   Rooms. D1 §3.2: no percentage is re-picked per Room. */
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) {
  --surface-dark: var(--ffvr-surface, #1B1109);
  --surface-elevated: var(--ffvr-surface-raised, #2E241B);

  --lt-ink: var(--ffvr-ink, #F2E8D8);
  --lt-ink-muted: var(--ffvr-ink-muted, #C5BBAC);
  --lt-rule: color-mix(in srgb, var(--ffvr-rule, #C97B4A) 32%, transparent);
  --lt-rule-strong: color-mix(in srgb, var(--ffvr-rule, #C97B4A) 58%, transparent);
  --lt-control: color-mix(in srgb, var(--ffvr-surface-raised, #2E241B) 72%, var(--ffvr-surface-sunken, #000000) 28%);
  --lt-plane-hover: color-mix(in srgb, var(--ffvr-surface-raised, #2E241B) 90%, var(--ffvr-ink, #F2E8D8) 10%);

  /* ⚠️ This Room's derived --ffvr-accent is #F2E8D8 — THE SAME CREAM AS ITS
     INK (the deriver takes it from the manifest's innerLip). So the fleet's
     usual "selection becomes the accent" move collapses here, and the copper
     rule carries the active/selected signal instead. Spec §3.1. */
  --lt-signal: var(--ffvr-rule, #C97B4A);
  --lt-signal-ground: color-mix(in srgb, var(--ffvr-rule, #C97B4A) 14%, var(--ffvr-surface-raised, #2E241B));
}

/* ── Selection: all four D1 §3.7 signals, never one ───────────────────────
   Signal 1 the 2px copper border (4.63:1 against the plane), signal 2 the
   tinted ground, signal 3 the EXISTING ring recoloured rather than added,
   signal 4 the workflow's existing semantic state — untouched, no aria and
   no class moves.

   ⭐ Signal 2 measures only 1.22:1 on its own, which is exactly why D1 asks
   for four signals and not one — the same observation S5 recorded for
   Documentation (1.12:1 there). Hover must never look selected, so hover
   keeps the neutral plane-hover it already had. */
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-card.selected,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .pf-cover-item.selected {
  border-color: var(--lt-signal);
  background: var(--lt-signal-ground);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ffvr-rule, #C97B4A) 30%, transparent);
}

.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-card:hover {
  border-color: var(--lt-rule-strong);
  background: var(--lt-plane-hover);
}

/* ── The active/selected control family ───────────────────────────────────
   Every one of these is an ACTIVE-STATE signal painted in the foreign emerald
   (#10b981 / #34d399). They take the Room's copper signal — 4.63:1 on the
   plane, 5.67:1 on the ground.

   ⛔ Deliberately NOT in this list, because they are DATA and not decoration:
   .bm-chip-type / -date / -family / -profile / -search (five coordinated
   provenance hues), .bm-card.in-profile (amber), the drag/selection-mode
   blues, and .bm-readiness-ready (BR-24 reports it as a dead render — a
   presentation train neither styles nor revives it). */
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-selection-indicator.has-selection,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-filter-btn.active,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-dropdown-item.active,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-size-btn.active,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-mode-btn.active,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .pf-item-count {
  color: var(--lt-signal);
}

/* Native control tints — a control colour, not a status. */
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-dropdown-item input[type="checkbox"],
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-card-checkbox input {
  accent-color: var(--lt-signal);
}

/* ── Load More: the Room's control grammar ────────────────────────────────
   Emerald tint + emerald ink today. Takes the same control grammar the
   Documentation Room's `.btn` was accepted with at S6: control ground,
   rule-strong edge, Room ink (14.17:1). The LABEL is untouched. */
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-load-more-btn {
  background: var(--lt-control);
  border-color: var(--lt-rule-strong);
  color: var(--lt-ink);
}

.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-load-more-btn:hover {
  background: var(--lt-plane-hover);
}

/* ── Empty and loading states ─────────────────────────────────────────────
   The empty copy is legible before (6.84:1) and after (9.80:1) — this change
   is MATERIAL, not a rescue: neutral white-alpha becomes the Room's own warm
   muted ink, so the state belongs to the light table rather than floating on
   it. ⛔ The STRINGS are renderer truth and are untouched, and BR-26 (a failed
   load is indistinguishable from a successful one) is NOT designed around:
   no error paint is invented for a state the host does not report. */
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-empty-state,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-loading {
  color: var(--lt-ink-muted);
}

.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-empty-state h3 {
  color: var(--lt-ink);
}

/* The spinner's leading arc takes the Room signal. ⛔ The animation itself is
   untouched — it is the host's, and it is truthful. */
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-loading .spinner {
  border-top-color: var(--lt-signal);
}

/* ── Focus (D1 §3.6) ──────────────────────────────────────────────────────
   A SHAPE, not a hue — the same three declarations the six accepted Rooms
   carry, so focus stays readable over family media of any colour. */
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-card:focus-visible,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-filter-btn:focus-visible,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-size-btn:focus-visible,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-mode-btn:focus-visible,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-load-more-btn:focus-visible,
.ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-dropdown-item:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px #000000;
}

/* ── Reduced motion (the floor plus the list — pilot pattern) ─────────────
   ⛔ The spinner's own `animation: spin` is NOT killed here: it is the only
   signal that a load is in progress, and removing it would leave a silent
   dead state. D1 §9.3 asks that motion be reduced, not that truth be. */
@media (prefers-reduced-motion: reduce) {
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped),
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) * {
    transition: none;
  }

  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-card,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-card:hover {
    transform: none;
  }
}

/* ── Forced colors (D1 §10.1) ─────────────────────────────────────────────
   In High Contrast the system palette replaces every colour above, so what
   must survive is BOUNDARY and SELECTED-ness as system-keyword structure
   rather than as Room paint. */
@media (forced-colors: active) {
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-card,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-filter-btn,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-size-btn,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-mode-btn,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-load-more-btn {
    border: 1px solid ButtonBorder;
  }

  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-card.selected,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .pf-cover-item.selected,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-filter-btn.active,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-size-btn.active,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-mode-btn.active {
    border: 2px solid Highlight;
  }

  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-empty-state,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-empty-state h3,
  .ffrw-browse-media.ffrw-scene:not(.ffrw-stripped) .bm-loading {
    color: CanvasText;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BROWSE MEDIA v14 — the ported Light Table.  (porting-perimeter-souls S3)

   Everything below this line is reached ONLY through `html.ffv-modal-fleet-v14`.
   With the flag off not one selector here matches, and the room renders exactly
   as the lines above render it. The SHELL half needs the flag class because
   `.ffvc-rim-glow`, `.ffvc-body` and `.ffvc-lip` are drawn by room-windows.css
   in BOTH states; an unconditioned override would break the byte-identity that
   makes this flag a rollback path.

   ── THIS IS A SCENE HOST, AND NOTHING HERE TOUCHES THE SCENE ─────────────
   Browse Media renders media into a scene the host re-render observer owns. The
   port is a CHASSIS port: no rule below reaches the media grid, the filter
   state, the scene geometry or the shell selector, and no horizontal inset
   moves. The port's only geometry is vertical, through the theme's own DERIVED
   keep-outs (140 / 102, from 78 / 51) — of which ONE unit is the decoration:
   the scan line drives the header to 140 where the lip alone asks 139, and the
   foot is lip-driven outright. The old 78 (11.1%) was barely half the accepted
   standard; 140/700 is exactly 20% against the Navigator's praised 20.4%.

   Widths are the lab's times the geometric mean sqrt(0.625 * 0.7) = 0.6614.
   ═══════════════════════════════════════════════════════════════════════════ */

html.ffv-modal-fleet-v14 .ffrw-browse-media {
  --v14-teal:  #40e2d2;   /* the lab's --room-a     */
  --v14-amber: #f2b84b;   /* the lab's --room-b     */
  --v14-rose:  #ef3fa5;   /* the lab's --room-c     */
  --v14-metal: #7fd3b2;   /* the lab's --room-metal */
}

html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-rim-glow { stroke-width: 6.61; opacity: .24; }   /* lab 10  x 0.6614 */
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-body     { stroke-width: 2.65; }                 /* lab 4   x 0.6614 */
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-lip      { stroke: rgba(220, 246, 255, .45); stroke-width: .99; opacity: 1; }  /* lab 1.5 x 0.6614 */

html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-lighttable path,
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-filmwork path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the head: the scan line across the plate */
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-scan-line {
  stroke: var(--v14-teal);
  stroke-width: 1.98;                                                                             /* lab 3   x 0.6614 */
}

/* the lightbox crest, seated on the crown (sunk 18.4 — see the theme) */
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-hero-ring { fill: rgba(4, 15, 26, .96); stroke-width: 1.46; }  /* lab 2.2 x 0.6614 */
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-hero-line {
  stroke: color-mix(in srgb, var(--v14-teal) 78%, #ffffff 8%);
  stroke-width: 1.32;                                                                             /* lab 2   x 0.6614 */
}
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-node {
  fill: #06131e;
  stroke: var(--v14-metal);
  stroke-width: 1.32;                                                                             /* lab 2   x 0.6614 */
}

/* the foot: the film strip and the six perforations that clear the notch */
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-film-strip {
  stroke: var(--v14-metal);
  stroke-width: 3.31;                                                                             /* lab 5   x 0.6614 */
}
html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-film-cells {
  stroke: color-mix(in srgb, var(--v14-teal) 62%, transparent);
  stroke-width: 1.32;                                                                             /* lab 2   x 0.6614 */
}

/* ── motion: THE PAINT, NOT THE GEOMETRY ───────────────────────────────────
   The lab's `scan-breathe` does two things at once — it fades the scan line to
   .28 AND translates it 18 lab units DOWN. The fade is carried here. THE
   TRANSLATE IS NOT, and the reason is measurement rather than taste: 18 lab
   units is 12.6 here, the scan line sits at y=133, and the work well starts at
   140 — so the swept line would spend half its cycle 5.6 units inside the
   reading area and NEITHER CAPTURE GATE WOULD EVER SAY SO, because a CSS
   transform moves rendered ink while leaving the geometry getPointAtLength
   reports untouched.

   Third instance in one session, so it is a rule and not a third one-off
   (HELPER_CONTRACT §6b): CARRY animations that change PAINT — opacity, dash
   phase — and REFUSE animations that move GEOMETRY, unless the swept extent is
   itself derived into the keep-out. The hero node's breath below is opacity
   only and is carried under exactly that rule, as is Import Media's conveyor. */
@media (prefers-reduced-motion: no-preference) {
  html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-scan-line {
    animation: ffvc-v14-scan-breathe 2.8s ease-in-out infinite;
  }
  html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-node {
    animation: ffvc-v14-node-breathe 5.4s ease-in-out infinite;
  }
}
@keyframes ffvc-v14-scan-breathe { 50% { opacity: .28; } }
@keyframes ffvc-v14-node-breathe { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

/* ── forced colours ────────────────────────────────────────────────────────
   The UA discards the fills and strokes above. The chassis may disappear; what
   may not happen is the scan line, the film strip and the crest surviving as
   unstyled black-on-black shapes across the room's head and foot. */
@media (forced-colors: active) {
  html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-hero-ring,
  html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-node {
    fill: Canvas;
    stroke: CanvasText;
  }
  html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-scan-line,
  html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-film-strip,
  html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-film-cells,
  html.ffv-modal-fleet-v14 .ffrw-browse-media .ffvc-v14-hero-line {
    stroke: CanvasText;
  }
}
