Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
claude/adoring-hopper-5x74bqclaude/affectionate-feynman-ykrf1hclaude/architecture-audit-design-wxprenclaude/build-status-update-3MXsfclaude/charming-meitner-mllb5rclaude/compare-gate-gluecron-s4mFQclaude/confident-faraday-tikcwbclaude/continue-work-XMTlIclaude/crontech-gluecron-deploy-7MIECclaude/crontech-platform-setup-SeKfwclaude/design-2026claude/ecstatic-ptolemy-jMdigclaude/enhance-github-integration-QNHdGclaude/fix-aa-loop-issue-PonMQclaude/fix-actions-and-processclaude/fix-desktop-errors-XqoW8claude/fix-red-workflowsclaude/fix-website-access-6FKJNclaude/gatetest-integration-hardeningclaude/github-audit-improvements-bDFr9claude/gluecron-launch-status-FoMRlclaude/hopeful-lamport-olfCTclaude/issue-to-pr-and-protectionsclaude/jolly-heisenberg-2sg1Qclaude/launch-preparation-QmTb6claude/new-session-xk1l7claude/plan-platform-architecture-kkN4yclaude/platform-analysis-roadmap-1nUGLclaude/platform-launch-assessment-8dWV8claude/polish-platform-release-AeDrUclaude/resume-previous-work-KzyLwclaude/review-crontech-handoff-qYEVqclaude/review-project-completeness-lHhS2claude/review-readme-docs-ulqPKclaude/serene-edison-rj87weclaude/setup-multi-repo-dev-BCwNQclaude/ship-fixes-and-tests-Jvz1cclaude/site-audit-competitive-pctlwgclaude/site-migration-vercel-XstpKclaude/standalone-product-repos-XHFTDcopilot/feat-smart-empty-states-keyboard-first-enhancementcopilot/feat-smart-morning-digest-review-context-restorecopilot/fix-and-process-workflowscopilot/update-ai-powered-code-reviewfeat/debt-mapfeat/push-policy-codeowners-hardeningfeat/smart-digest-contextfeat/stage-impactfeat/t1-secret-migrationfeat/u-polishfeat/w-self-hostfeat/w2-claude-configfix/agent-journey-orphan-sweepgatetest/auto-fix-1776586424172gatetest/auto-fix-1776586534814gatetest/auto-fix-1776590685143gatetest/auto-fix-1776590808199mainops/redeploy-retriggerstyle/dxt-cta-themeworktree-agent-a3377aad30d55da26worktree-agent-a7ef607b7ee1d6c74
production-layers.tsx20.3 KB · 779 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
import type { FC } from "hono/jsx";

export interface LayerData {
  name: string;
  tech: string;
  state: "healthy" | "watched";
  detail: string;
  facts: string[];
  fix?: string;
}

export interface ProductionLayersProps {
  layers?: LayerData[];
  user?: any;
}

