/* Sources & AI transparency — shared by the in-app page (#lib-sources, via
   index.html) and the public /transparency.html. Type follows the library
   conventions: DM Sans .72–.8rem copy, JetBrains Mono kickers. Colours come
   from the theme tokens so the in-app page follows dark/light; the static
   page defines the same tokens in its own :root. Cards use a faint accent
   tint over --bg-card, never a flat grey fill. */

/* ── Library hub link (index.html, last row of the Browse hub) ──
   2026-10-18c (owner): a plain text link in the bottom-left corner — no
   bubble, no icon, just "AI transparency". */
.lib-trust-row { display: flex; justify-content: flex-start; width: 100%; max-width: 1180px; margin: .7rem auto 0; padding: 0 .2rem; }
.lib-trust-link {
  background: none; border: 0; padding: .15rem 0; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: .72rem; line-height: 1.4; color: var(--text-dim);
  text-decoration: underline dotted; text-underline-offset: 3px; transition: color .15s;
}
.lib-trust-link:hover, .lib-trust-link:focus-visible { color: var(--accent-purple); }

/* ── Page ── */
.src-page { width: 100%; max-width: 880px; margin: 0 auto; font-family: 'DM Sans', sans-serif; color: var(--text-secondary); line-height: 1.55; }
.src-page h2, .src-page h3, .src-page h4 { color: var(--text-primary); margin: 0; }
.src-page p { margin: 0; }
.src-page a { color: var(--accent-cyan); text-decoration: underline; text-underline-offset: 2px; }
.src-kicker { font-family: 'JetBrains Mono', monospace; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-purple); margin-bottom: .45rem; }

.src-hero { padding: .2rem 0 .4rem; }
.src-hero-h { font-size: 1.32rem; line-height: 1.25; letter-spacing: -.01em; max-width: 30ch; }
.src-lede { font-size: .82rem; margin-top: .6rem; max-width: 72ch; }
.src-promises { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-top: 1.1rem; }
.src-promise {
  position: relative; padding: .85rem .95rem .9rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-card);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--src-accent) 10%, transparent), transparent 70%);
}
.src-promise::before { content: ''; position: absolute; left: .95rem; right: .95rem; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: var(--src-accent); }
.src-promise h3 { font-size: .8rem; margin: .25rem 0 .4rem; color: var(--src-accent); }
.src-promise p { font-size: .74rem; }
.src-stats { list-style: none; margin: 1rem 0 0; padding: .7rem .95rem; border-radius: 12px; border: 1px dashed rgba(34,197,94,.45); background: rgba(34,197,94,.06); display: grid; gap: .4rem; }
.src-stats li { display: flex; gap: .55rem; align-items: flex-start; font-size: .76rem; color: var(--text-primary); }
.src-stat-check { color: var(--accent-green); font-weight: 700; flex: 0 0 auto; }
.src-stats-note { font-size: .68rem; color: var(--text-dim); margin-top: .45rem; }

.src-section { margin-top: 1.9rem; padding-top: 1.3rem; border-top: 1px solid var(--border); }
.src-section > h3 { font-size: 1.02rem; margin-bottom: .55rem; }
.src-intro { font-size: .78rem; max-width: 76ch; }
.src-intro strong { color: var(--text-primary); }
.src-sub { font-family: 'JetBrains Mono', monospace; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin: 1.1rem 0 .55rem; }

