.source-preparation { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; overflow-y: auto; padding: 24px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-elev-1); color: var(--text); box-shadow: var(--shadow); }
.source-preparation::backdrop { background: rgba(0,0,0,.55); }
.source-preparation header { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.source-preparation h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
.source-prep-time { color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.source-prep-title { color: var(--text-dim); overflow-wrap: anywhere; max-height: 100px; overflow: auto; line-height: 1.6; }
.source-prep-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; padding: 12px 0; margin: 0; }
.source-prep-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--text-dim); font-size: 13px; }
.source-prep-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg-elev-1); }
.source-prep-icon svg { width: 18px; height: 18px; }
.source-prep-steps li:not(:last-child)::after { content: ''; position: absolute; height: 2px; top: 19px; left: calc(50% + 20px); width: calc(100% - 40px); background: var(--border-strong); }
.source-prep-steps li.done { color: var(--success); }
.source-prep-steps li.done .source-prep-icon { border-color: var(--success); }
.source-prep-steps li.active { color: var(--accent); }
.source-prep-steps li.active .source-prep-icon { border-color: var(--accent); animation: source-prep-pulse 1.6s ease-in-out infinite; }
.source-prep-steps li:has(+ li.active)::after { background: linear-gradient(90deg, var(--border-strong), var(--accent), var(--purple), var(--border-strong)); background-size: 200% 100%; animation: source-prep-flow 1.2s linear infinite; }
.source-prep-status { min-height: 44px; line-height: 1.7; overflow-wrap: anywhere; margin: 16px 0 8px; font-size: 14px; }
.source-prep-activity { position: relative; height: 3px; overflow: hidden; background: var(--border); }
.source-prep-activity span { display: block; width: 35%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--purple)); animation: source-prep-scan 1.8s ease-in-out infinite; }
.source-preparation footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.source-preparation footer button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; }
.source-preparation footer button[hidden] { display: none; }
.source-preparation.failed .source-prep-status { color: var(--danger); }
.source-preparation.failed .source-prep-activity span { animation: none; background: var(--danger); width: 100%; }
@keyframes source-prep-pulse { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
@keyframes source-prep-flow { to { background-position: -200% 0; } }
@keyframes source-prep-scan { from { transform: translateX(-100%); } to { transform: translateX(390%); } }
@media (max-width: 480px) { .source-preparation { padding: 18px; } .source-prep-steps li { font-size: 12px; gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .source-preparation *, .source-preparation *::after { animation: none !important; } }
.source-import:not([hidden]) { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:8px 0; color:var(--text-dim); font-size:13px; }
.source-import button[hidden] { display:none; }