const DEFAULT_LAYERS: LayerData[] = [
  {
    name: "Frontend foundation",
    tech: "Hono JSX, server-rendered · zero client framework",
    state: "healthy",
    detail:
      "Every page is server-rendered from the same box that serves git. No SPA bundle to break, no hydration drift — first paint is the page.",
    facts: ["p75 paint 240ms", "0 client deps", "themes: light/dark"],
  },
  {
    name: "Request routing",
    tech: "Caddy · TLS termination · path-based routing",
    state: "healthy",
    detail:
      "Caddy terminates TLS and routes by path prefix — no gateway DSL to learn. Certificates auto-renew; routing changes take effect on config reload with zero dropped connections.",
    facts: ["2 edge nodes", "certs auto-renew 71d", "failover < 3s"],
  },
  {
    name: "Auth & identity",
    tech: "Sessions, PATs, OAuth2, passkeys, OIDC SSO",
    state: "healthy",
    detail:
      "Every credential type funnels through one permission resolver. Org/team roles, branch protection, and CODEOWNERS all evaluate in the same place — one model to audit.",
    facts: ["2FA + WebAuthn", "SSO: Okta/Azure/Google", "token scopes: 6"],
  },
  {
    name: "Repo storage",
    tech: "Postgres (Neon) + Drizzle · git objects on disk",
    state: "healthy",
    detail:
      "108 migrations, all additive-first. Git object storage stays plain files on disk — recoverable with nothing but git itself.",
    facts: ["4ms median query", "0 lock waits 24h", "108 migrations"],
  },
  {
    name: "Git protocol",
    tech: "Smart HTTP · pack negotiation · push-time hooks",
    state: "healthy",
    detail:
      "Git Smart HTTP served directly from Bun. Pack negotiation handles shallow clones and partial fetches; post-receive hooks trigger gates and webhooks inline on every push.",
    facts: ["clone p50 1.2s", "push gate: sync", "protocol v2"],
  },
  {
    name: "AI orchestration",
    tech: "Local LLM router · private cloud burst · MCP server",
    state: "healthy",
    detail:
      "PR sandboxes and repair loops run on our own compute pool. The model router prefers local inference and bursts to private cloud only under load — spend is metered per repo.",
    facts: ["62% local inference", "24s sandbox boot", "pool: 8 workers"],
  },
  {
    name: "Gate engine",
    tech: "Push-time gates · 15-pattern secret scan · AI review",
    state: "watched",
    detail:
      "Gates run at the moment of push, not minutes later. 15-pattern secret scan plus AI security review on every push. One policy gap on the new flywheel_telemetry table has a drafted fix awaiting apply.",
    facts: ["gate p99 38s", "0 secrets leaked", "advisory scan: nightly"],
    fix: "Apply RLS policy to flywheel_telemetry",
  },
  {
    name: "Workflow runner",
    tech: ".gluecron/workflows · per-step timeouts · size-capped logs",
    state: "healthy",
    detail:
      "The workflow runner executes .gluecron/workflows with per-step timeouts and size-capped logs. No YAML knowledge required — steps are plain shell commands annotated with timeouts.",
    facts: ["1,412 merges/mo", "0 YAML required", "log cap: 1 MB/step"],
  },
  {
    name: "Package registry",
    tech: "npm-compatible · LRU cache · packuments · tarballs",
    state: "healthy",
    detail:
      "npm-compatible registry served from the same Bun process. Packuments and tarballs are LRU-cached in-process; publish gated by the same permission model as git push.",
    facts: ["hit rate 94%", "publish: gated", "compat: npm/pnpm/yarn"],
  },
  {
    name: "Notification bus",
    tech: "Webhooks · HMAC-SHA256 · event fan-out · retry queue",
    state: "healthy",
    detail:
      "Outbound webhooks sign every payload with HMAC-SHA256. A retry queue handles transient failures; the delivery log is queryable from the repo settings page.",
    facts: ["retry: 3× exp backoff", "HMAC-SHA256", "events: 8 types"],
  },
  {
    name: "Search & index",
    tech: "Full-text · semantic index · code search · regex",
    state: "healthy",
    detail:
      "Full-text search over commit messages, issue bodies, and file contents. Semantic index rebuilt on push; code search supports regex and filename filters with sub-second latency.",
    facts: ["index lag < 5s", "regex: yes", "semantic: per-repo"],
  },
  {
    name: "Telemetry",
    tech: "Request-ID tracing · /metrics · audit log",
    state: "healthy",
    detail:
      "Every request carries an ID from edge to database. Errors correlate to audit entries and gate runs automatically — the support console reads the same trail.",
    facts: ["trace coverage 100%", "retention 90d", "/healthz /readyz"],
  },
  {
    name: "Availability & recovery",
    tech: "Air-gapped region sync · hourly bare-metal replicas",
    state: "watched",
    detail:
      "Repo state, semantic indices, and the package registry replicate hourly to an offline array (0083 data-region rails). EU shard backfill completed; replica lag briefly above target during it — recovering.",
    facts: ["RPO 1h · RTO 15m", "replica lag 4m (target 2m)", "last drill: Jun 20 ✓"],
    fix: "Flush EU shard backlog · estimated 18 min",
  },
];