.src-layers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .65rem; }
.src-layer {
  display: flex; flex-direction: column; gap: .45rem; padding: .75rem .85rem .8rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-card);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--src-accent) 8%, transparent), transparent 60%);
}
.src-layer-head { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.src-layer-icon { font-size: .95rem; line-height: 1; }
.src-layer h4 { font-size: .8rem; }
.src-layer-count { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: .64rem; font-weight: 700; color: var(--src-accent); white-space: nowrap; }
.src-layer p { font-size: .72rem; flex: 1; }
.src-open { align-self: flex-start; background: none; border: 0; padding: 0; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: .72rem; font-weight: 600; color: var(--accent-cyan); text-decoration: underline; text-underline-offset: 2px; }
.src-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.src-chips li { font-size: .72rem; padding: .3rem .65rem; border-radius: 999px; border: 1px solid rgba(168,85,247,.4); background: rgba(168,85,247,.08); color: var(--text-primary); }

.src-table-wrap { overflow-x: auto; margin-top: .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); }
.src-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.src-table caption { text-align: left; font-family: 'JetBrains Mono', monospace; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-cyan); padding: .6rem .85rem .35rem; caption-side: top; }
.src-table th, .src-table td { padding: .5rem .85rem; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
.src-table thead th { font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; border-top: 0; }
.src-table tbody th { font-weight: 500; color: var(--text-primary); min-width: 13rem; }
.src-gl-body { font-weight: 700; }
.src-gl-body a { color: var(--text-primary); text-decoration-color: var(--border-light, var(--border)); }
.src-gl-body a:hover { color: var(--accent-cyan); }
.src-gl-year { font-family: 'JetBrains Mono', monospace; font-size: .66rem; color: var(--accent-amber); margin-left: .3rem; }
.src-gl-title { display: block; font-size: .7rem; color: var(--text-secondary); }
.src-where { white-space: nowrap; color: var(--text-dim); font-size: .68rem; }
.src-log .src-when { white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: .66rem; color: var(--text-dim); }

.src-rules, .src-list { margin: .8rem 0 0; padding-left: 1.2rem; display: grid; gap: .4rem; font-size: .76rem; }
.src-rules li::marker { color: var(--accent-cyan); font-weight: 700; }
.src-list li::marker { color: var(--accent-cyan); }
.src-limits li::marker { color: var(--accent-amber); }

.src-steps { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .65rem; }
.src-step { display: flex; gap: .65rem; padding: .75rem .8rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); background-image: linear-gradient(180deg, rgba(6,182,212,.07), transparent 65%); }
.src-step-n { flex: 0 0 1.55rem; height: 1.55rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: .7rem; font-weight: 700; color: #fff; background: var(--accent-cyan); }
.src-step h4 { font-size: .8rem; margin-bottom: .25rem; }
.src-step p { font-size: .72rem; }

.src-ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .65rem; margin-top: .6rem; }
.src-ai { padding: .75rem .85rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); background-image: linear-gradient(180deg, rgba(168,85,247,.08), transparent 60%); }
.src-ai h4 { font-size: .8rem; margin-bottom: .3rem; }
.src-ai-does { font-size: .72rem; }
.src-ai-guard { font-size: .7rem; margin-top: .5rem; padding-top: .45rem; border-top: 1px dashed var(--border); color: var(--text-secondary); }
.src-guard-k { font-family: 'JetBrains Mono', monospace; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-green); margin-right: .3rem; }
.src-ops { margin: .9rem 0 0; padding-left: 1.2rem; display: grid; gap: .4rem; font-size: .76rem; }
.src-ops li::marker { color: var(--accent-purple); }

.src-foot .src-intro { margin-bottom: .8rem; }
.src-ctas { display: flex; flex-wrap: wrap; gap: .55rem; }
.src-cta {
  display: inline-flex; align-items: center; padding: .55rem .95rem; border-radius: 10px; cursor: pointer; text-decoration: none;
  font-family: 'DM Sans', sans-serif; font-size: .76rem; font-weight: 700; color: #fff;
  background: var(--accent-purple); border: 1px solid var(--accent-purple);
}
.src-cta:hover { filter: brightness(1.08); }
.src-cta-quiet { background: transparent; color: var(--accent-purple); }
.src-updated { font-size: .7rem; color: var(--text-dim); margin-top: 1rem; }

/* Editorial responsibility (2026-10-18b): the credit, the AI role and the
   review-status sentence in one block near the top. */
.src-credit { padding: .9rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); background-image: linear-gradient(135deg, rgba(34,197,94,.08), transparent 70%); display: grid; gap: .55rem; }
.src-credit p { font-size: .78rem; }
.src-credit-lead strong { color: var(--text-primary); }
.src-credit-status { padding-top: .55rem; border-top: 1px dashed var(--border); }
.src-credit-status strong { color: var(--accent-amber); }
.src-credit-purpose { color: var(--text-dim); }
.src-ctas-inline { margin-top: .9rem; }
.src-gl-year-series { color: var(--text-dim); font-style: italic; }
.src-inline-link { background: none; border: 0; padding: 0; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: inherit; color: var(--accent-cyan); text-decoration: underline; text-underline-offset: 2px; }
.src-layer-foot { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.src-layer-reviewed { font-family: 'JetBrains Mono', monospace; font-size: .6rem; letter-spacing: .04em; color: var(--text-dim); white-space: nowrap; }
.src-layer-reviewed time { color: var(--text-secondary); font-weight: 700; }

/* ── Corrections & updates (#corrections) ── */
.src-corr-group { margin-top: 1rem; }
.src-corr-when { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .7rem; margin: 0 0 .5rem; font-family: 'JetBrains Mono', monospace; font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: var(--accent-amber); }
.src-corr-round { font-family: 'DM Sans', sans-serif; font-size: .7rem; font-weight: 500; letter-spacing: 0; color: var(--text-dim); }
.src-corr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.src-corr { padding: .7rem .85rem .75rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); background-image: linear-gradient(180deg, rgba(245,158,11,.07), transparent 60%); }
.src-corr-area { font-family: 'JetBrains Mono', monospace; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-amber); margin-bottom: .3rem; }
.src-corr-what { font-size: .74rem; color: var(--text-primary); }
.src-corr-why { font-size: .7rem; margin-top: .45rem; padding-top: .4rem; border-top: 1px dashed var(--border); color: var(--text-secondary); }

