/* One nine-second sequence: source → comparison → history → email → webhook.
   The finished state is always readable; motion only adds emphasis. */
.mw-workflow {
  --mw-accent: var(--ui-v2-primary, #9766f6);
  --mw-surface: #fff;
  --mw-border: #e5e7eb;
  --mw-muted: #6b7280;
  --mw-soft: #f6f6f8;
  --mw-highlight: #c0a2f9;
  --mw-success: #15803d;
  --mw-warning: #c2410c;
  --mw-warning-bg: #fff7ed;
  container-type: inline-size;
  width: 100%;
  max-width: 580px;
  min-width: 0;
  margin: 0 auto;
  color: var(--ui-v2-text, #111318);
}
.mw-card {
  min-width: 0;
  background: var(--mw-surface);
  border: 1px solid var(--mw-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px #0f172a06;
  animation: mw-card-activate 9s ease-in-out var(--mw-delay, 0s) infinite;
}
.mw-source { width: min(280px, 100%); margin: 0 auto; padding: 20px 24px; }
.mw-source-domain { display: flex; align-items: center; gap: 10px; }
.mw-source-domain strong { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.mw-source-icon { color: var(--mw-accent); font-size: 22px; }
.mw-active { display: flex; align-items: center; gap: 7px; margin: 8px 0 16px; color: var(--mw-success); font-size: 12px; font-weight: 500; }
.mw-status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mw-chips { display: flex; gap: 8px; }
.mw-chips > span { padding: 4px 9px; border: 1px solid #9766f626; border-radius: 4px; background: #9766f608; color: #824ef5; font-size: 11px; font-weight: 600; animation: mw-chip-activate 9s ease-in-out var(--mw-delay) infinite; }
.mw-connector { display: block; width: 100%; overflow: visible; }
.mw-connector--source { height: 48px; }
.mw-connector--outcomes { height: 60px; }
.mw-line { fill: none; stroke: #9766f64d; stroke-width: 1.25; }
.mw-pulse { fill: none; stroke: var(--mw-accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 9 100; stroke-dashoffset: 9; opacity: 0; animation: mw-pulse 9s linear var(--mw-delay) infinite; }
.mw-change { --mw-highlight: #fdba74; padding: 24px; box-shadow: 0 12px 32px #0f172a08; }
.mw-change-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.mw-change-label { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 4px; color: var(--mw-warning); background: var(--mw-warning-bg); font-size: 12px; font-weight: 600; }
.mw-change-label .material-symbols-outlined { font-size: 17px; }
.mw-time { color: var(--mw-muted); font-size: 12px; }
.mw-change h3 { margin: 20px 0; font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -.025em; }
.mw-comparison { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); align-items: center; gap: 8px; }
.mw-value { min-width: 0; border: 1px solid var(--mw-border); border-radius: 8px; padding: 14px 12px; background: var(--mw-soft); }
.mw-value > span { display: block; margin-bottom: 8px; color: var(--mw-muted); font-size: 12px; line-height: 16px; }
.mw-value code { display: block; font: 14px/22px ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.mw-value--previous code { animation: mw-value-reveal 9s ease-in-out 2.8s infinite; }
.mw-value--current { border-color: #9766f64d; background: #9766f60a; }
.mw-value--current > span { color: #824ef5; font-weight: 600; }
.mw-value--current code { animation: mw-value-reveal 9s ease-in-out 3.5s infinite; }
.mw-comparison-arrow { color: var(--mw-accent); font-size: 20px; }
.mw-outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mw-outcome { display: grid; grid-template-rows: auto auto auto 1fr; justify-items: start; padding: 16px; }
.mw-outcome-icon { color: var(--mw-accent); font-size: 22px; margin-bottom: 12px; }
.mw-outcome h4 { font-size: 14px; line-height: 20px; font-weight: 700; margin: 0 0 7px; }
.mw-success { color: var(--mw-success); font-size: 12px; line-height: 18px; font-weight: 600; animation: mw-status 9s ease-in-out var(--mw-delay) infinite; }
.mw-outcome p { margin: 10px 0 0; color: var(--mw-muted); font-size: 13px; line-height: 20px; }
@keyframes mw-card-activate {
  0%, 23%, 100% { border-color: var(--mw-border); box-shadow: 0 8px 24px #0f172a06; }
  7%, 15% { border-color: var(--mw-highlight); box-shadow: 0 8px 24px #9766f614; }
}
@keyframes mw-chip-activate {
  0%, 24%, 100% { background: #9766f608; }
  8%, 16% { background: #9766f61f; }
}
@keyframes mw-pulse {
  0% { opacity: 0; stroke-dashoffset: 9; }
  2% { opacity: .85; }
  9% { opacity: .85; stroke-dashoffset: -100; }
  11%, 100% { opacity: 0; stroke-dashoffset: -100; }
}
@keyframes mw-value-reveal {
  0%, 24%, 100% { opacity: 1; transform: translateY(0); }
  3% { opacity: .55; transform: translateY(2px); }
  12%, 18% { opacity: 1; transform: translateY(0); }
}
@keyframes mw-status {
  0%, 26%, 100% { opacity: .8; }
  9%, 18% { opacity: 1; }
}
@container (max-width: 499px) {
  .mw-source { padding: 16px 20px; }
  .mw-connector--source { height: 32px; }
  .mw-connector--outcomes { height: 44px; }
  .mw-change { padding: 20px 16px; }
  .mw-comparison { gap: 6px; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); }
  .mw-comparison-arrow { font-size: 16px; }
  .mw-value { padding: 12px 10px; }
  .mw-outcomes { gap: 10px; }
  .mw-outcome { padding: 14px 12px; }
}
/* On phones the comparison and outcomes become readable vertical steps. */
@container (max-width: 419px) {
  .mw-change h3 { font-size: 19px; }
  .mw-comparison { grid-template-columns: 1fr; gap: 10px; }
  .mw-comparison-arrow { justify-self: center; transform: rotate(90deg); font-size: 20px; }
  .mw-value { padding: 14px; }
  .mw-connector--outcomes { display: none; }
  .mw-outcomes { grid-template-columns: 1fr; gap: 12px; padding-top: 32px; position: relative; }
  .mw-outcomes::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid #9766f64d; z-index: -1; }
  .mw-outcome { grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 16px; }
  .mw-outcome-icon { grid-row: 1 / 3; margin: 0; }
  .mw-outcome h4 { margin: 0; }
  .mw-success { grid-column: 3; grid-row: 1; }
  .mw-outcome p { grid-column: 2 / 4; margin-top: 4px; }
}
.dark .mw-workflow { --mw-surface: #1e293b; --mw-border: #374151; --mw-muted: #9ca3af; --mw-soft: #0f172a; --mw-success: #4ade80; --mw-warning: #fdba74; --mw-warning-bg: #431407; color: #f3f4f6; }
.dark .mw-chips > span, .dark .mw-value--current > span { color: #c0a2f9; }
@media (max-width: 1023px) {
  .mw-connector--source { height: 32px; }
  .mw-connector--outcomes { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .mw-workflow *, .mw-workflow *::before { animation: none !important; }
  .mw-pulse { display: none; }
  .mw-success { opacity: 1; }
}
