:root {
    --bg-primary: #0b1120; --text-primary: #f8fafc; --text-secondary: #94a3b8;
    --accent-cyan: #00d2ff; --accent-purple: #818cf8; --success: #4ade80; --warning: #f9a875;
}
* { box-sizing: border-box; }
html { font-size: clamp(13px, calc(0.6vw + 0.75vh), 24px); }
body.wf-body {
    margin: 0; font-family: 'Outfit', system-ui, sans-serif; color: var(--text-primary); background: var(--bg-primary);
    background-image: radial-gradient(circle at 15% 50%, rgba(0, 210, 255, 0.04) 0%, transparent 50%),
                      radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.05) 0%, transparent 50%);
    min-height: 100vh; -webkit-font-smoothing: antialiased; line-height: 1.5;
}
a { color: inherit; }
.wf-top { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 2rem 0; }
.wf-brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.wf-brand img { height: 1.9rem; width: auto; }
.wf-brand span { font-size: 0.78rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-secondary); border-left: 1px solid rgba(148, 163, 184, 0.35); padding-left: 0.8rem; }
.wf-deck, .wf-nav {
    font-size: 0.74rem; font-weight: 600; color: var(--text-secondary); text-decoration: none; padding: 5px 14px; border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3); transition: color .2s, border-color .2s;
}
.wf-deck:hover, .wf-nav:hover, .wf-deck:focus-visible, .wf-nav:focus-visible { color: #fff; border-color: var(--accent-cyan); outline: none; }
.wf-badge {
    display: inline-block; padding: 4px 12px; border-radius: 15px; font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase;
    color: var(--accent-cyan); background: rgba(0, 210, 255, 0.1); border: 1px solid rgba(0, 210, 255, 0.3);
}
.wf-main {
    height: calc(100vh - 3.4rem); max-width: min(96vw, 1800px); margin: 0 auto; padding: 0.8rem 1.6rem 1rem;
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; gap: 0.6rem;
}
.ing-title span { background: linear-gradient(135deg, #fff 10%, var(--accent-cyan) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ing-info {
    display: grid; grid-template-columns: 14rem 1fr auto; align-items: center; gap: 1rem; min-height: 3.1rem; padding: 0.55rem 1rem;
    border-radius: 10px; background: rgba(0, 210, 255, 0.05); border: 1px solid rgba(0, 210, 255, 0.18);
}
.ing-info-name { color: var(--accent-cyan); font-weight: 700; font-size: 0.92rem; }
.ing-info-text { color: #dbe4f3; font-size: 0.82rem; line-height: 1.4; }
.ing-info-where { color: var(--text-secondary); font-size: 0.72rem; white-space: nowrap; }
.wf-navs { display: flex; justify-content: center; gap: 0.6rem; }
a.ing-node { text-decoration: none; cursor: pointer; }
.ing-link-r { stroke: var(--accent-cyan) !important; stroke-dasharray: 5 4; }
.ing-ai rect { fill: rgba(148, 163, 184, 0.12); stroke-dasharray: 3 3; }
.ing-ai text { fill: #f1f5f9; }
.ing-row-t { font-size: 14px; font-weight: 800; letter-spacing: 1px; fill: #38bdf8; }
.ing-row-t tspan { font-weight: 500; letter-spacing: 0; fill: #94a3b8; }
.ing-step2 .ing-box { stroke: #38bdf8; fill: rgba(56, 189, 248, 0.07); }
.ing-par-l { stroke-dasharray: 0.02 0.015; }
.ing-map path.ing-line.ing-par-l { stroke-dasharray: 0.02 0.015; stroke-dashoffset: 0; opacity: 0; transition: opacity .8s ease calc(var(--d) * 1ms); }
.ing-map.play path.ing-line.ing-par-l { opacity: 1; }

/* library index */
.wf-libmain { max-width: min(92vw, 1500px); margin: 0 auto; padding: 3rem 2rem 4rem; }
.wf-libtitle { font-size: 2.6rem; margin: 0.8rem 0 0.4rem; line-height: 1.15; }
.wf-libtitle span { background: linear-gradient(135deg, #fff 10%, var(--accent-cyan) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wf-libsub { color: var(--text-secondary); font-size: 1rem; max-width: 46rem; margin: 0 0 2.2rem; }
.wf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.2rem; }
.wf-card {
    position: relative; display: flex; flex-direction: column; gap: 0.5rem; padding: 1.4rem 1.5rem 1.3rem; border-radius: 18px; text-decoration: none;
    background: rgba(30, 41, 59, 0.55); border: 1px solid rgba(255, 255, 255, 0.08); overflow: hidden;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.wf-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); box-shadow: 0 0 18px var(--c); }
.wf-card:hover, .wf-card:focus-visible { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 18px 40px -18px var(--c); outline: none; }
.wf-card-k { font-size: 0.68rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--c); }
.wf-card h2 { margin: 0; font-size: 1.45rem; }
.wf-card p { margin: 0; color: var(--text-secondary); font-size: 0.86rem; }
.wf-card ul { list-style: none; padding: 0; margin: 0.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wf-card li { font-size: 0.74rem; color: var(--text-secondary); padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.25); }
.wf-card li b { color: #fff; }
.wf-card-go { margin-top: auto; padding-top: 0.6rem; font-size: 0.8rem; font-weight: 700; color: var(--c); }

@media (max-width: 900px) {
    .wf-top { padding: 0.8rem 1rem 0; }
    .wf-main { height: auto; display: flex; flex-direction: column; padding: 0.8rem 1rem 1.5rem; }
    .ing-head { flex-direction: column; align-items: flex-start; }
    .ing-ctrl { flex-wrap: wrap; }
    .wf-main .ing-map { overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; }
    .wf-main .ing-svg { min-width: 1100px; height: 480px; flex: none; }
    .ing-hint { display: none; }
    .ing-info { grid-template-columns: 1fr; gap: 0.3rem; }
    .ing-info-where { white-space: normal; }
    .wf-libtitle { font-size: 2rem; }
}


/* ---- Ingest workflow map (slide 8) ---- */

.ing-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.ing-title { font-size: 1.75rem; margin: 0.3rem 0 0.15rem; }
.ing-sub { font-size: 0.82rem; color: var(--text-secondary); margin: 0; }
.ing-replay {
    font: inherit; font-size: 0.72rem; font-weight: 700; color: var(--accent-cyan); cursor: pointer; white-space: nowrap;
    padding: 5px 14px; border-radius: 999px; border: 1px solid rgba(0, 210, 255, 0.5); background: rgba(0, 210, 255, 0.07);
}
.ing-replay:hover, .ing-replay:focus-visible { background: var(--accent-cyan); color: var(--bg-primary); outline: none; }
.ing-ctrl { display: flex; align-items: center; gap: 0.6rem; }
.ing-steps { display: flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.3); background: rgba(15, 23, 42, 0.6); }
.ing-steps button {
    font: inherit; font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
    padding: 4px 11px; border-radius: 999px; border: 0; background: transparent; transition: background .2s, color .2s;
}
.ing-steps button:hover, .ing-steps button:focus-visible { color: #fff; outline: none; }
.ing-steps button.is-on { background: var(--accent-cyan); color: var(--bg-primary); }
.ing-info.is-scene { border-color: rgba(0, 210, 255, 0.45); background: rgba(0, 210, 255, 0.08); }
.ing-info.is-scene .ing-info-name { font-size: 1.05rem; }
.ing-info.is-scene .ing-info-text { font-size: 0.95rem; color: #fff; }
.ing-map { display: flex; justify-content: center; min-height: 0; }
.ing-svg .grp { transition: opacity .7s ease; }
.ing-map.zoomed .ing-svg .grp { opacity: 0.1; }
.ing-map.scene-1 .grp.sc1, .ing-map.scene-2 .grp.sc2, .ing-map.scene-3 .grp.sc3 { opacity: 1; }
.ing-svg { width: 100%; height: 100%; overflow: hidden; font-family: inherit; }
.ing-svg text { font-family: inherit; }
.ing-lane-t { font-size: 16px; font-weight: 800; letter-spacing: 0.6px; }
.ing-lane-s { font-size: 13px; fill: #94a3b8; }
.ing-chip text { font-size: 14px; fill: #e2e8f0; font-weight: 500; }
.ing-chip.is-last text { font-weight: 800; fill: #fff; }
.ing-ai rect { fill: rgba(192, 132, 252, 0.16); stroke: #c084fc; stroke-dasharray: 3 3; }
.ing-ai text { font-size: 12px; fill: #e9d5ff; font-weight: 700; }
.ing-count, .ing-box-n { font-size: 26px; font-weight: 800; fill: #fff; }
.ing-cap, .ing-box-c { font-size: 13px; fill: #94a3b8; }
.ing-box { fill: #0d1729; stroke: rgba(203, 213, 225, 0.45); stroke-width: 1.5; }
.ing-box-t { font-size: 15px; font-weight: 800; letter-spacing: 1.4px; fill: #fff; }
.ing-box-s { font-size: 13px; fill: var(--accent-cyan); font-weight: 600; }
.ing-gate .ing-box { stroke: #f5b800; fill: rgba(245, 184, 0, 0.08); }
.ing-gate .ing-box-t { fill: #ffe08a; }
.ing-push .ing-box { stroke: var(--accent-cyan); fill: rgba(0, 210, 255, 0.08); }
.ing-pub .ing-pub-r { stroke: #4ade80; stroke-width: 2.2; fill: rgba(74, 222, 128, 0.1); animation: ingPub 2.8s ease-in-out infinite; }
.ing-pub-n { font-size: 34px; font-weight: 800; fill: #fff; }
.ing-pub-m { font-size: 14px; fill: #bbf7d0; font-weight: 600; }
@keyframes ingPub { 0%, 100% { filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.35)); } 50% { filter: drop-shadow(0 0 14px rgba(74, 222, 128, 0.75)); } }
.ing-slack-r { fill: rgba(129, 140, 248, 0.1); stroke: rgba(129, 140, 248, 0.55); stroke-dasharray: 4 4; }
.ing-slack-t { font-size: 14.5px; fill: #c7d2fe; }
.ing-strong { font-weight: 800; fill: #fff; }
.ing-order { font-size: 13px; fill: #94a3b8; letter-spacing: 0.5px; }
.ing-err-r { stroke: #f87171; fill: rgba(248, 113, 113, 0.08); }
.ing-err-t { fill: #fecaca; }
.ing-err-m { font-size: 15px; fill: #e2e8f0; }
.ing-err-m tspan { font-weight: 800; fill: #fff; }
.ing-err-l { stroke-dasharray: 0.012 0.008; }
.ing-loop-t { font-size: 13.5px; fill: #fca5a5; font-style: italic; }
.ing-hit { fill: transparent; }
.ing-node { cursor: default; outline: none; }
.ing-node:hover .ing-hit, .ing-node:focus-visible .ing-hit { fill: rgba(148, 163, 184, 0.07); }
.ing-node:hover .ing-box, .ing-node:focus-visible .ing-box,
.ing-node:hover .ing-slack-r, .ing-node:focus-visible .ing-slack-r { stroke: #fff; }
.ing-map.has-focus .ing-node:not(.ing-focus) { opacity: 0.4 !important; }
.ing-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem 0.7rem; }
.ing-stats div {
    font-size: 0.74rem; color: var(--text-secondary); padding: 4px 12px; border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25); background: rgba(15, 23, 42, 0.6);
}
.ing-stats b { color: #fff; font-weight: 800; }

/* entrance: hidden until the slide plays */
.ing-map .seq { opacity: 0; transform: translateY(6px); transform-box: fill-box;
                transition: opacity .55s ease, transform .55s ease; transition-delay: calc(var(--d) * 1ms); }
.ing-map .ing-line { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 1; transform: none;
                     transition: stroke-dashoffset .9s ease; transition-delay: calc(var(--d) * 1ms); }
.ing-map .ing-line[marker-end] { opacity: 0; transition: stroke-dashoffset .9s ease calc(var(--d) * 1ms), opacity .3s ease calc(var(--d) * 1ms + 650ms); }
.ing-map.play .ing-line[marker-end] { opacity: 1; }
.ing-map .ing-err-l { stroke-dasharray: 0.012 0.008; stroke-dashoffset: 0; opacity: 0; transition: opacity .8s ease; transition-delay: calc(var(--d) * 1ms); }
.ing-map .ing-dot { opacity: 0; transition: opacity .6s ease 3.2s; }
.ing-map.play .seq { opacity: 1; transform: none; }
.ing-map.play .ing-line { stroke-dashoffset: 0; }
.ing-map.play .ing-err-l { opacity: 1; }
.ing-map.play .ing-dot { opacity: 1; }
.ing-map.instant .seq, .ing-map.instant .ing-line, .ing-map.instant .ing-dot { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    .ing-map .seq, .ing-map .ing-line, .ing-map .ing-err-l { opacity: 1; transform: none; stroke-dashoffset: 0; transition: none; }
    .ing-map .ing-dot { display: none; }
    .ing-pub .ing-pub-r { animation: none; }
}
@media print {
    .ing-map .seq, .ing-map .ing-line, .ing-map .ing-err-l { opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; transition: none !important; }
    .ing-map .ing-dot, .ing-replay, .ing-info { display: none !important; }
    .ing-svg { height: 4.75in; }
    .ing-steps, .ing-hint { display: none !important; }
    .ing-svg .grp { opacity: 1 !important; }
}