/* Share page (/v/<id>): pipeline steps, rendered Markdown, colored code with line numbers and unified diffs.
   Built by static/js/share_render.js and share.js. Tokens come from style.css. No inline styles (strict CSP). */

.sr-steps { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: sr-step; }
.sr-steps > li { position: relative; padding: 10px 12px 10px 44px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--surface-2); }
.sr-steps > li::before { counter-increment: sr-step; content: counter(sr-step); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); font-family: var(--font-mono); font-size: 0.74rem; line-height: 20px; text-align: center; color: var(--text-faint); }
.sr-steps > li.is-done::before { background: var(--ok); border-color: var(--ok); color: var(--bg, #0c0c0b); }
.sr-steps > li.is-now { border-color: var(--accent-line); }
.sr-steps > li.is-now::before { background: var(--accent); border-color: var(--accent); color: var(--bg, #0c0c0b); box-shadow: 0 0 0 3px var(--accent-dim); }
.sr-steps > li.is-bad { border-color: var(--err); }
.sr-steps > li.is-bad::before { background: var(--err); border-color: var(--err); color: #fff; }
.sr-steps > li.is-skipped { opacity: 0.6; }
.sr-step-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sr-step-name { font-weight: 700; overflow-wrap: anywhere; }
.sr-step-name a { color: var(--text); }
.sr-step-state { font-family: var(--font-mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.is-done .sr-step-state { color: var(--ok); }
.is-now .sr-step-state { color: var(--accent); }
.is-bad .sr-step-state { color: var(--err); }
.sr-step-note { margin: 4px 0 0; font-size: 0.86rem; color: var(--text-dim); overflow-wrap: anywhere; }
.sr-step-bar { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--border); overflow: hidden; }
.sr-step-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.sr-step-bar.is-unknown span { width: 30%; animation: sr-slide 1.4s ease-in-out infinite; }
.sr-step-bar span.w0 { width: 0; }
@keyframes sr-slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .sr-step-bar.is-unknown span { animation: none; width: 100%; opacity: 0.4; } }

.sr-view { margin-top: 12px; }
.sr-view-h { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); margin: 0 0 6px; overflow-wrap: anywhere; }
.sr-raw { margin-top: 12px; }
.sr-raw summary { cursor: pointer; color: var(--text-dim); font-size: 0.88rem; }

/* Markdown */
.sr-md { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); overflow-wrap: anywhere; }
.sr-md > :first-child { margin-top: 0; }
.sr-md > :last-child { margin-bottom: 0; }
.share-main .sr-md p { color: var(--text); }
.sr-md h3, .sr-md h4, .sr-md h5, .sr-md h6, .sr-md h7, .sr-md h8 { font-weight: 700; margin: 1.1em 0 0.5em; }
.sr-md h3 { font-size: 1.3rem; } .sr-md h4 { font-size: 1.12rem; } .sr-md h5, .sr-md h6 { font-size: 1rem; }
.sr-md blockquote { margin: 0 0 1em; padding: 2px 0 2px 12px; border-left: 3px solid var(--border-strong); color: var(--text-dim); }
.sr-md a { color: var(--accent); }
.sr-md ul, .sr-md ol { padding-left: 1.4rem; }
.sr-md li.sr-task { list-style: none; margin-left: -1.2rem; }
.sr-table { overflow-x: auto; margin-bottom: 1em; }
.sr-md table { border-collapse: collapse; font-size: 0.9rem; }
.sr-md th, .sr-md td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }

/* Code, line numbers and diffs */
.sr-code { counter-reset: sr-line; margin: 0 0 1em; padding: 10px 0; max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.55; color: var(--text); white-space: pre; tab-size: 4; }
.sr-line { display: block; padding: 0 12px 0 0; min-height: 1.55em; }
.sr-line::before { counter-increment: sr-line; content: counter(sr-line); display: inline-block; width: 3.4em; margin-right: 12px; padding-right: 8px; text-align: right; color: var(--text-faint); border-right: 1px solid var(--border); user-select: none; }
.sr-cut { display: block; padding: 6px 12px 0; font-style: italic; color: var(--warn); white-space: normal; }
.sr-c { color: var(--text-faint); font-style: italic; }
.sr-s { color: #9ece6a; }
.sr-n { color: #e0af68; }
.sr-k { color: #bb9af7; font-weight: 600; }
.sr-t { color: #7dcfff; }
.sr-diff .sr-add { background: rgba(61, 220, 132, 0.13); color: #8ee6a8; }
.sr-diff .sr-del { background: rgba(255, 92, 92, 0.13); color: #ff9c9c; }
.sr-diff .sr-hunk { color: #7dcfff; background: rgba(125, 207, 255, 0.08); }
.sr-diff .sr-meta { color: var(--text-dim); font-weight: 700; }
[data-theme="light"] .sr-s { color: #2f7d32; }
[data-theme="light"] .sr-n { color: #a15c00; }
[data-theme="light"] .sr-k { color: #7c3aed; }
[data-theme="light"] .sr-t { color: #0369a1; }
[data-theme="light"] .sr-diff .sr-add { color: #166534; }
[data-theme="light"] .sr-diff .sr-del { color: #991b1b; }

/* Side-by-side diff: old text left, new text right, changed words marked */
.sr-split-wrap { margin: 0 0 1em; max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.sr-split { width: 100%; table-layout: fixed; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.55; color: var(--text); }
.sr-split td { vertical-align: top; padding: 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.sr-split col.sr-split-n { width: 3.6em; }
.sr-split .sr-split-num { padding: 0 8px 0 4px; text-align: right; color: var(--text-faint); border-right: 1px solid var(--border); user-select: none; white-space: nowrap; }
.sr-split .sr-split-text:nth-child(2) { border-right: 1px solid var(--border); }
.sr-split .sr-del { background: rgba(255, 92, 92, 0.13); }
.sr-split .sr-add { background: rgba(61, 220, 132, 0.13); }
.sr-split .sr-none { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--border) 6px 7px); opacity: 0.55; }
.sr-split-hunk td { padding: 2px 8px; color: #7dcfff; background: rgba(125, 207, 255, 0.08); white-space: pre; }
.sr-split .sr-word { padding: 0; border-radius: 2px; color: inherit; background: rgba(255, 92, 92, 0.38); }
.sr-split .sr-add .sr-word { background: rgba(61, 220, 132, 0.38); }
[data-theme="light"] .sr-split-hunk td { color: #0369a1; }
@media (max-width: 575px) { .sr-split { font-size: 0.74rem; } .sr-split col.sr-split-n { width: 2.6em; } }
