/* ALL code explorer + the home's security section. Uses the kit's tokens (kit.css); day and night come from them. One bordered frame, no cards inside it. */
:root {
  --tc: #8a8372; --ts: #1a7f37; --tn: #b15a00; --tb: #7a3e9d; --tt: #1f4e9a; --tk: #1f4e9a; --tbg: #fbf7ec; --tgut: #a59e90;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tc: #7d7a8c; --ts: #7ee0a0; --tn: #ffb35c; --tb: #d6a5f2; --tt: #8fb8ff; --tk: #8fb8ff; --tbg: #0b1020; --tgut: #565b74; }
}
:root[data-theme="dark"] { --tc: #7d7a8c; --ts: #7ee0a0; --tn: #ffb35c; --tb: #d6a5f2; --tt: #8fb8ff; --tk: #8fb8ff; --tbg: #0b1020; --tgut: #565b74; }

/* ---- the section on the home --------------------------------------------------------------------------------------------------------------- */
.sx-points { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; }
.sx-points li { display: grid; gap: 8px; align-content: start; justify-items: start; }
.sx-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--gold-soft); color: var(--ink); display: grid; place-items: center; }
.sx-ico svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }   /* Phosphor duotone (MIT), inlined; notice in /third-party-notices.txt */
.sx-points b { font-size: 19px; font-weight: 560; letter-spacing: -.01em; }
.sx-points span { color: var(--ink-2); font-size: 16px; line-height: 1.5; }
/* "Check it yourself": one bordered disclosure, always on the page (a <details>, its summary visible); its rows are divided by hairlines, no card inside it */
.sx-verify { margin-top: 56px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); }
.sx-verify > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 17px; cursor: pointer; }
.sx-verify > summary::-webkit-details-marker { display: none; }
.sx-verify > summary:hover { background: var(--soft); }
.sx-verify > summary:focus-visible { outline-offset: -3px; }
.sx-verify > summary .sx-ico { flex: none; width: 36px; height: 36px; border-radius: 11px; }
.sx-verify > summary .sx-ico svg { width: 20px; height: 20px; }
.sx-verify > summary h3 { flex: 1; min-width: 0; margin: 0; font-size: 19px; font-weight: 560; letter-spacing: -.01em; }
.sx-verify > summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--chip); color: var(--ink);
  font-size: 22px; font-weight: 300; line-height: 1; transition: transform .2s; }
.sx-verify[open] > summary { border-radius: 17px 17px 0 0; border-bottom: 1px solid var(--line); }
.sx-verify[open] > summary::after { transform: rotate(45deg); }
.sx-verify-list { list-style: none; margin: 0; padding: 0 20px; }
.sx-verify-list li { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 76ch); gap: 4px 24px; padding: 16px 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.sx-verify-list li:first-child { border-top: 0; }
.sx-verify-list b { color: var(--ink); font-weight: 600; }
.sx-verify-list a { color: var(--ink); font-weight: 600; text-decoration-color: var(--gold-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.sx-verify-list code { font-family: var(--mono); font-size: .88em; background: var(--chip); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.sx-explorer { margin-top: 56px; }
.sx-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.sx-fresh { margin: 20px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }

/* ---- the page /code/ ----------------------------------------------------------------------------------------------------------------------- */
.cx-page { padding-top: clamp(40px, 7vh, 72px); }
.cx-intro { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.cx-intro h1 { margin: 0; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.06; font-weight: 560; letter-spacing: -.04em; text-wrap: balance; }
.cx-intro p { margin: 18px auto 0; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-2); text-wrap: balance; }
.cx-page .sx-points { margin: 0 0 48px; }
.cx-links { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: center; }
.cx-links a { font-size: 15.5px; font-weight: 600; color: var(--amber-ink); text-decoration: none; }
.cx-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cx-page-end { padding-bottom: clamp(72px, 12vh, 120px); }

/* ---- the explorer -------------------------------------------------------------------------------------------------------------------------- */
[data-code] { font-size: 15px; line-height: 1.45; text-align: left; }
.cx-frame { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.cx-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cx-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 18px; }
.cx-title svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; }
.cx-name { overflow-wrap: anywhere; }
.cx-owner { color: var(--muted); }
.cx-pill { border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.cx-top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cx-tagwrap { position: relative; }
.cx-tag, .cx-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 0; background: var(--chip); color: var(--ink); font: 500 14px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s; }
.cx-tag:hover, .cx-btn:hover { background: var(--soft-2); }
.cx-tag svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.cx-tag svg:last-child { width: 11px; height: 11px; stroke-width: 1.6; }
.cx-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cx-btn-s { min-height: 32px; padding: 5px 12px; font-size: 13.5px; }
.cx-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 200px; padding: 6px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); }
.cx-menu[hidden] { display: none; }
.cx-menu a { display: flex; justify-content: space-between; gap: 16px; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.cx-menu a:hover, .cx-menu a:focus-visible { background: var(--chip); }
.cx-menu small { color: var(--green); font-size: 12.5px; }

.cx-commit { display: flex; align-items: center; gap: 10px; padding: 11px 18px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 14px; }
.cx-commit > svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; }
.cx-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.cx-meta { display: flex; align-items: center; gap: 14px; flex: none; color: var(--ink-2); font-size: 13.5px; }
.cx-hash { font-family: var(--mono); font-size: 13px; color: var(--ink); text-decoration: none; background: var(--chip); border-radius: 6px; padding: 2px 7px; }
.cx-hash:hover { background: var(--soft-2); }

