/* Caminho.DEV — the live automations screen beside the /business-automation intro
   (assets/js/auto-demo.js). Applies only once the script has taken the screen over
   (.is-live), so without it the drawn table in pages.css is untouched. */

.mp-auto.is-live { position: relative; }
.mp-auto.is-live [role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mp-auto.is-live [role="button"]:focus-visible { outline: 2px solid var(--mp-accent); outline-offset: 2px; }
.mp-auto.is-live .mp-dash-side span { transition: background .15s, color .15s; }
.mp-auto.is-live .mp-dash-side span:not(.on):hover { background: #18264f; color: #fff; }

/* Header badge. */
.mp-ad-live { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 8px; padding: 4px 10px; border-radius: 99px;
  font-size: .62rem; font-weight: 600; color: #0f7a3a; background: #e6f7ec; white-space: nowrap; }
.mp-ad-live b { font-variant-numeric: tabular-nums; }
.mp-ad-live i { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: mpAdPing 1.8s infinite; }
@keyframes mpAdPing { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

/* Panes. */
.mp-auto.is-live .mp-auto-main { display: flex; flex-direction: column; }
.mp-ad-pane { display: none; flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.mp-ad-pane.on { display: block; animation: mpAdIn .22s ease; }
@keyframes mpAdIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Load-in: shimmering placeholders, then the rows arrive one by one. */
.mp-auto-table.is-loading .mp-auto-row:not(.mp-auto-row--h) > span { color: transparent !important; border-radius: 5px;
  background: linear-gradient(90deg, #eef1f7 25%, #f8f9fd 50%, #eef1f7 75%); background-size: 200% 100%; animation: mpAdShimmer 1s linear infinite; }
.mp-auto-table.is-loading .mp-auto-row:not(.mp-auto-row--h) > span * { visibility: hidden; }
.mp-auto-table.is-loaded .mp-auto-row:not(.mp-auto-row--h) { animation: mpAdRow .45s ease backwards; }
.mp-auto-table.is-loaded .mp-auto-row:nth-child(3) { animation-delay: .08s; }
.mp-auto-table.is-loaded .mp-auto-row:nth-child(4) { animation-delay: .16s; }
.mp-auto-table.is-loaded .mp-auto-row:nth-child(5) { animation-delay: .24s; }
.mp-auto-table.is-loaded .mp-auto-row:nth-child(6) { animation-delay: .32s; }
@keyframes mpAdShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes mpAdRow { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* A run: the row lights up, a progress line crosses it, then it flashes green. */
.mp-auto.is-live .mp-auto-row { position: relative; transition: background .3s; }
.mp-auto-row.is-run { background: #f5f8ff; }
.mp-auto-row.is-run > span:nth-child(3) { color: var(--mp-accent); font-weight: 600; }
.mp-auto-row.is-done { background: #f2fbf5; }
.mp-auto-row.is-done .mp-pill { animation: mpAdPop .35s cubic-bezier(.3, 1.6, .5, 1); }
.mp-ad-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, #60a5fa, var(--mp-accent)); opacity: 0; }
.mp-auto-row.is-run .mp-ad-progress { opacity: 1; animation: mpAdFill 2.1s cubic-bezier(.4, .1, .3, 1) forwards; }
@keyframes mpAdFill { to { width: 100%; } }
@keyframes mpAdPop { from { transform: scale(.7); } to { transform: none; } }
.mp-ad-running { gap: 5px !important; }
.mp-ad-spin { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(58, 71, 184, .25);
  border-top-color: currentColor; animation: mpAdSpin .7s linear infinite; }
@keyframes mpAdSpin { to { transform: rotate(360deg); } }

/* Runs & history. */
.mp-ad-log { list-style: none; margin: 0; padding: 0; border: 1px solid var(--mp-line-2); border-radius: 10px; }
.mp-ad-log li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; font-size: .64rem; color: var(--mp-muted); }
.mp-ad-log li + li { border-top: 1px solid var(--mp-line-2); }
.mp-ad-log li.is-new { animation: mpAdRow .4s ease; background: #f2fbf5; }
.mp-ad-log li > i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e6f7ec; color: #16a34a; }
.mp-ad-log li > i svg { width: 11px; height: 11px; stroke-width: 2.6; }
.mp-ad-log b { display: block; font-size: .72rem; color: var(--mp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-ad-log time { font-size: .6rem; font-variant-numeric: tabular-nums; }

/* Connections. */
.mp-ad-conns { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mp-ad-conns li { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--mp-line-2); border-radius: 10px; min-width: 0; transition: border-color .3s, background .3s; }
.mp-ad-conns li > i { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--mp-soft); color: var(--mp-accent); }
.mp-ad-conns li > i svg { width: 14px; height: 14px; }
.mp-ad-conns b { flex: 1; min-width: 0; font-size: .72rem; color: var(--mp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-ad-conns em { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: .58rem; font-weight: 700; color: #0f7a3a; white-space: nowrap; }
.mp-ad-conns em svg { width: 10px; height: 10px; stroke-width: 2.6; }
.mp-ad-conns li[data-state="sync"] { border-color: #bcd0fb; background: #f5f8ff; }
.mp-ad-conns li[data-state="sync"] em { color: var(--mp-accent); }

/* Settings. */
.mp-ad-prefs { border: 1px solid var(--mp-line-2); border-radius: 10px; padding: 2px 14px; }
.mp-ad-prefs > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: .72rem; font-weight: 600; color: var(--mp-ink); }
.mp-ad-prefs > div + div { border-top: 1px solid var(--mp-line-2); }
.mp-ad-switch { position: relative; flex: none; width: 32px; height: 18px; border-radius: 99px; background: #d5dbea; transition: background .2s; }
.mp-ad-switch::before { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s; }
.mp-ad-switch.on { background: var(--mp-accent); }
.mp-ad-switch.on::before { transform: translateX(14px); }

.mp-ad-toast { position: absolute; left: 50%; bottom: 14px; z-index: 3; transform: translate(-50%, 10px); display: flex; align-items: center; gap: 7px;
  background: #0f1a3d; color: #fff; font-size: .66rem; font-weight: 600; padding: 8px 12px; border-radius: 9px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.mp-ad-toast.on { opacity: 1; transform: translate(-50%, 0); }
.mp-ad-toast svg { width: 13px; height: 13px; color: #4ade80; }

/* Phones: pages.css hides the sidebar here, so the live screen shows it as a row of tabs. */
@media (max-width: 640px) {
  .mp-auto.is-live .mp-dash-side { display: flex; flex-direction: row; gap: 4px; padding: 8px; overflow-x: auto; scrollbar-width: none; }
  .mp-auto.is-live .mp-dash-side b { display: none; }
  .mp-auto.is-live .mp-dash-side span { white-space: nowrap; flex: none; font-size: .68rem; }
  .mp-ad-live { display: none; }
  .mp-ad-conns { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .mp-auto.is-live *, .mp-auto.is-live *::before { animation: none !important; transition: none !important; }
}

/* Connections: the sync status sits under the system's name, so neither is cut short. */
.mp-ad-conns li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-ad-conns li > span b { flex: none; }
