/* /21-cfr-part-11-edc-software: fifteen citations, each one a key that opens
   what it asks for beside what the platform does; a signature you can break
   by editing its record; and the AI trail. Page-only figures. */

.p11-stats { margin-top: 44px; }

/* ── clause explorer: a key per citation ── */
.clauses { margin-top: 36px; }
.clauses__keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.clauses__keys button { position: relative; display: grid; gap: 2px; min-width: 0; padding: 12px 12px 11px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(7, 11, 18, 0.88); color: var(--muted); font: inherit; text-align: left; cursor: pointer; transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease; }
.clauses__keys b { font: 500 15px var(--font-mono); color: rgba(255, 255, 255, 0.85); }
.clauses__keys span { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.clauses__keys button:hover { border-color: rgba(92, 200, 255, 0.4); color: #c4cfdd; }
.clauses__keys button.is-active { border-color: rgba(92, 200, 255, 0.7); background: linear-gradient(180deg, var(--accent-faint), rgba(7, 11, 18, 0.88)); color: #c4cfdd; }
.clauses__keys button.is-active b { color: #fff; }
.clauses__keys button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, rgba(92, 200, 255, 0.4), var(--accent)); transform: scaleX(0); transform-origin: left; }
.clauses__keys button.is-active::after { transform: scaleX(1); }
.clauses.is-auto .clauses__keys button.is-active::after { animation: kitDwell var(--dwell, 6s) linear both; }
.clauses.is-hold .clauses__keys button.is-active::after { animation-play-state: paused; }
.clauses__keys button:focus-visible { outline: 2px solid #9fd8ff; outline-offset: 2px; }
.clauses__stage { margin-top: 12px; }
.clause { padding: 26px 28px; border: 1px solid var(--edge); border-radius: 16px; background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(30, 120, 220, 0.12), transparent 70%), #070b12; }
.clause__cite { margin: 0; font: 500 11px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: #9fd8ff; }
.clause__cols { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: center; margin-top: 16px; }
.clause__asks, .clause__does { padding: 20px; border-radius: 12px; }
.clause__asks { border: 1px solid var(--line-soft); background: var(--card); }
.clause__does { border: 1px solid rgba(110, 231, 183, 0.35); background: rgba(110, 231, 183, 0.05); }
.clause small { display: block; font: 500 9.5px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.clause__does small { color: var(--live); }
.clause__asks p { margin: 10px 0 0; font: 400 19px/1.45 var(--font-display); color: var(--fg); text-wrap: pretty; }
.clause__does p { margin: 10px 0 0; font-size: 15px; line-height: 1.6; color: var(--fg); text-wrap: pretty; }
.clause__arrow { position: relative; height: 1px; margin: 0 10px 0 8px; background: linear-gradient(90deg, rgba(92, 200, 255, 0.2), #6ee7b7); box-shadow: 0 0 8px rgba(110, 231, 183, 0.6); }
.clause__arrow::after { content: ""; position: absolute; right: -6px; top: -4.5px; border: 5px solid transparent; border-left: 6px solid #6ee7b7; border-right: 0; }
html:not(.kit) .clause + .clause { margin-top: 12px; }

/* ── a signature, and the edit that outlives it ── */
.sig { margin-top: 36px; }
.sig > .kit-tabs { max-width: 520px; }
.sig__fig { margin-top: 14px; }
.sig__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.sig__rec, .sig__card { padding: 18px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255, 255, 255, 0.025); transition: border-color 300ms ease; }
.sig__rec small { font: 500 9.5px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.sig__ver { display: block; margin-top: 8px; font: 500 20px/1.25 var(--font-display); color: #fff; }
.sig .v4 { display: none; color: #ff8a82; }
.sig[data-switch-current="edited"] .v3 { display: none; }
.sig[data-switch-current="edited"] .v4 { display: inline; }
.sig__rec dl { display: grid; margin: 14px 0 0; }
.sig__rec dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.sig__rec dt { color: var(--muted); }
.sig__rec dd { margin: 0; font: 500 13px var(--font-mono); color: #fff; }
.sig__card { display: grid; align-content: start; gap: 12px; border-color: rgba(92, 200, 255, 0.45); background: rgba(92, 200, 255, 0.06); }
.sig__card > div { display: grid; gap: 3px; }
.sig__card span { font: 500 9.5px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.sig__card b { font-size: 14px; font-weight: 500; color: #fff; transition: color 300ms ease; }
.sig__card i { font: 500 14px var(--font-mono); font-style: normal; letter-spacing: 0.2em; color: #9fd8ff; }
.sig[data-switch-current="edited"] .sig__rec { border-color: rgba(255, 69, 58, 0.5); }
.sig[data-switch-current="edited"] .sig__bound b { color: #ffb4ae; }
.sig[data-switch-current="edited"] .sig__bound b::after { content: " · not version 4"; color: #ff8a82; }
.sig__msg { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.sig__msg b { font-weight: 600; }
.sig__msg--ok { border: 1px solid rgba(110, 231, 183, 0.35); background: rgba(110, 231, 183, 0.06); }
.sig__msg--ok b { color: var(--live); }
.sig__msg--bad { border: 1px solid rgba(255, 69, 58, 0.4); background: rgba(255, 69, 58, 0.07); }
.sig__msg--bad b { color: #ff8a82; }
.sig + .clauses { margin-top: 44px; }
.clauses + .edcview { margin-top: 44px; }

/* ── where a rule came from, in order ── */
.aitrail { margin-top: 44px; }
.aitrail__track { position: relative; padding: 18px 0 6px; }
.aitrail__line { position: absolute; left: 10%; right: 10%; top: 25px; height: 1px; background: linear-gradient(90deg, #5cc8ff, var(--live)); box-shadow: 0 0 8px rgba(92, 200, 255, 0.6); transform-origin: left; }
.aitrail .aitrail__line[data-at] { transition: transform 2.8s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.3s ease; }
.aitrail.is-armed .aitrail__line[data-at]:not(.is-on) { opacity: 1; transform: scaleX(0); }
.aitrail ol { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.aitrail li { display: grid; justify-items: center; gap: 4px; text-align: center; }
.aitrail li::before { content: ""; width: 14px; height: 14px; margin-bottom: 10px; border: 1px solid #5cc8ff; border-radius: 50%; background: #070b12; box-shadow: 0 0 10px rgba(92, 200, 255, 0.6); }
.aitrail li b { font: 500 10.5px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: #9fd8ff; }
.aitrail li span { font: 400 20px/1.2 var(--font-display); color: #fff; }
.aitrail li.is-act::before { background: #5cc8ff; }
.aitrail li.is-live::before { border-color: var(--live); background: var(--live); box-shadow: 0 0 12px rgba(110, 231, 183, 0.8); }
.aitrail li.is-live b { color: var(--live); }
.aikeys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 28px 0 0; }
.aikeys div { padding-top: 14px; border-top: 1px solid var(--line); }
.aikeys dt { font: 500 19px var(--font-display); color: var(--fg); }
.aikeys dd { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }

@media (max-width: 980px) {
  .aikeys { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .clause { padding: 20px; }
  .clause__cols { grid-template-columns: 1fr; }
  .clause__arrow { width: 1px; height: 22px; margin: 6px 0 8px 24px; background: linear-gradient(180deg, rgba(92, 200, 255, 0.2), #6ee7b7); }
  .clause__arrow::after { right: auto; left: -4.5px; top: auto; bottom: -6px; border: 5px solid transparent; border-top: 6px solid #6ee7b7; border-bottom: 0; }
  .sig__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* The keys become a strip that scrolls sideways, faded at its edge. */
  .clauses__keys { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 96px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent); mask-image: linear-gradient(90deg, #000 84%, transparent); }
  .aitrail ol { grid-template-columns: 1fr; gap: 14px; }
  .aitrail li { grid-template-columns: 14px 92px minmax(0, 1fr); justify-items: start; align-items: center; gap: 14px; text-align: left; }
  .aitrail li::before { margin: 0; }
  .aitrail li span { font-size: 18px; }
  .aitrail__line { left: 7px; right: auto; top: 25px; bottom: 13px; width: 1px; height: auto; background: linear-gradient(180deg, #5cc8ff, var(--live)); transform-origin: top; }
  .aitrail.is-armed .aitrail__line[data-at]:not(.is-on) { transform: scaleY(0); }
}

/* ══ The page's own world: the regulation as printed. Cool paper sheets on
   the navy ground, black serif text, section symbols, a cyan highlighter
   over what this page maps, and the platform's answers in blue ink. ══ */
.page-cfr { --paper: #eceef1; --ink: #12161d; --ink-soft: #4a5261; --ink-blue: #0a5b8f; --hl: rgba(92, 200, 255, 0.45); }

/* the hero: the title on navy, the table of contents on paper */
.cfr-hero { padding: 140px 0 84px; }
.cfr-hero__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px 64px; align-items: start; }
.cfr-toc { padding: 30px 34px 24px; background: var(--paper); color: var(--ink); box-shadow: 0 50px 110px -40px rgba(0, 0, 0, 0.95); font: 400 15.5px/1.5 var(--font-display); animation: heroUp 0.9s var(--ease-out) 0.15s both; }
.cfr-toc__path { margin: 0; font: 600 10px var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.cfr-toc__part { margin: 10px 0 16px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); font: 600 18px/1.25 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; }
.cfr-toc__sub { margin: 16px 0 6px; font: 600 11.5px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.cfr-toc ol { margin: 0; padding: 0; list-style: none; }
.cfr-toc li { padding: 3px 0; color: var(--ink-soft); }
.cfr-toc li > span, .cfr-toc a > span { display: inline-block; min-width: 74px; font-weight: 600; color: var(--ink); }
.cfr-toc a { display: block; color: var(--ink); text-decoration: none; }
.cfr-toc mark { padding: 0 2px; background: linear-gradient(transparent 52%, var(--hl) 52%) no-repeat 0 0 / 100% 100%; color: inherit; }
.cfr-toc a:hover mark { --hl: rgba(92, 200, 255, 0.7); }
.cfr-toc a em { margin-left: 8px; font: italic 400 13.5px var(--font-display); color: var(--ink-blue); }
.cfr-toc a:focus-visible { outline: 2px solid var(--ink-blue); outline-offset: 2px; }
.cfr-toc mark { animation: cfrHighlight 650ms var(--ease-out) both; animation-delay: calc(var(--k, 0) * 170ms + 700ms); }
@keyframes cfrHighlight { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
.cfr-toc__note { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid rgba(18, 22, 29, 0.16); font: italic 400 13.5px var(--font-display); color: var(--ink-soft); }

/* sections open on a section symbol */
.page-cfr .section-head .kicker { color: #cfd6e0; }
.page-cfr .section-head .kicker::before { content: "§"; margin-right: 10px; font: 500 22px var(--font-display); letter-spacing: 0; color: #fff; vertical-align: -3px; }

/* every clause is an excerpt on paper, answered in the margin */
.page-cfr .clause { border: 0; border-radius: 2px; background: var(--paper); color: var(--ink); box-shadow: 0 40px 90px -45px rgba(0, 0, 0, 0.9); }
.page-cfr .clause__cite { font: 600 14px var(--font-display); letter-spacing: 0.02em; text-transform: none; color: var(--ink); }
.page-cfr .clause__asks { padding-left: 0; border: 0; background: transparent; }
.page-cfr .clause small { color: var(--ink-soft); }
.page-cfr .clause__asks p { font-size: 21px; color: var(--ink); }
.page-cfr .clause__does { border: 1px dashed rgba(10, 91, 143, 0.5); border-radius: 2px; background: rgba(10, 91, 143, 0.06); }
.page-cfr .clause__does small { color: var(--ink-blue); }
.page-cfr .clause__does p { font: italic 400 17.5px/1.5 var(--font-display); color: #0c2b42; }
.page-cfr .clause__arrow { background: var(--ink-blue); box-shadow: none; }
.page-cfr .clause__arrow::after { border-left-color: var(--ink-blue); }
.page-cfr .clauses__keys b { font: 600 16px var(--font-display); }

@media (max-width: 1100px) {
  .cfr-hero__grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .page-cfr .clause__arrow { background: var(--ink-blue); }
  .page-cfr .clause__arrow::after { border-top-color: var(--ink-blue); border-left-color: transparent; }
}
@media (max-width: 640px) {
  .cfr-hero { padding-top: 112px; }
  .cfr-toc { padding: 22px 18px 18px; font-size: 14px; }
  .cfr-toc li > span, .cfr-toc a > span { min-width: 62px; }
  .cfr-toc a em { display: block; margin: 2px 0 0 62px; }
}
html[data-motion="paused"] .cfr-toc mark { animation: none; }
@media (prefers-reduced-motion: reduce) { .cfr-toc mark { animation: none; } }
