/* bleed-autopilot (9 Nov): the autopilot bar, the held reason on a row, the sent log with Undo, and
   the settings' Autopilot section (web/bleed-autopilot.js, bleed-settings.js). app.css tokens
   only, so light and dark are a token swap. State is always words; colour only repeats it. */

/* the tab stacks the bar over the three columns */
body.wide #tab-bleed { flex-direction: column; }
#tab-bleed > .bd { flex: 1; min-height: 0; }

.bd-auto { --bd-auto-tone: var(--muted); flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 16px; border-bottom: 1px solid var(--rule); background: var(--paper); color: var(--ink2); font-size: 12.5px; line-height: 1.3; box-shadow: inset 3px 0 0 var(--bd-auto-tone); }
.bd-auto[data-mode="on"] { --bd-auto-tone: var(--ok); }
.bd-auto[data-mode="test"] { --bd-auto-tone: var(--info); }
.bd-auto[data-mode="paused"] { --bd-auto-tone: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--paper)); }
.bd-auto-name { display: inline-flex; align-items: center; gap: 7px; font: 600 10.5px var(--text); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.bd-auto-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bd-auto-tone); }
.bd-auto-mode { color: var(--ink); font-weight: 600; white-space: nowrap; }
.bd-auto[data-mode="paused"] .bd-auto-mode { color: var(--warn); }
.bd-auto-today { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: var(--soft); font-variant-numeric: tabular-nums; }
.bd-auto-label { color: var(--muted); }
.bd-auto-n b, .bd-auto-held b { color: var(--ink); font-weight: 600; }
.bd-auto .bd-auto-held { height: auto; min-height: 0; padding: 0; gap: 0; color: var(--warn); font-size: inherit; font-weight: 400; }
.bd-auto .bd-auto-held b { color: var(--warn); margin-right: 3px; }
.bd-auto-note { flex: 1 1 260px; min-width: 0; color: var(--muted); font-size: 12px; }
.bd-auto-switch { flex: none; height: 30px; gap: 6px; padding: 0 12px; font-size: 12.5px; font-weight: 600; }
.bd-auto-switch .icon { width: 14px; height: 14px; }
.bd-auto .bd-auto-switch[data-bd-auto-switch="pause"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--rule)); background: var(--paper); }
.bd-auto .bd-auto-switch[data-bd-auto-switch="pause"]:hover { background: color-mix(in srgb, var(--warn) 10%, var(--paper)); }

/* a held row: why, in a line that wraps (at most two) */
.bd-auto-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.35; color: var(--warn); }
.bd-auto-why b { font-weight: 600; }
.bd-tag.bd-auto-tag.held { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--rule)); background: color-mix(in srgb, var(--warn) 10%, var(--paper)); }
.bd-tag.bd-auto-tag.soon { color: var(--info); }

/* the sent log, on top of "Bleed handled" */
.bd-auto-log { margin: 10px 12px 0; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--bg); }
.bd-auto-log-head { margin: 0 0 6px; }
.bd-auto-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.bd-auto-item { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid var(--rule); }
.bd-auto-item:first-child { border-top: 0; padding-top: 2px; }
.bd-auto-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.bd-auto .link, .bd-auto-client { padding: 0; height: auto; min-height: 0; }
.bd-auto-client { flex: 1 1 auto; min-width: 0; justify-content: flex-start; color: var(--ink); font-weight: 600; font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-auto-move { font-size: 11px; color: var(--muted); }
.bd-auto-status { font-size: 11px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.bd-auto-status.waiting { color: var(--info); }
.bd-auto-status.delivered, .bd-auto-status.sent { color: var(--ok); }
.bd-auto-status.failed { color: var(--stop); }
.bd-auto-status.cancelled { color: var(--muted); }
.bd-auto-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink2); overflow-wrap: anywhere; }
.bd-auto-item.cancelled .bd-auto-text { text-decoration: line-through; color: var(--muted); }
.bd-auto-item-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.bd-auto-when { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bd-auto-undo { height: 28px; gap: 5px; padding: 0 10px; font-size: 12.5px; font-weight: 600; color: var(--accent3); border-color: var(--gold-line); background: var(--gold-soft); }
.bd-auto-undo .icon { width: 14px; height: 14px; }
.bd-auto-left { font-variant-numeric: tabular-nums; }
.bd-auto-notice { margin: 2px 0 0; font-size: 12px; color: var(--ok); }
.bd-auto-notice.bad { color: var(--stop); }
.bd-auto-empty { margin: 0; }

/* settings: Autopilot */
.bd-auto-modes { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; color: var(--soft); }
.bd-auto-modes li.on { color: var(--ink); }
.bd-auto-how { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--gold-line); border-radius: var(--r); background: var(--gold-soft); color: var(--ink); font-size: 13px; line-height: 1.45; }
.bd-auto-how h4 { margin: 0 0 6px; font-size: 14px; }
.bd-auto-how ol { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 3px; }
.bd-auto-how .side-note { margin: 0; }

@media (max-width: 760px) {
  .bd-auto { gap: 6px 10px; padding: 7px 16px; }
  .bd-auto-note { display: none; }
  .bd-auto-switch { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .bd-auto, .bd-auto-undo { transition: none; }
}