export const ProductionLayers: FC<ProductionLayersProps> = (props) => {
  const layers = props.layers ?? DEFAULT_LAYERS;
  const watchedCount = layers.filter((l) => l.state === "watched").length;
  const healthyCount = layers.filter((l) => l.state === "healthy").length;

  return (
    <>
      <style dangerouslySetInnerHTML={{ __html: css }} />
      <div class="pl-root">
        <header class="pl-header">
          <a href="/" class="pl-logo">
            <span class="pl-logo-mark"></span>
            gluecron
            <span class="pl-logo-eyebrow">admin</span>
          </a>
          <span class="pl-sep">/</span>
          <span class="pl-breadcrumb">Production layers</span>
          <div class="pl-header-right">
            <span class="pl-summary">
              <span class="pl-summary-dot"></span>
              {layers.length} layers &middot; {healthyCount} healthy &middot; {watchedCount} watched
            </span>
            <span class="pl-avatar">C</span>
          </div>
        </header>

        <main class="pl-main">
          <div class="pl-intro">
            <div class="pl-eyebrow">Infrastructure sovereignty &middot; every layer self-owned</div>
            <h1 class="pl-heading">The whole stack, one board.</h1>
            <p class="pl-desc">
              Thirteen production layers, no magic edge proxies, no external runtime dependencies.
              Each layer is watched by the same repair engine that heals customer pushes &mdash; click
              a layer for its live detail.
            </p>
          </div>

          <div class="pl-rows" id="pl-rows">
            {layers.map((layer, i) => {
              const num = String(i + 1).padStart(2, "0");
              const watched = layer.state === "watched";
              return (
                <div
                  class={`pl-item${watched ? " pl-item--watched" : ""}`}
                  data-index={String(i)}
                >
                  <button
                    type="button"
                    class={`pl-row${watched ? " pl-row--watched" : ""}`}
                    data-index={String(i)}
                    aria-expanded="false"
                    aria-controls={`pl-detail-${i}`}
                  >
                    <span class="pl-row-num">{num}</span>
                    <span class="pl-row-name">{layer.name}</span>
                    <span class="pl-row-tech">{layer.tech}</span>
                    <span class={`pl-row-status${watched ? " pl-row-status--watched" : ""}`}>
                      <span class={`pl-dot${watched ? " pl-dot--watched" : ""}`}></span>
                      {watched ? "watched" : "healthy"}
                    </span>
                    <span class="pl-caret" aria-hidden="true">&#9660;</span>
                  </button>

                  {watched && (
                    <div class="pl-fix-callout">
                      <span class="pl-fix-label">drafted fix</span>
                      <span class="pl-fix-sep">&mdash;</span>
                      <span class="pl-fix-text">{layer.fix}</span>
                    </div>
                  )}

                  <div
                    class="pl-detail"
                    id={`pl-detail-${i}`}
                    role="region"
                    hidden={true}
                  >
                    <p class="pl-detail-desc">{layer.detail}</p>
                    <div class="pl-facts">
                      {layer.facts.map((f, fi) => (
                        <span class="pl-fact">{f}</span>
                      ))}
                    </div>
                    {watched && (
                      <div class="pl-apply-wrap">
                        <button
                          type="button"
                          class="pl-apply-btn"
                          data-fix={layer.fix ?? ""}
                          data-layer={layer.name}
                        >
                          Apply fix
                        </button>
                      </div>
                    )}
                  </div>
                </div>
              );
            })}
          </div>

          <div class="pl-footer">
            <p class="pl-footer-text">
              Watched layers have a drafted fix or an active mitigation &mdash; nothing here requires
              a terminal. Air-gapped replicas sync all thirteen layers to bare-metal arrays on the hour.
            </p>
            <a href="/admin" class="pl-footer-link">Open diagnostics &rarr;</a>
          </div>
        </main>
      </div>
      <script dangerouslySetInnerHTML={{ __html: js }} />
    </>
  );
};

export default ProductionLayers;