/* ── "Reviewed <date>" stamp in every library page header ──
   Moved to the end of styles.css (2026-10-23): this file keeps its ?v token
   between rounds, and a phone holding a stale copy painted the stamp
   unstyled. Its rules live with the rest of the library chrome now. */

@media (max-width: 720px) {
  .src-promises { grid-template-columns: 1fr; }
  .src-hero-h { font-size: 1.12rem; }
  .src-steps { grid-template-columns: 1fr; }
  /* Tables stack into one card per row on phones: three narrow columns were
     hard to read, and the "Where" column fell off the edge. */
  .src-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .src-table tr { display: block; padding: .6rem .85rem .65rem; border-top: 1px solid var(--border); }
  .src-table th, .src-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .src-table tbody th { min-width: 0; }
  .src-table td { margin-top: .3rem; }
  .src-where { margin-top: .3rem; color: var(--accent-cyan); }
  .src-where::before { content: 'Where: '; color: var(--text-dim); }
  .src-log .src-when { margin-bottom: .1rem; }
}
@media (prefers-reduced-motion: reduce) { .lib-trust-link, .src-cta { transition: none; } }
@media (max-width: 720px) { .src-layer-reviewed { white-space: normal; } }

/* ══════════════════════════════════════════════════════════════
   2026-10-18e (owner): the AI transparency link pinned to the bottom-left
   corner of the viewport; the transparency page as section cards with a
   sticky section bar, centred headings and roomier spacing.
   ══════════════════════════════════════════════════════════════ */
/* The link: fixed bottom-left on screens wide enough to have a corner to
   spare; --trust-left is set by libraryCustom.js to clear the sidebar rail. */
.lib-trust-row { position: fixed; left: var(--trust-left, 14px); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 120; width: auto; max-width: none; margin: 0; padding: 0; }
.lib-trust-link { padding: .3rem .6rem; border-radius: 8px; background: color-mix(in srgb, var(--bg-card) 82%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* Phones: nothing floats over content — the link sits at the end of the hub. */
@media (max-width: 640px) {
  .lib-trust-row { position: static; justify-content: flex-start; margin: .9rem 0 .2rem; padding: 0 .2rem; }
  .lib-trust-link { padding: .15rem 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Section bar (sticky) — the Personal library's .lcs-nav, self-contained
   here so the public page has it too. */
.src-nav { position: sticky; top: .35rem; z-index: 41; display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem; width: max-content; max-width: 100%; margin: 1.1rem auto .2rem; padding: .3rem; box-sizing: border-box; overflow-x: auto; scrollbar-width: none; border-radius: 20px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg-card) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.src-nav::-webkit-scrollbar { display: none; }
/* Each half stays whole, so a narrow column wraps 5 + 5, never 9 + 1. */
.src-nav-grp { display: flex; flex: 0 0 auto; gap: .2rem; }
.src-nav-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .45rem; min-height: 34px; padding: .3rem .8rem; border: 0; border-radius: 999px; background: transparent; color: var(--text-secondary); font-family: 'DM Sans', sans-serif; font-size: .74rem; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, box-shadow .15s; }
.src-nav-btn::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--src-c); }
.src-nav-btn:hover { color: var(--text-primary); background: color-mix(in srgb, var(--src-c) 11%, transparent); }
.src-nav-btn.is-on { color: var(--text-primary); background: color-mix(in srgb, var(--src-c) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--src-c) 50%, transparent); }
.src-nav-btn:focus-visible { outline: 2px solid var(--src-c); outline-offset: 1px; }

/* Hero: centred. */
.src-hero { text-align: center; padding: .4rem 0 .2rem; }
.src-kicker { text-align: center; }
.src-page .src-hero-h { max-width: none; margin: 0 auto; }
.src-lede { margin: .7rem auto 0; max-width: 64ch; }

