  .fs-app, .fs-app *, .fs-app *::before, .fs-app *::after { box-sizing: border-box; margin: 0; padding: 0; }
  .fs-app {
    --bg-primary:   #ffffff;
    --bg-secondary: #f5f5f2;
    --bg-info:      #e6f1fb;
    --bg-success:   #eaf3de;
    --bg-warning:   #faeeda;
    --bg-danger:    #fcebeb;
    --text-primary:   #1a1a18;
    --text-secondary: #5f5e5a;
    --text-info:      #185fa5;
    --text-success:   #3b6d11;
    --text-warning:   #854f0b;
    --text-danger:    #791f1f;
    --fs-border:         rgba(30,30,28,0.15);
    --radius-md: 8px;
    --radius-lg: 12px;
    --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
  }
  /* Pillar / vector beam accent colors — high-contrast against white */
  .fs-app {
    --pillar-1: #16a34a; /* Farm: green */
    --pillar-2: #d97706; /* Factory: amber */
    --pillar-3: #0d9488; /* Warehouse: teal */
    --pillar-4: #0284c7; /* Cold chain: blue */
    --pillar-5: #4f46e5; /* Importer: indigo */
    --pillar-6: #7c3aed; /* Fork: violet (no red anywhere) */
    /* Cross-cutting vectors share ONE calm slate theme, not seven colors */
    --vector:            #475569;
    --beam-sanitation:   #475569;
    --beam-crosscontam:  #475569;
    --beam-waste:        #475569;
    --beam-labelling:    #475569;
    --beam-nutrition:    #475569;
    --beam-tempcontrol:  #475569;
    --beam-handhygiene:  #475569;
    --beam-harassment:   #be123c;
  }
  .fs-app { font-family: var(--font); background: #FFFFFF; color: var(--text-primary); line-height: 1.6; min-height: auto; }
  .fs-app .page { max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem; }
  .fs-app h1 { font-size: 20px; font-weight: 500; margin-bottom: 4px; color: var(--text-primary); }
  .fs-app .subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 1.25rem; }
 
  /* Search bar */
  .search-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 1.5rem; }
  .search-input {
    flex: 1; padding: 9px 14px; font-size: 13px; font-family: var(--font);
    background: var(--bg-primary); color: var(--text-primary);
    border: 0.5px solid var(--fs-border); border-radius: var(--radius-md);
    outline: none; transition: border-color 0.15s;
  }
  .search-input:focus { border-color: var(--text-info); }
  .search-input::placeholder { color: var(--text-secondary); }
  .search-btn {
    padding: 9px 16px; font-size: 13px; font-family: var(--font); font-weight: 500;
    background: var(--bg-info); color: var(--text-info);
    border: 0.5px solid var(--fs-border); border-radius: var(--radius-md);
    cursor: pointer; transition: opacity 0.15s; white-space: nowrap;
  }
  .search-btn:hover { opacity: 0.8; }
  .search-clear {
    padding: 9px 12px; font-size: 12px; font-family: var(--font);
    background: transparent; color: var(--text-secondary);
    border: 0.5px solid var(--fs-border); border-radius: var(--radius-md);
    cursor: pointer; display: none;
  }
  .search-results {
    display: none; background: var(--bg-primary); border: 0.5px solid var(--fs-border);
    border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.5rem;
  }
  .search-results.visible { display: block; }
  .search-results-header {
    padding: 10px 14px; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); background: var(--bg-secondary);
    border-bottom: 0.5px solid var(--fs-border);
  }
  .search-result-row {
    padding: 10px 14px; border-bottom: 0.5px solid var(--fs-border);
    cursor: pointer; transition: background 0.1s;
  }
  .search-result-row:last-child { border-bottom: none; }
  .search-result-row:hover { background: var(--bg-secondary); }
  .sr-title { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
  .sr-meta { font-size: 11px; color: var(--text-secondary); display: flex; gap: 8px; flex-wrap: wrap; }
  .sr-cite { font-family: var(--font-mono); font-size: 11px; color: var(--text-info); }
  .sr-node { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--bg-info); color: var(--text-info); }
  .sr-layer { font-size: 10px; padding: 1px 6px; border-radius: 4px; }
  .sr-layer-food { background: var(--bg-success); color: var(--text-success); }
  .sr-layer-tech { background: var(--bg-info); color: var(--text-info); }
  .sr-layer-di   { background: var(--bg-warning); color: var(--text-warning); }
  .sr-layer-vec  { background: #f1ecfb; color: #5b3a99; }
  .no-results { padding: 1.5rem; text-align: center; font-size: 13px; color: var(--text-secondary); }
  .fs-app mark { background: #fffb80; color: inherit; border-radius: 2px; padding: 0 1px; }
 
  /* Pillar grid — simple horizontal step tabs */
  .pillar-grid { display: flex; align-items: stretch; border: 0.5px solid var(--fs-border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 1.5rem; }
  .pillar {
    flex: 1; cursor: pointer; border: none;
    background: var(--bg-secondary); color: var(--text-secondary);
    padding: 12px 8px; text-align: center; font-size: 13px; font-weight: 500; font-family: var(--font);
    transition: background 0.15s, color 0.15s;
  }
  .pillar:hover { background: var(--bg-primary); }
  .pillar.active { background: var(--bg-primary); color: var(--pillar-color); font-weight: 600; box-shadow: inset 0 -3px 0 var(--pillar-color); }
  .pillar-icon { margin-right: 6px; }
  .pillar-sep {
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 24px; font-size: 13px; color: var(--text-secondary); background: var(--bg-secondary);
    border-left: 0.5px solid var(--fs-border); border-right: 0.5px solid var(--fs-border);
  }
  @media (max-width: 860px) {
    .pillar-grid { flex-wrap: wrap; }
    .pillar { flex: 1 1 50%; border-bottom: 0.5px solid var(--fs-border); }
    .pillar-sep { display: none; }
    .layer-tabs { flex-wrap: wrap; }
    .layer-tab { flex: 1 1 50%; border-bottom: 0.5px solid var(--fs-border); }
  }
  .node-content { display: none; }
  .node-content.active { display: block; }
  .node-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 1.25rem; padding: 1rem 1.25rem; background: var(--bg-primary); border-radius: var(--radius-lg); border: 0.5px solid var(--fs-border); }
  .node-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; background: var(--bg-info); }
  .node-title { font-size: 16px; font-weight: 500; margin-bottom: 3px; color: var(--text-primary); }
  .node-roles { font-size: 12px; color: var(--text-secondary); }
 
  /* Layer tabs */
  .layer-tabs { display: flex; border: 0.5px solid var(--fs-border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 1rem; }
  .layer-tab { flex: 1; padding: 8px 4px; font-size: 11px; text-align: center; cursor: pointer; background: var(--bg-secondary); color: var(--text-secondary); border: none; border-right: 0.5px solid var(--fs-border); transition: background 0.15s; font-family: var(--font); }
  .layer-tab:last-child { border-right: none; }
  .layer-tab.active { background: var(--bg-primary); color: var(--text-primary); font-weight: 500; }
  .layer-content { display: none; }
  .layer-content.active { display: block; }
  .badge { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: var(--radius-md); font-weight: 500; }
  .badge-food { background: var(--bg-success); color: var(--text-success); }
  .badge-tech { background: var(--bg-info); color: var(--text-info); }
  .badge-di   { background: var(--bg-warning); color: var(--text-warning); }
  .badge-vec  { background: #f1ecfb; color: #5b3a99; }

  /* Cross-cutting vector beams content */
  .vector-block { border: 0.5px solid var(--fs-border); border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden; background: var(--bg-primary); }
  .vector-block-head { padding: 8px 14px; font-size: 12px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 8px; }
  .vector-block.v-sanitation  .vector-block-head { background: var(--beam-sanitation); }
  .vector-block.v-crosscontam .vector-block-head { background: var(--beam-crosscontam); }
  .vector-block.v-waste       .vector-block-head { background: var(--beam-waste); }
  .vector-block.v-labelling   .vector-block-head { background: var(--beam-labelling); }
  .vector-block.v-nutrition   .vector-block-head { background: var(--beam-nutrition); }
  .vector-block.v-tempcontrol .vector-block-head { background: var(--beam-tempcontrol); }
  .vector-block.v-handhygiene .vector-block-head { background: var(--beam-handhygiene); }

  /* Commodity sub-filter (Producers column) */
  .commodity-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }
  .commodity-btn { padding: 7px 13px; font-size: 12px; font-weight: 500; border-radius: var(--radius-md); border: 1.5px solid var(--fs-border); background: var(--bg-primary); color: var(--text-secondary); cursor: pointer; font-family: var(--font); transition: all 0.15s; }
  .commodity-btn.active { border-color: var(--pillar-1); color: var(--pillar-1); background: #eef6ef; }
  .commodity-panel { display: none; border: 0.5px solid var(--fs-border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 1rem; background: var(--bg-secondary); font-size: 12.5px; }
  .commodity-panel.active { display: block; }
  .commodity-panel .cp-cite { font-family: var(--font-mono); font-size: 11px; color: var(--text-info); display: block; margin: 4px 0 6px; }

  /* State dropdown */
  .state-select-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 1.5rem; flex-wrap: wrap; }
  .state-select-wrap label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
  .state-select {
    flex: 1; min-width: 200px; padding: 9px 14px; font-size: 13px; font-family: var(--font);
    background: var(--bg-primary); color: var(--text-primary);
    border: 0.5px solid var(--fs-border); border-radius: var(--radius-md); cursor: pointer;
  }
  .state-overlay { display: none; border: 2px solid var(--pillar-3); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; background: #eef5fc; box-shadow: 0 2px 10px rgba(31,95,168,0.08); }
  .state-overlay.visible { display: block; }
  .state-overlay h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--pillar-3); display: flex; align-items: center; gap: 6px; }
  .state-overlay-row { font-size: 12.5px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 0.5px solid rgba(31,95,168,0.15); }
  .state-overlay-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
  .state-overlay-row .so-title { font-weight: 600; display: block; margin-bottom: 2px; }
  .state-overlay-row .so-cite { font-family: var(--font-mono); font-size: 11px; color: var(--text-info); display: block; margin: 2px 0 4px; }
  .state-overlay-empty { font-size: 12.5px; color: var(--text-secondary); }
 
  /* Tables */
  .tbl-wrap { border: 0.5px solid var(--fs-border); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-primary); margin-bottom: 1rem; }
  .fs-app table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .fs-app th { text-align: left; padding: 9px 12px; background: var(--bg-secondary); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); border-bottom: 0.5px solid var(--fs-border); }
  .fs-app td { padding: 10px 12px; vertical-align: top; border-bottom: 0.5px solid var(--fs-border); color: var(--text-primary); line-height: 1.55; }
  .fs-app tr:last-child td { border-bottom: none; }
  .fs-app td:first-child { font-weight: 500; color: var(--text-secondary); width: 23%; }
  .fs-app td:nth-child(2) { width: 27%; font-family: var(--font-mono); font-size: 11px; color: var(--text-info); }
  .fs-app td:nth-child(3) { width: 50%; }
 
  /* State compliance sub-table */
  .state-section-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-secondary); padding: 8px 12px 4px;
    border-top: 0.5px solid var(--fs-border); background: var(--bg-secondary);
  }
  .state-row td:first-child { color: var(--text-info); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
  .state-row { background: #f7fbff; box-shadow: inset 3px 0 0 var(--pillar-3); }
  .state-row td { padding-left: 9px; }
  .state-empty-label { font-size: 12px; color: var(--text-secondary); font-style: italic; padding: 10px 12px; text-align: center; }
 
  /* Cross connectors */
  .cross-section { margin-top: 2rem; }
  .cross-header { font-size: 15px; font-weight: 500; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 0.5px solid var(--fs-border); display: flex; align-items: center; gap: 8px; }
  .cross-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
  .cross-card { border: 0.5px solid var(--fs-border); border-radius: var(--radius-lg); padding: 1rem 1.125rem; background: var(--bg-primary); }
  .cross-card-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
  .cross-card-trigger { font-size: 11px; color: var(--text-secondary); margin-bottom: 10px; font-style: italic; }
  .cross-card-body { font-size: 12.5px; color: var(--text-primary); line-height: 1.65; margin-bottom: 10px; }
  .nodes-affected { display: flex; flex-wrap: wrap; gap: 4px; }
  .cross-badge { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: var(--radius-md); font-weight: 500; }

  /* ════════════════════════════════════════════════════════════════════
     GUIDED JOURNEY ("3D movie") MODE — added in v4
     ════════════════════════════════════════════════════════════════════ */

  /* Intro + mode toggle */
  .intro-lede { font-size: 14.5px; color: var(--text-primary); line-height: 1.7; max-width: 760px; margin: 0 auto 1.25rem; text-align: center; }
  .intro-lede strong { color: var(--text-primary); }
  .mode-toggle { display: flex; justify-content: center; gap: 0; margin: 0 auto 1.75rem; max-width: 460px; border: 1px solid var(--fs-border); border-radius: 999px; overflow: hidden; background: var(--bg-secondary); }
  .mode-btn { flex: 1; padding: 10px 14px; font-size: 13px; font-weight: 600; font-family: var(--font); border: none; background: transparent; color: var(--text-secondary); cursor: pointer; transition: all 0.18s; display: flex; align-items: center; justify-content: center; gap: 7px; }
  .mode-btn.active { background: var(--text-primary); color: #fff; }
  .mode-btn .mb-sub { font-weight: 400; font-size: 11px; opacity: 0.8; }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

  /* ── Cinematic 3D hero map ───────────────────────────────────────── */
  .hero { margin: 0 -1.5rem 2rem; position: relative; }
  .hero-cinema {
    position: relative; height: 340px; overflow: hidden;
    border-radius: 0; perspective: 1300px; perspective-origin: 50% 45%;
    background:
      radial-gradient(120% 110% at 50% -20%, #cfe2f4 0%, #dde9f3 30%, #e9f0e2 56%, #dde9cf 100%);
    cursor: grab;
  }
  .hero-cinema::before { /* sun glow */
    content: ""; position: absolute; top: -90px; left: 50%; width: 360px; height: 360px;
    transform: translateX(-50%); border-radius: 50%;
    background: radial-gradient(circle, rgba(255,247,214,0.9) 0%, rgba(255,247,214,0) 70%);
    pointer-events: none;
  }
  .hero-cinema::after { /* cinematic vignette + letterbox feel */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    box-shadow: inset 0 60px 80px -40px rgba(20,30,15,0.18), inset 0 -90px 90px -40px rgba(20,30,15,0.32);
  }
  .hero-stage {
    position: absolute; left: 50%; top: 50%; width: 92%; height: 220px;
    transform: translateX(-50%) rotateX(calc(46deg + var(--rx,0deg))) rotateY(var(--ry,0deg)) translateZ(-10px);
    transform-style: preserve-3d; transition: transform 0.25s ease-out;
  }
  .hero-ground { /* receding field grid */
    position: absolute; inset: -40% -10%; transform: translateZ(-2px);
    background-image:
      linear-gradient(rgba(60,100,40,0.18) 1px, transparent 1px),
      linear-gradient(90deg, rgba(60,100,40,0.14) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(120% 80% at 50% 30%, #000 35%, transparent 80%);
            mask-image: radial-gradient(120% 80% at 50% 30%, #000 35%, transparent 80%);
  }
  .hero-line { /* the supply-chain road */
    position: absolute; top: 50%; left: 4%; width: 92%; height: 30px; transform: translateY(-50%) translateZ(1px);
    border-radius: 20px;
    background: linear-gradient(90deg, var(--pillar-1), var(--pillar-2), var(--pillar-3), var(--pillar-4), var(--pillar-5), var(--pillar-6));
    box-shadow: 0 14px 26px -10px rgba(20,30,15,0.5);
    overflow: hidden;
  }
  .hero-line::after { /* animated flowing dashes = motion / "movie" */
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,0.85) 0 14px, rgba(255,255,255,0) 14px 40px);
    opacity: 0.55; animation: flow 1.6s linear infinite;
  }
  @keyframes flow { to { background-position: 40px 0; } }
  .hero-beam { /* faint cross-cutting vector threads under the road */
    position: absolute; left: 4%; width: 92%; height: 2px; transform: translateZ(0.5px);
    opacity: 0.4; border-radius: 2px;
  }
  .hero-station {
    position: absolute; top: 50%; transform: translate(-50%, -50%) translateZ(2px);
    transform-style: preserve-3d; border: none; background: transparent; cursor: pointer; padding: 0;
  }
  .hs-disc {
    width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 27px; background: #fff; border: 3px solid var(--pc);
    box-shadow: 0 10px 18px -6px rgba(20,30,15,0.45), 0 0 0 6px rgba(255,255,255,0.55);
    transition: transform 0.2s;
  }
  .hero-station:hover .hs-disc { transform: translateZ(28px) scale(1.08); }
  .hs-num { position: absolute; top: -8px; right: -8px; width: 19px; height: 19px; border-radius: 50%; background: var(--pc); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
  .hs-label {
    position: absolute; top: 64px; left: 50%; transform: translateX(-50%) rotateX(calc(-46deg - var(--rx,0deg)));
    white-space: nowrap; font-size: 11px; font-weight: 700; color: #243018;
    background: rgba(255,255,255,0.82); padding: 2px 8px; border-radius: 6px; backdrop-filter: blur(2px);
  }
  .hero-token { /* the food traveling the chain (position driven by JS) */
    position: absolute; top: 50%; left: 6%; transform: translate(-50%,-50%) translateZ(16px);
    font-size: 26px; filter: drop-shadow(0 8px 8px rgba(0,0,0,0.35)); will-change: left;
  }
  .hero-station.lit .hs-disc {
    transform: translateZ(26px) scale(1.14);
    box-shadow: 0 16px 24px -6px rgba(20,30,15,0.5), 0 0 0 6px rgba(255,255,255,0.6), 0 0 0 13px color-mix(in srgb, var(--pc) 38%, transparent);
  }
  .hero-station.lit .hs-label { background: var(--pc); color: #fff; }
  @keyframes travel {
    0%   { left: 6%;  } 8% { left: 6%; }
    20% { left: 24.4%; } 28% { left: 24.4%; }
    40% { left: 42.8%; } 48% { left: 42.8%; }
    60% { left: 61.2%; } 68% { left: 61.2%; }
    80% { left: 79.6%; } 88% { left: 79.6%; }
    100% { left: 94%; }
  }
  .hero-overlay { position: absolute; left: 0; right: 0; top: 22px; text-align: center; pointer-events: none; padding: 0 1rem; }
  .hero-overlay h2 { font-size: 22px; font-weight: 700; color: #1d2a12; margin-bottom: 4px; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
  .hero-overlay p { font-size: 13px; color: #3a4a28; }
  .hero-hint { position: absolute; top: 82px; left: 0; right: 0; text-align: center; font-size: 11px; color: #44552f; pointer-events: none; opacity: 0.8; }
  @media (prefers-reduced-motion: reduce) { .hero-token, .hero-line::after { animation: none; } }
  @media (max-width: 720px) {
    .hero { margin-left: -1.5rem; margin-right: -1.5rem; }
    .hero-cinema { height: 300px; }
    .hero-stage { top: 50%; }
    .hs-disc { width: 40px; height: 40px; font-size: 18px; }
    .hs-num { width: 16px; height: 16px; font-size: 9px; }
    .hs-label { display: none; }           /* names would overlap — shown live in caption + progress rail */
    .hero-overlay h2 { font-size: 17px; }
    .hero-token { font-size: 22px; }
  }

  /* ── Legend = interactive lens filter ───────────────────────────── */
  .legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-bottom: 2rem; }
  .legend-cap { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-right: 2px; }
  .legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-family: var(--font); color: var(--text-secondary); background: var(--bg-secondary); border: 1px solid var(--fs-border); padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: all 0.15s; }
  .legend-item:hover { border-color: var(--text-primary); }
  .legend-item.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
  .legend-item.active .legend-dot { box-shadow: 0 0 0 2px rgba(255,255,255,0.45); }
  .legend-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
  .legend-dot i { font-size: 9px; color: #fff; }
  .legend-hint { flex-basis: 100%; text-align: center; font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; min-height: 14px; font-style: italic; }

  /* ── Sticky progress rail ────────────────────────────────────────── */
  .journey-progress { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border-bottom: 0.5px solid var(--fs-border); padding: 9px 0; margin: 0 -1.5rem 1.5rem; }
  .jp-inner { display: flex; align-items: center; gap: 4px; max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; overflow-x: auto; }
  .jp-step { flex: 1 1 0; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; opacity: 0.45; transition: opacity 0.2s; }
  .jp-step.active { opacity: 1; }
  .jp-dot { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--jc); display: flex; align-items: center; justify-content: center; font-size: 14px; transition: transform 0.2s; }
  .jp-step.active .jp-dot { transform: scale(1.14); box-shadow: 0 0 0 4px color-mix(in srgb, var(--jc) 20%, transparent); }
  .jp-label { font-size: 9.5px; font-weight: 600; color: var(--text-secondary); text-align: center; white-space: nowrap; }
  .jp-step.active .jp-label { color: var(--jc); }
  .jp-line { flex: 0 0 14px; height: 2px; background: var(--fs-border); align-self: flex-start; margin-top: 14px; }
  @media (max-width: 720px) { .jp-label { display: none; } .jp-step { min-width: 40px; } }

  /* ── Story scenes ────────────────────────────────────────────────── */
  .scene { scroll-margin-top: 64px; margin-bottom: 2.25rem; border: 0.5px solid var(--fs-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-primary); box-shadow: 0 1px 3px rgba(20,30,15,0.04); }
  .scene-banner { display: flex; align-items: center; gap: 16px; padding: 1.35rem 1.5rem; position: relative; overflow: hidden; color: var(--text-primary);
    background: linear-gradient(120deg, color-mix(in srgb, var(--pc) 15%, #fff) 0%, color-mix(in srgb, var(--pc) 5%, #fff) 55%, #fff 100%);
    border-bottom: 1px solid color-mix(in srgb, var(--pc) 22%, #fff); }
  .scene-badge { flex: 0 0 auto; width: 58px; height: 58px; border-radius: 17px; display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(150deg, var(--pc), color-mix(in srgb, var(--pc) 60%, #000));
    box-shadow: 0 9px 20px -8px color-mix(in srgb, var(--pc) 70%, transparent); transition: transform 0.3s cubic-bezier(0.34,1.4,0.5,1); }
  .scene:hover .scene-badge { transform: rotate(-4deg) scale(1.05); }
  .scene-badge .stg-ic { width: 30px; height: 30px; }
  .scene-step { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: color-mix(in srgb, var(--pc) 70%, #000); }
  .scene-banner h2 { font-size: 21px; font-weight: 700; margin: 2px 0 3px; color: var(--text-primary); }
  .scene-tagline { font-size: 13.5px; color: var(--text-secondary); font-weight: 400; line-height: 1.4; }
  .scene-body { padding: 1.4rem 1.5rem; }
  .scene-plain { font-size: 14.5px; line-height: 1.75; color: var(--text-primary); margin-bottom: 1.25rem; }
  .scene-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.5rem; }
  @media (max-width: 620px) { .scene-cards { grid-template-columns: 1fr; } }
  .scene-card { border: 0.5px solid var(--fs-border); border-radius: var(--radius-md); padding: 12px 14px; font-size: 12.5px; line-height: 1.6; color: var(--text-primary); }
  .scene-card h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
  .scene-card.who { background: var(--bg-secondary); }
  .scene-card.who h4 { color: var(--text-secondary); }
  .scene-card.risk { background: var(--bg-warning); }
  .scene-card.risk h4 { color: var(--text-warning); }
  .rules-h { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
  .plain-rules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1.5rem; }
  .prule { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 0.5px solid var(--fs-border); border-radius: var(--radius-md); background: var(--bg-primary); transition: opacity 0.25s, filter 0.25s; }
  .prule-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; }
  .prule-dot i { font-size: 10px; color: #fff; }
  /* Lens filter: dim rules that don't match the chosen path */
  #scenesMount[data-lensfilter="food"] .prule:not(.lens-food),
  #scenesMount[data-lensfilter="tech"] .prule:not(.lens-tech),
  #scenesMount[data-lensfilter="di"]   .prule:not(.lens-di) { opacity: 0.25; filter: grayscale(0.7); }
  .prule-text { font-size: 13px; line-height: 1.55; color: var(--text-primary); }
  .prule-cite { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-secondary); background: var(--bg-secondary); padding: 1px 7px; border-radius: 4px; margin-left: 4px; white-space: nowrap; }
  .scene-expand { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; font-size: 12.5px; font-weight: 600; font-family: var(--font); border: 1.5px solid var(--pc); color: var(--pc); background: transparent; border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s; }
  .scene-expand:hover { background: var(--pc); color: #fff; }

  /* ── Threads (cross-cutting vectors, plain) ──────────────────────── */
  .threads { margin: 2.5rem 0; }
  .threads h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }

  .threads-lede { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 1.25rem; max-width: 720px; }
  .thread-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
  .thread-card { border: 0.5px solid var(--fs-border); border-left: 4px solid var(--tc); border-radius: var(--radius-md); padding: 12px 14px; background: var(--bg-primary); }
  .thread-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
  .thread-card p { font-size: 12.5px; line-height: 1.6; color: var(--text-secondary); }
  .thread-ico { font-size: 16px; }

  /* Sexual harassment vector beam */
  #catalogMode .vector-block.v-harassment .vector-block-head { background: var(--beam-harassment); }


  /* ── "One mistake spreads" callout ───────────────────────────────── */
  .chain-callout { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(115deg, #102a1c, #1c3a26); color: #eaf3de; border-radius: var(--radius-lg); padding: 1.3rem 1.5rem; margin: 2rem 0; }
  .chain-callout .cc-ico { font-size: 30px; flex-shrink: 0; }
  .chain-callout h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
  .chain-callout p { font-size: 13px; line-height: 1.65; opacity: 0.92; }
  .catalog-note { font-size: 12.5px; color: var(--text-info); background: var(--bg-info); border: 0.5px solid rgba(24,95,165,0.25); border-radius: var(--radius-md); padding: 11px 14px; margin-bottom: 1.5rem; }

  /* ── Commodity cards inside a scene ──────────────────────────────── */
  .commodity-h { font-size: 13px; font-weight: 700; color: var(--text-primary); margin: 1.5rem 0 10px; }
  .commodity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
  .commodity-card { border: 0.5px solid var(--fs-border); border-radius: var(--radius-md); padding: 12px 13px; background: var(--bg-secondary); }
  .commodity-card .cm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .commodity-card .cm-ico { font-size: 19px; }
  .commodity-card .cm-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
  .commodity-card p { font-size: 12px; line-height: 1.55; color: var(--text-secondary); margin-bottom: 8px; }
  .commodity-card .cm-cite { font-family: var(--font-mono); font-size: 10px; color: var(--text-info); background: var(--bg-primary); border: 0.5px solid var(--fs-border); padding: 1px 7px; border-radius: 4px; }

  /* ════════════════════════════════════════════════════════════════════
     ALL COMPLIANCE — cohesive redesign (v4)
     ════════════════════════════════════════════════════════════════════ */
  #catalogMode .search-input { padding: 11px 14px; border-radius: var(--radius-md); border: 1px solid var(--fs-border); }
  #catalogMode .search-input:focus { border-color: var(--text-info); box-shadow: 0 0 0 3px rgba(24,95,165,0.1); }
  #catalogMode .search-btn { border: 1px solid var(--fs-border); font-weight: 600; }
  #catalogMode .state-select { padding: 11px 14px; border: 1px solid var(--fs-border); border-radius: var(--radius-md); }
  #catalogMode .state-select:focus { border-color: var(--text-info); outline: none; }

  /* Pillar tabs as a clean stepper that mirrors the journey */
  #catalogMode .pillar-grid { border: none; border-radius: 0; gap: 0; background: transparent; overflow: visible; flex-wrap: wrap; margin-bottom: 1.75rem; }
  #catalogMode .pillar {
    flex: 1 1 0; min-width: 120px; background: var(--bg-secondary); border: 1px solid var(--fs-border);
    border-radius: var(--radius-md); margin: 0 4px; padding: 11px 8px; display: flex; flex-direction: column;
    align-items: center; gap: 3px; line-height: 1.25; box-shadow: none;
  }
  #catalogMode .pillar:hover { border-color: var(--pillar-color); background: var(--bg-primary); }
  #catalogMode .pillar.active {
    background: var(--bg-primary); color: var(--pillar-color); border-color: var(--pillar-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pillar-color) 16%, transparent), inset 0 -3px 0 var(--pillar-color);
  }
  #catalogMode .pillar-icon { margin: 0; font-size: 20px; }
  #catalogMode .pillar-sep { display: none; }

  /* Node header gets a colored cinematic band like the journey scenes */
  #catalogMode .node-header { border: 0.5px solid var(--fs-border); border-left: 5px solid var(--pillar-color, var(--text-secondary)); box-shadow: 0 1px 3px rgba(20,30,15,0.04); padding: 1.1rem 1.25rem; }
  #catalogMode .node-icon { background: var(--bg-secondary); }
  #catalogMode .node-title { font-size: 17px; font-weight: 600; }

  /* Category tabs as a segmented control */
  #catalogMode .layer-tabs { border: 1px solid var(--fs-border); border-radius: 999px; padding: 3px; gap: 3px; background: var(--bg-secondary); overflow: visible; }
  #catalogMode .layer-tab { border: none; border-radius: 999px; padding: 8px 6px; transition: background 0.15s, color 0.15s; }
  #catalogMode .layer-tab .badge { background: transparent; padding: 0; color: inherit; font-weight: 600; }
  #catalogMode .layer-tab.active { background: var(--text-primary); }
  #catalogMode .layer-tab.active .badge { color: #fff; }
  @media (max-width: 860px) { #catalogMode .layer-tabs { border-radius: var(--radius-md); } #catalogMode .layer-tab { border-radius: var(--radius-md); } }

  /* Tables: cleaner, with hover */
  #catalogMode .tbl-wrap { border-radius: var(--radius-md); box-shadow: 0 1px 3px rgba(20,30,15,0.03); }
  #catalogMode tbody tr { transition: background 0.1s; }
  #catalogMode tbody tr:hover td { background: var(--bg-secondary); }
  #catalogMode th { font-size: 10.5px; }
  #catalogMode .commodity-btn { padding: 8px 14px; border-radius: 999px; }

  /* Cross-connector cards */
  #catalogMode .cross-card { box-shadow: 0 1px 3px rgba(20,30,15,0.04); transition: box-shadow 0.15s, transform 0.15s; }
  #catalogMode .cross-card:hover { box-shadow: 0 6px 18px -8px rgba(20,30,15,0.2); transform: translateY(-2px); }

  /* Live "you are here" caption inside the hero */
  #heroNow { font-size: 13px; font-weight: 600; color: #243018; min-height: 18px; transition: color 0.2s; }
  #heroNow .hn-pin { opacity: 0.7; }

  /* Closing payoff at the end of the journey */
  .journey-end { text-align: center; padding: 1.75rem 1.5rem; margin: 0.5rem 0 1rem; border-radius: var(--radius-lg); background: linear-gradient(115deg, var(--bg-success), #f3f8ec); border: 0.5px solid var(--fs-border); }
  .journey-end .je-emoji { font-size: 34px; }
  .journey-end h3 { font-size: 17px; font-weight: 700; margin: 6px 0 6px; color: var(--text-success); }
  .journey-end p { font-size: 13.5px; color: var(--text-primary); max-width: 600px; margin: 0 auto 14px; line-height: 1.7; }
  .journey-end .je-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; font-size: 13px; font-weight: 600; font-family: var(--font); border: none; border-radius: 999px; background: var(--text-primary); color: #fff; cursor: pointer; }

  /* ════════════════════════════════════════════════════════════════════
     FLOW HERO — horizontal journey map (v5 reframe)
     ════════════════════════════════════════════════════════════════════ */
  .flow-hero { padding: 1.6rem 1.5rem 1.9rem; position: relative; overflow: hidden;
    background: linear-gradient(120deg, #ecfdf3 0%, #eff8ff 33%, #f2efff 64%, #fff1f4 100%); }
  .flow-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(90% 70% at 50% -15%, rgba(255,255,255,0.65), transparent 70%); }
  .flow-head { text-align: center; margin-bottom: 1.7rem; position: relative; }
  .flow-head h2 { font-size: 23px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
  .flow-head #heroNow { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-top: 3px; min-height: 18px; }
  .flow-head #heroNow strong { color: var(--text-primary); }

  .flow-track { display: flex; align-items: flex-start; max-width: 1080px; margin: 0 auto; position: relative; }
  .flow-node { flex: 0 0 auto; width: 110px; display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: none; padding: 0; cursor: pointer; font-family: var(--font); opacity: 0; animation: fnIn 0.55s ease forwards; }
  @keyframes fnIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  .fn-badge { position: relative; width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(125% 125% at 30% 22%, #ffffff 0%, color-mix(in srgb, var(--c) 15%, #fff) 100%);
    border: 2px solid color-mix(in srgb, var(--c) 38%, #fff);
    box-shadow: 0 6px 16px -9px color-mix(in srgb, var(--c) 55%, transparent), inset 0 1px 2px rgba(255,255,255,0.9);
    transition: transform 0.3s cubic-bezier(0.34,1.45,0.5,1), box-shadow 0.3s, border-color 0.3s, background 0.35s; }
  .fn-badge .stg-ic { width: 30px; height: 30px; color: color-mix(in srgb, var(--c) 66%, #000); transition: color 0.3s; }
  .fn-num { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: color-mix(in srgb, var(--c) 68%, #000); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); border: 1.5px solid color-mix(in srgb, var(--c) 28%, #fff); }
  .fn-meta { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .fn-name { font-size: 13px; font-weight: 700; color: var(--text-primary); text-align: center; line-height: 1.2; transition: color 0.25s; }
  .fn-desc { font-size: 10.5px; color: var(--text-secondary); text-align: center; line-height: 1.25; }
  .flow-node:hover .fn-badge { transform: translateY(-5px); border-color: color-mix(in srgb, var(--c) 66%, #fff);
    box-shadow: 0 14px 24px -10px color-mix(in srgb, var(--c) 58%, transparent), inset 0 1px 2px rgba(255,255,255,0.9); }
  .flow-node:active .fn-badge { transform: translateY(-2px) scale(0.96); }
  .flow-node.active .fn-badge { transform: translateY(-7px) scale(1.06); border-color: transparent;
    background: linear-gradient(150deg, var(--c), color-mix(in srgb, var(--c) 60%, #000));
    box-shadow: 0 16px 28px -10px color-mix(in srgb, var(--c) 72%, transparent), 0 0 0 5px color-mix(in srgb, var(--c) 14%, transparent); }
  .flow-node.active .fn-badge .stg-ic { color: #fff; }
  .flow-node.active .fn-name { color: color-mix(in srgb, var(--c) 70%, #000); }

  .flow-connector { flex: 1 1 auto; min-width: 26px; height: 5px; align-self: flex-start; margin-top: 32px; border-radius: 5px; background: rgba(20,30,15,0.08); position: relative; overflow: hidden; transition: background 0.5s; }
  .flow-connector.filled { background: color-mix(in srgb, var(--flow) 58%, #fff); }
  .flow-connector::after { content: ""; position: absolute; top: 0; left: -35%; width: 35%; height: 100%; border-radius: 5px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--flow) 85%, #fff), transparent); animation: flowPulse 2.4s linear infinite; }
  @keyframes flowPulse { to { left: 135%; } }
  @media (prefers-reduced-motion: reduce) { .flow-connector::after { animation: none; opacity: 0.5; } .flow-node { animation: none; opacity: 1; } }

  @media (max-width: 640px) {
    .flow-hero { padding: 1.3rem 1.25rem 1.5rem; }
    .flow-track { flex-direction: column; align-items: stretch; max-width: 360px; }
    .flow-node { flex-direction: row; width: 100%; gap: 14px; align-items: center; justify-content: flex-start; }
    .fn-badge { width: 52px; height: 52px; flex: 0 0 52px; }
    .fn-badge .stg-ic { width: 26px; height: 26px; }
    .fn-meta { align-items: flex-start; }
    .fn-name, .fn-desc { text-align: left; }
    .flow-connector { flex: 0 0 22px; width: 5px; height: 22px; align-self: flex-start; margin: 2px 0 2px 23px; }
    .flow-connector::after { left: 0; top: -35%; width: 100%; height: 35%; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--flow) 85%, #fff), transparent); animation: flowPulseV 2.4s linear infinite; }
    @keyframes flowPulseV { to { top: 135%; } }
  }

  /* ── Stage SVG marks: sizing + color per context ─────────────────── */
  .stg-ic { display: block; }
  .jp-dot .stg-ic { width: 15px; height: 15px; color: var(--jc); }
  #catalogMode .pillar-icon { margin: 0; }
  #catalogMode .pillar-icon .stg-ic { width: 21px; height: 21px; color: var(--pillar-color); }
  #catalogMode .node-icon .stg-ic { width: 26px; height: 26px; }

  /* ── Micro-interactions across the document (subtle, professional) ── */
  .scene { transition: box-shadow 0.25s; }
  .scene-card { transition: transform 0.2s, box-shadow 0.2s; }
  .scene-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -11px rgba(20,30,15,0.3); }
  .prule { transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s, opacity 0.25s, filter 0.25s; }
  .prule:hover { transform: translateX(3px); border-color: rgba(20,30,15,0.22); box-shadow: 0 5px 14px -10px rgba(20,30,15,0.4); }
  .commodity-card { transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
  .commodity-card:hover { transform: translateY(-2px); border-color: rgba(20,30,15,0.22); box-shadow: 0 8px 16px -11px rgba(20,30,15,0.3); }
  .thread-card { transition: transform 0.2s, box-shadow 0.2s; }
  .thread-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -11px rgba(20,30,15,0.26); }
  .legend-item { transition: transform 0.15s, border-color 0.15s, background 0.15s, color 0.15s; }
  .legend-item:hover { transform: translateY(-1px); }
  .mode-btn, .scene-expand, .je-btn, .search-btn, .commodity-btn, .pillar { transition: all 0.18s; }
  .scene-expand:active, .je-btn:active, .mode-btn:active, .search-btn:active, .commodity-btn:active { transform: scale(0.97); }
  .jp-dot { transition: transform 0.2s, box-shadow 0.2s; }
  .jp-step:hover .jp-dot { transform: scale(1.12); }

  /* ════════════════════════════════════════════════════════════════════
     FULL CATALOG — expandable requirement cards (v6)
     ════════════════════════════════════════════════════════════════════ */
  #catalogMode .node-header { background: linear-gradient(120deg, color-mix(in srgb, var(--pc) 7%, #fff), #fff 70%); border: 1px solid var(--fs-border); border-left: 4px solid var(--pc); }
  #catalogMode .node-roles { font-size: 11.5px; }

  .req-list { display: flex; flex-direction: column; gap: 8px; }
  .req { border: 1px solid var(--fs-border); border-radius: var(--radius-md); background: var(--bg-primary); overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
  .req:hover { border-color: color-mix(in srgb, var(--pc) 45%, var(--fs-border)); box-shadow: 0 5px 16px -12px rgba(20,30,15,0.5); }
  .req.open { border-color: color-mix(in srgb, var(--pc) 60%, var(--fs-border)); box-shadow: 0 8px 22px -14px rgba(20,30,15,0.45); }
  .req-head { width: 100%; display: flex; align-items: flex-start; gap: 14px; padding: 13px 15px; background: none; border: none; cursor: pointer; text-align: left; font-family: var(--font); }
  .req-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .req-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); line-height: 1.35; }
  .req-cite { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-secondary); background: var(--bg-secondary); border: 0.5px solid var(--fs-border); padding: 2px 8px; border-radius: 5px; align-self: flex-start; max-width: 100%; line-height: 1.5; }
  .req-chev { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); background: var(--bg-secondary); margin-top: 1px; font-size: 13px;
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1), background 0.2s, color 0.2s; }
  .req-head:hover .req-chev { background: color-mix(in srgb, var(--pc) 14%, var(--bg-secondary)); color: var(--pc); }
  .req.open .req-chev { transform: rotate(180deg); background: color-mix(in srgb, var(--pc) 16%, var(--bg-secondary)); color: var(--pc); }
  .req-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s cubic-bezier(0.4,0,0.2,1); }
  .req.open .req-body { grid-template-rows: 1fr; }
  .req-body-inner { overflow: hidden; }
  .req-body-inner p { font-size: 13px; line-height: 1.68; color: var(--text-primary); margin: 0 15px 15px; padding-top: 12px; border-top: 0.5px solid var(--fs-border); }

  .state-sec { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); padding: 12px 2px 2px; display: flex; align-items: center; gap: 8px; }
  .state-sec::before { content: ""; flex: 0 0 14px; height: 2px; border-radius: 2px; background: var(--pc); }

  /* Category tabs: counts */
  .tab-count { display: inline-block; margin-left: 7px; min-width: 19px; padding: 0 6px; height: 17px; line-height: 17px; font-size: 10px; font-weight: 700; border-radius: 999px; background: rgba(20,30,15,0.09); color: var(--text-secondary); text-align: center; vertical-align: 1px; }
  #catalogMode .layer-tab.active .tab-count { background: rgba(255,255,255,0.28); color: #fff; }

  /* Cross-cutting vector blocks: single slate theme */
  #catalogMode .vector-block { border: 1px solid var(--fs-border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 12px; }
  #catalogMode .vector-block-head { justify-content: space-between; padding: 10px 15px; font-size: 12.5px; letter-spacing: 0.01em; }
  .vb-count { background: rgba(255,255,255,0.26); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; }

  /* ════════════════════════════════════════════════════════════════════
     v7 — micro-precise polish pass
     ════════════════════════════════════════════════════════════════════ */
  .fs-app { --brand: #1868DB; --brand-dark: #1257c0; --brand-tint: #eaf1fc; }

  /* Wider canvas, tighter side gutters */
  .fs-app .page { max-width: 1320px; padding: 1.5rem 1.25rem 3.5rem; }

  /* Centered, prominent heading */
  .fs-app h1 { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 6px; }
  .fs-app .subtitle { text-align: center; font-size: 15px; max-width: 680px; margin: 0 auto 1.5rem; }

  /* Brand buttons (replace black) */
  .mode-btn.active { background: var(--brand); color: #fff; }
  .legend-item.active { background: var(--brand); border-color: var(--brand); color: #fff; }
  .legend-item.active .legend-dot { box-shadow: 0 0 0 2px rgba(255,255,255,0.5); }
  .je-btn { background: var(--brand); }
  #catalogMode .layer-tab.active { background: var(--brand); }

  /* Larger, more readable text */
  .req-title { font-size: 14.5px; }
  .req-body-inner p { font-size: 14px; line-height: 1.7; }
  .req-cite { font-size: 11.5px; }
  .prule-text { font-size: 14px; }
  .scene-card { font-size: 14px; }
  .scene-plain { font-size: 15px; }
  .thread-card p { font-size: 14px; }
  .commodity-card p { font-size: 13.5px; }
  .node-roles { font-size: 12.5px; }
  .node-sub { font-size: 13px; color: var(--text-secondary); margin: 2px 0 6px; }

  /* Seamless hovers — no border/shadow jumps */
  .req, .req:hover, .req.open { box-shadow: none; }
  .scene-card, .commodity-card, .thread-card { transition: background 0.2s; }
  .scene-card:hover, .commodity-card:hover, .thread-card:hover { transform: none; box-shadow: none; }

  /* Commodity cards: lighter grey, citation without a white box */
  .commodity-card { background: color-mix(in srgb, var(--text-primary) 3%, #fff); border-color: transparent; }
  .commodity-card .cm-cite { background: transparent; border: none; padding: 0; color: var(--text-secondary); }
  .cm-ico .stg-ic { width: 18px; height: 18px; color: var(--pc); }
  .cm-head { gap: 9px; }

  /* Icon sizing for the new vector marks */
  .scene-card h4 .stg-ic { width: 15px; height: 15px; }
  .je-emoji .stg-ic { width: 34px; height: 34px; color: var(--text-success); margin: 0 auto; }
  .hn-pin .stg-ic { width: 13px; height: 13px; vertical-align: -2px; display: inline-block; }

  /* Compact, brand-tinted control bar: search + state side by side */
  .catalog-controls { display: flex; gap: 14px; align-items: stretch; margin-bottom: 1.25rem; }
  .catalog-controls .search-bar { flex: 1 1 50%; position: relative; margin: 0; gap: 0; }
  .catalog-controls .state-select-wrap { flex: 1 1 50%; position: relative; margin: 0; }
  .search-ico, .state-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 17px; pointer-events: none; z-index: 2; }
  .search-ico { color: var(--text-secondary); }
  .state-ico { color: var(--brand); }
  /* ID-scoped so it beats the earlier #catalogMode .search-input rule */
  #catalogMode .catalog-controls .search-input { width: 100%; padding: 12px 70px 12px 42px; border: 1px solid var(--fs-border); border-radius: 11px; font-size: 14px; background: #fff; }
  #catalogMode .catalog-controls .search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
  .catalog-controls .search-clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); border: none; background: transparent; padding: 4px 8px; }
  /* State filter styled as a distinct brand control, not a twin of the search box */
  #catalogMode .catalog-controls .state-select { width: 100%; min-width: 0; padding: 12px 38px 12px 42px; border: 1px solid color-mix(in srgb, var(--brand) 38%, var(--fs-border)); border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--brand-dark); cursor: pointer; background: var(--brand-tint); }
  #catalogMode .catalog-controls .state-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); outline: none; }
  @media (max-width: 720px) { .catalog-controls { flex-direction: column; } }

  /* Threads: centered heading, bigger readable cards */
  .threads { text-align: center; }
  .threads-lede { margin-left: auto; margin-right: auto; }
  .thread-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; text-align: left; }
  @media (max-width: 720px) { .thread-grid { grid-template-columns: 1fr; } }
  .thread-card { display: flex; align-items: flex-start; gap: 15px; padding: 20px 22px; border-radius: 16px; border: 1px solid var(--fs-border); border-left: 1px solid var(--fs-border); }
  .thread-ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--tc) 12%, #fff); color: var(--tc); }
  .thread-ico .stg-ic { width: 22px; height: 22px; }
  .thread-card h4 { font-size: 15.5px; font-weight: 700; margin-bottom: 5px; }
  .thread-card p { line-height: 1.6; color: var(--text-secondary); }

  /* State-of-the-art separator style: one panel, hairline-separated rows (not many boxes) */
  #catalogMode .req-list { gap: 0; border: 1px solid var(--fs-border); border-radius: 14px; background: #fff; overflow: hidden; }
  #catalogMode .req { border: none; border-radius: 0; border-bottom: 1px solid var(--fs-border); background: transparent; }
  #catalogMode .req:last-child { border-bottom: none; }
  #catalogMode .req:hover { background: color-mix(in srgb, var(--pc) 4%, #fff); border-color: var(--fs-border); }
  #catalogMode .req.open { background: color-mix(in srgb, var(--pc) 3%, #fff); border-color: var(--fs-border); }
  #catalogMode .req-list-vec { border: none; border-radius: 0; background: transparent; }
  #catalogMode .state-sec { padding: 14px 16px 8px; }

  /* Connected tab: content panel reads as attached to the active stage */
  #catalogMode .node-content.active { border-top: 3px solid var(--pc); border-radius: 0 0 14px 14px; padding-top: 4px; margin-top: 2px; }
  #catalogMode .node-header { border-top: none; }
  #catalogMode .node-header { display: flex; align-items: flex-start; gap: 14px; }
  .node-head-text { flex: 1; }
  .expand-all { flex: 0 0 auto; align-self: center; background: transparent; border: 1px solid var(--fs-border); border-radius: 8px; color: var(--brand); font-size: 12px; font-weight: 600; font-family: var(--font); padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: background 0.15s; }
  .expand-all:hover { background: var(--brand-tint); }

  /* Pillar tabs: clearer active link to its panel */
  #catalogMode .pillar.active { background: color-mix(in srgb, var(--pillar-color) 10%, #fff); }