const css = `
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;600;700&family=Inter+Tight:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

@keyframes gcPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── Root ── */
.pl-root {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.008em;
  color: #16181d;
  background: #fcfcfd;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Header ── */
.pl-header {
  height: 56px;
  border-bottom: 1px solid rgba(22,24,29,0.07);
  background: #fcfcfd;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-sizing: border-box;
}

.pl-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: #16181d;
  text-decoration: none;
  flex-shrink: 0;
}

.pl-logo-mark {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #4353c9;
  display: inline-block;
  flex-shrink: 0;
}

.pl-logo-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8d99;
  font-weight: 500;
  margin-left: 2px;
}

.pl-sep {
  color: #c4c6cf;
  flex-shrink: 0;
}

.pl-breadcrumb {
  font-size: 13px;
  color: #16181d;
  font-weight: 500;
}

.pl-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.pl-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #6b7080;
  white-space: nowrap;
}

.pl-summary-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1e7f5c;
  flex-shrink: 0;
}

.pl-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #16181d;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Main ── */
.pl-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 44px 32px 88px;
  box-sizing: border-box;
}

/* ── Intro ── */
.pl-intro {
  max-width: 680px;
  margin-bottom: 36px;
}

.pl-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a8d99;
  margin-bottom: 10px;
}

.pl-heading {
  font-family: 'Inter Tight', sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 8px;
  color: #111318;
}

.pl-desc {
  font-size: 14px;
  color: #6b7080;
  margin: 0;
  line-height: 1.6;
}

/* ── Layer rows stack ── */
.pl-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pl-item {
  display: flex;
  flex-direction: column;
}

/* ── Row button ── */
.pl-row {
  display: grid;
  grid-template-columns: 32px minmax(140px, 1.3fr) minmax(0, 2fr) minmax(110px, 0.9fr) 20px;
  gap: 16px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  border: 1px solid rgba(22,24,29,0.07);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
  outline: none;
}

.pl-row:hover {
  border-color: rgba(22,24,29,0.22);
}

.pl-row:focus-visible {
  box-shadow: 0 0 0 3px rgba(67,83,201,0.18);
}

.pl-row--watched {
  border-color: rgba(180,83,9,0.28);
  border-left: 3px solid rgba(180,83,9,0.65);
  padding-left: 18px;
  border-radius: 12px 12px 4px 4px;
}

.pl-row--watched:hover {
  border-color: rgba(180,83,9,0.45);
  border-left-color: rgba(180,83,9,0.85);
}

.pl-row-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #c4c6cf;
  font-weight: 400;
  line-height: 1;
}

.pl-row-name {
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #16181d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.012em;
}

.pl-row-tech {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #6b7080;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.pl-row-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #1e7f5c;
  font-weight: 500;
  white-space: nowrap;
}

.pl-row-status--watched {
  color: #b45309;
}

.pl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1e7f5c;
  flex-shrink: 0;
  display: inline-block;
}

.pl-dot--watched {
  background: #b45309;
  animation: gcPulse 1.4s ease-in-out infinite;
}

.pl-caret {
  color: #c4c6cf;
  font-size: 10px;
  text-align: center;
  display: block;
  transition: transform 0.2s ease;
  line-height: 1;
}

.pl-row[aria-expanded="true"] .pl-caret {
  transform: rotate(180deg);
}

/* ── Fix callout (always visible for watched rows) ── */
.pl-fix-callout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 8px 22px;
  background: rgba(180,83,9,0.04);
  border: 1px solid rgba(180,83,9,0.18);
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 2px;
}

.pl-fix-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b45309;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.pl-fix-sep {
  color: rgba(180,83,9,0.35);
  font-size: 11px;
  flex-shrink: 0;
}

.pl-fix-text {
  font-size: 12.5px;
  color: #6b7080;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Detail panel ── */
.pl-detail {
  margin-top: 6px;
  padding: 18px 22px 18px 68px;
  border: 1px solid rgba(22,24,29,0.05);
  border-radius: 12px;
  background: rgba(22,24,29,0.015);
  box-sizing: border-box;
}

.pl-detail[hidden] {
  display: none !important;
}

.pl-detail-desc {
  font-size: 13px;
  color: #6b7080;
  margin: 0 0 12px;
  line-height: 1.65;
  max-width: 72ch;
}

.pl-facts {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #8a8d99;
  font-weight: 400;
}

.pl-fact {
  white-space: nowrap;
}

.pl-apply-wrap {
  margin-top: 16px;
}

.pl-apply-btn {
  background: #16181d;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.008em;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  outline: none;
}

.pl-apply-btn:hover:not(:disabled) {
  background: #2a2d36;
}

.pl-apply-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(67,83,201,0.18);
}

.pl-apply-btn:disabled {
  cursor: default;
  opacity: 0.75;
}

/* ── Footer ── */
.pl-footer {
  border-top: 1px solid rgba(22,24,29,0.07);
  margin-top: 36px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.pl-footer-text {
  font-size: 12.5px;
  color: #8a8d99;
  margin: 0;
  max-width: 62ch;
  line-height: 1.6;
}

.pl-footer-link {
  font-size: 13px;
  color: #4353c9;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.pl-footer-link:hover {
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .pl-header {
    padding: 0 16px;
    gap: 12px;
  }
  .pl-summary {
    display: none;
  }
  .pl-main {
    padding: 28px 16px 60px;
  }
  .pl-row {
    grid-template-columns: 28px minmax(0, 1fr) auto 16px;
    gap: 10px;
    padding: 12px 16px;
  }
  .pl-row--watched {
    padding-left: 14px;
  }
  .pl-row-tech {
    display: none;
  }
  .pl-detail {
    padding: 14px 16px 14px 20px;
  }
  .pl-fix-callout {
    padding: 7px 16px;
  }
  .pl-facts {
    gap: 14px;
  }
}
`;