/* Section cards replace the rule-separated blocks. */
.src-section { position: relative; margin-top: 1.1rem; padding: 1.4rem 1.5rem 1.6rem; border-top: 0; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--src-c, var(--accent-cyan)) 26%, var(--border)); background: color-mix(in srgb, var(--src-c, var(--accent-cyan)) 4%, var(--bg-card)); scroll-margin-top: 4.6rem; }
.src-section::before { content: ''; position: absolute; left: 1.4rem; right: 1.4rem; top: -1px; height: 3px; border-radius: 0 0 4px 4px; background: var(--src-c, var(--accent-cyan)); }
.src-section > h3 { text-align: center; margin: 0 0 1.1rem; padding-bottom: .9rem; border-bottom: 1px solid color-mix(in srgb, var(--src-c, var(--accent-cyan)) 20%, var(--border)); }
.src-sub, .src-table caption { text-align: center; }
.src-sub { margin: 1.5rem 0 .85rem; }
.src-table caption { padding: .7rem .9rem .4rem; }

/* Breathing room. */
.src-page { line-height: 1.6; }
.src-intro { margin: 0 auto 1rem; max-width: 76ch; text-align: left; }
.src-intro + .src-intro { margin-top: -.2rem; }
.src-credit { gap: .9rem; padding: 1.1rem 1.25rem; }
.src-credit p { line-height: 1.65; }
.src-credit-status { padding-top: .8rem; }
.src-list, .src-rules, .src-ops { gap: .65rem; line-height: 1.6; margin-top: .4rem; }
.src-layers, .src-ai-grid, .src-steps { gap: .9rem; }
.src-layer, .src-ai, .src-step { padding: .9rem 1rem 1rem; gap: .55rem; }
.src-layer p, .src-step p, .src-ai-does { line-height: 1.55; }
.src-ai-guard { margin-top: .65rem; padding-top: .55rem; line-height: 1.55; }
.src-table th, .src-table td { padding: .7rem .9rem; line-height: 1.5; }
.src-stats { margin-top: 1.1rem; gap: .55rem; padding: .85rem 1rem; }
.src-stats-note { margin-top: .6rem; line-height: 1.55; }
.src-corr-group { margin-top: 1.3rem; }
.src-corr-list { gap: .75rem; }
.src-corr-what, .src-corr-why { line-height: 1.55; }
.src-ctas-inline { margin-top: 1.1rem; justify-content: center; }
.src-foot { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px dashed var(--border); }
.src-foot .src-ctas { justify-content: center; }
.src-updated { text-align: center; margin-top: 1.1rem; }
@media (max-width: 720px) {
  .src-section { padding: 1.1rem 1rem 1.25rem; }
  /* Phones: one scrolling row; the fade says there is more (librarySources.js). */
  .src-nav { margin-left: 0; margin-right: 0; width: 100%; flex-wrap: nowrap; justify-content: flex-start; border-radius: 999px; }
  .src-nav.has-more-right { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  .src-nav.has-more-left { -webkit-mask-image: linear-gradient(to left, #000 82%, transparent); mask-image: linear-gradient(to left, #000 82%, transparent); }
  .src-nav.has-more-left.has-more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); }
}

/* Contrast pass 2026-10-25: accent-coloured counts, years, areas and the
   purple CTA measured below 4.5:1 in the light theme (and the CTA in both).
   Same per-theme lightness clamp as styles.css. */
@supports (color: oklch(from red l c h)) {
  .src-layer-count, .src-promise h3 { color: oklch(from var(--src-accent) clamp(var(--ink-floor), l, var(--ink-ceil)) c h); }
  .src-gl-year, .src-corr-area, .src-credit-status strong, .src-limits li::marker { color: oklch(from var(--accent-amber) clamp(var(--ink-floor), l, var(--ink-ceil)) c h); }
  .src-stat-check, .src-guard-k { color: oklch(from var(--accent-green) clamp(var(--ink-floor), l, var(--ink-ceil)) c h); }
  .src-page a, .src-open, .src-inline-link, .src-table caption, .src-where { color: oklch(from var(--accent-cyan) clamp(var(--ink-floor), l, var(--ink-ceil)) c h); }
  .src-cta-quiet { color: oklch(from var(--accent-purple) clamp(var(--ink-floor), l, var(--ink-ceil)) c h); }
}
.src-cta { background: #6d28d9; }   /* white on this purple: 6.3:1 in either theme */

.src-cta-quiet { background: transparent; }   /* the quiet variant stays unfilled after the .src-cta fill above */
