/* The Frankenstein half of the Evolution tab (web/frankenstein.js): capabilities, their ledger, the fixed authority,
   and dusk → dawn. Uses style.css's tokens only, so light and dark follow the theme. */
.frank { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 12px 14px; box-shadow: var(--shadow); }
.frank h4 { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.frank h4:first-child { margin-top: 0; }
.frank .notice { margin: 10px 0 0; }

/* counts strip */
.cap-counts { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cc { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); font-size: 11.5px; color: var(--text-2); }
.cc b { color: var(--text); font-variant-numeric: tabular-nums; }
.cc.ce-install b, .cc.ce-use b { color: var(--ok); }
.cc.ce-rejected b { color: var(--bad); }

.cap-name { font: 600 11.5px var(--mono); background: var(--surface-3); border-radius: 6px; padding: 0 6px; overflow-wrap: anywhere; }

/* installed capabilities */
.caps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cap { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.cap p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; }
.cap-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cap-kind { font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 8px; }
.cap-ver { font: 11px var(--mono); color: var(--text-3); }

/* the ledger: a small timeline */
.cap-ledger { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.cap-ev { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; }
.ce-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 12px; line-height: 1; }
.ce-install .ce-icon, .ce-use .ce-icon { border-color: var(--ok); }
.ce-rejected .ce-icon, .cap-ev.bad .ce-icon { border-color: var(--bad); }
.ce-gap .ce-icon { border-color: var(--warn); }
.ce-head { font-size: 12.5px; line-height: 1.5; }
.ce-head b { font-weight: 600; }
.ce-rejected .ce-head b, .cap-ev.bad .ce-head b { color: var(--bad); }
.ce-install .ce-head b, .ce-use .ce-head b { color: var(--ok); }
.ce-when { margin-left: 6px; font-size: 11.5px; color: var(--text-3); }
.ce-body p { margin: 2px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }

/* authority */
.authority { margin-top: 14px; border-radius: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.auth-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.auth-sub { margin: 4px 0 6px; font-size: 12px; color: var(--text-2); line-height: 1.45; }
.authority ul { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.5; }
.authority code { font: 11px var(--mono); }
.auth-sha { margin: 6px 0 0; color: var(--text-3); font-size: 11px; }

/* dusk → dawn */
.dd-status { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.dd-side { padding: 4px 10px; border-radius: 10px; }
.dd-side.dusk { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.dd-side.dawn { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.dd-scroll { overflow-x: auto; margin-top: 10px; }
.dd-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.dd-table th, .dd-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.dd-table th[scope="row"], .dd-table thead th:first-child { text-align: left; font-weight: 600; color: var(--text-2); }
.dd-table thead th { font-weight: 600; color: var(--text-3); }
.dd-task { margin-top: 12px; }
.dd-task-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; font-size: 12.5px; }
.dd-used { margin: 6px 0 0; font-size: 12px; color: var(--text-2); }

/* the manuscript a finished run wrote (web/manuscript.js renders it; app.js shows it under the run) */
.ms-box > summary { cursor: pointer; }
.ms-body { margin-top: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.ms-body h1, .ms-body h2, .ms-body h3, .ms-body h4 { line-height: 1.3; margin: 14px 0 6px; text-transform: none; letter-spacing: 0; color: var(--text); }
.ms-body .ms-title { font-size: 16px; margin-top: 0; }
.ms-body h2 { font-size: 14px; }
.ms-body h3, .ms-body h4 { font-size: 13px; }
.ms-body p { margin: 0 0 8px; }
.ms-body ul, .ms-body ol { margin: 0 0 8px; padding-left: 20px; }
.ms-body blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.ms-body table { border-collapse: collapse; font-size: 12px; margin: 0 0 8px; display: block; overflow-x: auto; }
.ms-body th, .ms-body td { border: 1px solid var(--border); padding: 3px 6px; }
.ms-body code, .ms-body .ms-code { font: 12px var(--mono); background: var(--surface-2); border-radius: 4px; }
.ms-body .ms-code { padding: 8px 10px; overflow-x: auto; }
.ms-body .ms-math { overflow-x: auto; margin: 6px 0 10px; }
.ms-body .math-src { font: 12px var(--mono); color: var(--text-2); }
.ms-body .math-src.display { display: block; white-space: pre-wrap; }
.ms-body .ms-fig { margin: 8px 0 12px; }
.ms-body .ms-fig-frame { background: #fff; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.ms-body .ms-fig img, .ms-body .inline-fig { display: block; max-width: 100%; height: auto; }
.ms-body figcaption { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.ms-body .cites { white-space: nowrap; }
.ms-body .ref { margin: 0 1px; }
.ms-body .katex-display { margin: 6px 0; overflow-x: auto; overflow-y: hidden; }