const js = `
(function () {
  // Toggle expand / collapse for each layer row
  document.querySelectorAll('.pl-row').forEach(function (btn) {
    btn.addEventListener('click', function () {
      var idx = btn.getAttribute('data-index');
      var detail = document.getElementById('pl-detail-' + idx);
      if (!detail) return;

      var isOpen = btn.getAttribute('aria-expanded') === 'true';
      if (isOpen) {
        btn.setAttribute('aria-expanded', 'false');
        detail.hidden = true;
      } else {
        btn.setAttribute('aria-expanded', 'true');
        detail.hidden = false;
      }
    });
  });

  // Apply fix buttons
  document.querySelectorAll('.pl-apply-btn').forEach(function (applyBtn) {
    applyBtn.addEventListener('click', function (e) {
      e.stopPropagation();
      if (applyBtn.disabled) return;

      applyBtn.disabled = true;
      applyBtn.textContent = 'Applying…';

      setTimeout(function () {
        applyBtn.textContent = 'Fix applied ✓';
        applyBtn.style.background = '#1e7f5c';
        applyBtn.style.cursor = 'default';

        var item = applyBtn.closest('.pl-item');
        if (!item) return;

        // Swap dot from watched (amber pulse) to healthy (green)
        var dot = item.querySelector('.pl-dot--watched');
        if (dot) {
          dot.classList.remove('pl-dot--watched');
          dot.style.background = '#1e7f5c';
          dot.style.animation = 'none';
        }

        // Swap status label colour + text
        var status = item.querySelector('.pl-row-status--watched');
        if (status) {
          status.classList.remove('pl-row-status--watched');
          status.style.color = '#1e7f5c';
          // Last child is the text node "watched"
          var nodes = status.childNodes;
          for (var n = 0; n < nodes.length; n++) {
            if (nodes[n].nodeType === 3 /* TEXT_NODE */) {
              nodes[n].textContent = 'healthy';
              break;
            }
          }
        }

        // Remove amber border from the row button
        var rowBtn = item.querySelector('.pl-row--watched');
        if (rowBtn) {
          rowBtn.classList.remove('pl-row--watched');
        }

        // Fade and remove the fix callout strip
        var callout = item.querySelector('.pl-fix-callout');
        if (callout) {
          callout.style.transition = 'opacity 0.35s ease';
          callout.style.opacity = '0';
          setTimeout(function () {
            callout.style.display = 'none';
          }, 350);
        }
      }, 1400);
    });
  });
})();
`;