.cx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
.cx-crumbs a { color: var(--amber-ink); text-decoration: none; font-weight: 600; }
.cx-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cx-crumbs i { color: var(--faint); font-style: normal; }
.cx-crumbs strong { font-weight: 600; overflow-wrap: anywhere; }

.cx-list { list-style: none; margin: 0; padding: 0; }
.cx-row { display: grid; grid-template-columns: minmax(160px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.cx-row:last-child { border-bottom: 0; }
.cx-link { display: flex; align-items: center; gap: 12px; padding: 11px 0 11px 18px; color: var(--ink); text-decoration: none; min-width: 0; }
.cx-link:hover .cx-fname, .cx-link:focus-visible .cx-fname { text-decoration: underline; text-underline-offset: 3px; }
.cx-link:focus-visible { outline-offset: -3px; }
.cx-ico { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-linejoin: round; }
.cx-ico.is-dir { fill: var(--gold-soft); stroke: var(--amber-ink); }
.cx-fname { overflow-wrap: anywhere; font-weight: 500; }
.cx-rmsg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
.cx-rdate { padding-right: 18px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.cx-row:hover { background: var(--soft); }
.cx-empty { padding: 24px 18px; color: var(--muted); }

.cx-readme { border-top: 1px solid var(--line-2); }
.cx-readme-h { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--soft); font-size: 14.5px; font-weight: 600; }
.cx-readme-h svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-linejoin: round; }
.cx-md { padding: 22px clamp(18px, 3vw, 32px) 26px; max-width: 78ch; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.cx-md h2, .cx-md h3, .cx-md h4 { margin: 0 0 12px; color: var(--ink); font-size: 21px; font-weight: 560; letter-spacing: -.02em; line-height: 1.25; }
.cx-md p { margin: 0 0 14px; }
.cx-md p:last-child { margin-bottom: 0; }
.cx-md code { font-family: var(--mono); font-size: .9em; background: var(--chip); padding: 1px 6px; border-radius: 6px; }

.cx-file-h { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 18px; background: var(--soft); border-bottom: 1px solid var(--line); }
.cx-file-info { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14.5px; }
.cx-file-info svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-linejoin: round; }
.cx-file-info strong { overflow-wrap: anywhere; font-weight: 600; }
.cx-file-info span { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.cx-file-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-code { display: flex; max-height: min(78vh, 760px); overflow: auto; background: var(--tbg); font: 13px/1.6 var(--mono); }
.cx-code:focus-visible { outline-offset: -3px; }
.cx-code pre { margin: 0; padding: 14px 0; font: inherit; tab-size: 4; }
.cx-gut { position: sticky; left: 0; flex: none; padding-inline: 14px 12px !important; text-align: right; color: var(--tgut); background: var(--tbg); border-right: 1px solid var(--line); user-select: none; }
.cx-src { flex: 1 0 auto; padding-inline: 16px !important; color: var(--ink); white-space: pre; }
.tc { color: var(--tc); font-style: italic; }
.ts { color: var(--ts); }
.tn { color: var(--tn); }
.tb { color: var(--tb); font-weight: 500; }
.tt { color: var(--tt); }
.tk { color: var(--tk); }
.cx-load, .cx-big { margin: 0; padding: 28px 18px; color: var(--muted); }
.cx-foot { margin: 14px 4px 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.cx-foot code { font-family: var(--mono); font-size: .95em; }

@media (max-width: 760px) {
  .sx-points { grid-template-columns: 1fr; gap: 0; margin-top: 32px; border-top: 1px solid var(--line); }
  .sx-points li { grid-template-columns: 32px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .sx-ico { width: 32px; height: 32px; border-radius: 10px; grid-row: 1; }
  .sx-ico svg { width: 19px; height: 19px; }
  .sx-points b { font-size: 17px; grid-column: 2; }
  .sx-points li > span:not(.sx-ico) { grid-column: 2; font-size: 15px; }
  .sx-verify { margin-top: 32px; border-radius: 14px; }
  .sx-verify > summary { gap: 12px; padding: 14px; border-radius: 13px; }
  .sx-verify[open] > summary { border-radius: 13px 13px 0 0; }
  .sx-verify > summary .sx-ico { width: 32px; height: 32px; border-radius: 10px; }
  .sx-verify > summary .sx-ico svg { width: 19px; height: 19px; }
  .sx-verify > summary h3 { font-size: 17px; }
  .sx-verify-list { padding: 0 14px; }
  .sx-verify-list li { grid-template-columns: minmax(0, 1fr); padding: 14px 0; font-size: 15px; }
  .cx-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .cx-rmsg { display: none; }
  .cx-top { padding: 14px; }
  .cx-title { font-size: 16.5px; }
  .cx-commit { padding: 10px 14px; flex-wrap: wrap; }
  .cx-commit .cx-msg { flex-basis: calc(100% - 28px); }
  .cx-meta { margin-left: 26px; }
  .cx-link { padding-left: 14px; }
  .cx-rdate { padding-right: 14px; font-size: 13px; }
  .cx-crumbs, .cx-file-h, .cx-readme-h { padding-inline: 14px; }
  .cx-code { font-size: 12px; }
  .sx-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .cx-tag, .cx-btn, .sx-verify > summary::after { transition: none; } }

/* the home preview: the whole tree under files/, every folder open, in one scrollable list */
.cx-tree { list-style: none; margin: 0; padding: 6px 0; max-height: 640px; overflow: auto; }
.cx-tree:focus-visible { outline-offset: -3px; }
.cx-trow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cx-trow .cx-link { padding: 6px 0 6px 18px; flex: 1; font-size: 14.5px; }
.cx-trow .cx-rdate { font-size: 12.5px; }
.cx-trow:hover { background: var(--soft); }
.cx-trow.is-dir .cx-fname { font-weight: 600; }
.cx-trow.d1 .cx-link { padding-left: 38px; } .cx-trow.d2 .cx-link { padding-left: 58px; } .cx-trow.d3 .cx-link { padding-left: 78px; }
.cx-trow.d4 .cx-link { padding-left: 98px; } .cx-trow.d5 .cx-link { padding-left: 118px; }
/* the static copy of every file, for readers that do not run scripts */
.cx-static { margin-top: 56px; }
.cx-static h2 { margin: 0 0 8px; font-size: 24px; font-weight: 560; letter-spacing: -.02em; }
.cx-static > p { margin: 0 0 20px; color: var(--ink-2); }
.cx-static ul { list-style: none; margin: 0 0 28px; padding: 0; columns: 3 280px; column-gap: 32px; font-size: 14px; }
.cx-static ul li { break-inside: avoid; padding: 2px 0; overflow-wrap: anywhere; }
.cx-static details { border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 8px; background: var(--panel); overflow: hidden; }
.cx-static summary { padding: 10px 16px; cursor: pointer; font: 500 14px/1.4 var(--mono); overflow-wrap: anywhere; }
.cx-static summary small { color: var(--muted); font-family: var(--sans); margin-left: 8px; }
.cx-static pre { margin: 0; padding: 14px 16px; max-height: 560px; overflow: auto; background: var(--tbg); font: 12.5px/1.55 var(--mono); border-top: 1px solid var(--line); tab-size: 4; }
@media (max-width: 760px) { .cx-trow .cx-link { padding-left: 14px; } .cx-trow.d1 .cx-link { padding-left: 28px; } .cx-trow.d2 .cx-link { padding-left: 42px; } .cx-trow.d3 .cx-link { padding-left: 56px; } .cx-trow.d4 .cx-link, .cx-trow.d5 .cx-link { padding-left: 70px; } .cx-trow .cx-rdate { display: none; } }

/* collapsed tree: folders are <details>, closed until opened */
.cx-tree { max-height: none; overflow: visible; }
.cx-tree ul { list-style: none; margin: 0; padding: 0 0 0 20px; }
.cx-dir > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 7px 18px; cursor: pointer; font-size: 14.5px; font-weight: 600; }
.cx-dir > summary::-webkit-details-marker { display: none; }
.cx-dir > summary:hover { background: var(--soft); }
.cx-dir > summary:focus-visible { outline-offset: -3px; }
.cx-caret { width: 11px; height: 11px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; transform: rotate(-90deg); transition: transform .15s; }
.cx-dir[open] > summary .cx-caret { transform: none; }
.cx-tree .cx-dir:not([open]) > summary .cx-fname::after { content: ""; }
.cx-trow .cx-link { padding-left: 18px; }
@media (max-width: 760px) { .cx-dir > summary { padding-inline: 14px; } .cx-tree ul { padding-left: 14px; } .cx-trow .cx-rdate { display: none; } }
@media (prefers-reduced-motion: reduce) { .cx-caret { transition: none; } }
.cx-static .cx-tree { columns: auto; margin-bottom: 28px; font-size: 14px; }
