/* O'Radar Workflows (11.14.0): the Workflows tab and the step bar. See assets/js/workflows.js. */

.bbhg-wf { --wf: #2f5bff; --wf-ink: #0f172a; --wf-mute: #64748b; --wf-line: #e2e8f0; --wf-bg: #fff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--wf-ink); }
.bbhg-wf-hero { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 18px; background: linear-gradient(135deg, #2f5bff 0%, #7c3aed 55%, #db2777 100%); color: #fff; margin-bottom: 16px; }
.bbhg-wf-hero .bbhg-wf-heroico { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.bbhg-wf-hero svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bbhg-wf-hero h2 { margin: 0; font-size: 22px; line-height: 1.2; color: #fff; }
.bbhg-wf-hero p { margin: 4px 0 0; font-size: 14px; opacity: .92; color: #fff; }

.bbhg-wf-auto { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--wf-ink); margin: 0 0 12px; cursor: pointer; }
.bbhg-wf-auto small { color: var(--wf-mute); }
.bbhg-wf-auto input { width: 16px; height: 16px; accent-color: var(--wf); margin: 0; }

.bbhg-wf-resume { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: #eef2ff; border: 1px solid #c7d2fe; font-weight: 600; font-size: 14px; }
.bbhg-wf-resume span { flex: 1; min-width: 180px; }

.bbhg-wf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.bbhg-wf-sub { font-size: 16px; margin: 22px 0 10px; }
.bbhg-wf-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; background: var(--wf-bg); border: 1px solid var(--wf-line); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.bbhg-wf-card header { display: flex; gap: 12px; align-items: flex-start; }
.bbhg-wf-card .bbhg-wf-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #f1f5f9; font-size: 21px; }
.bbhg-wf-card h3 { margin: 0; font-size: 16px; line-height: 1.3; color: var(--wf-ink); }
.bbhg-wf-card p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: var(--wf-mute); }
.bbhg-wf-chain { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12px; }
.bbhg-wf-chain span { padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #334155; font-weight: 600; }
.bbhg-wf-chain span.off { text-decoration: line-through; opacity: .55; }
.bbhg-wf-chain i { font-style: normal; color: #94a3b8; }
.bbhg-wf-start { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; margin-top: auto; }
.bbhg-wf-start input, .bbhg-wf-start textarea { flex: 1 1 160px; min-width: 0; padding: 9px 11px; border: 1px solid var(--wf-line); border-radius: 10px; font: inherit; font-size: 14px; background: #fff; color: var(--wf-ink); resize: vertical; }
.bbhg-wf-start input:focus, .bbhg-wf-start textarea:focus { outline: 2px solid var(--wf); outline-offset: 1px; border-color: transparent; }

.bbhg-wf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 16px !important; border: 0 !important; border-radius: 10px !important; background: var(--wf, #2f5bff) !important; color: #fff !important; font: 700 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important; cursor: pointer; box-shadow: none !important; text-transform: none !important; letter-spacing: 0 !important; white-space: nowrap; }
.bbhg-wf-btn:hover { filter: brightness(1.08); }
.bbhg-wf-btn:focus-visible { outline: 2px solid var(--wf, #2f5bff); outline-offset: 2px; }
.bbhg-wf-btn.ghost { background: #f1f5f9 !important; color: #1e293b !important; }
.bbhg-wf-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.bbhg-wf-link { background: none !important; border: 0 !important; padding: 0 !important; color: var(--wf, #2f5bff) !important; font: inherit !important; font-weight: 700 !important; text-decoration: underline; cursor: pointer; box-shadow: none !important; min-width: 0 !important; }

.bbhg-wf-build { margin-top: 22px; padding: 16px; border-radius: 16px; border: 1px dashed #cbd5e1; background: #f8fafc; }
.bbhg-wf-build h3 { margin: 0 0 10px; font-size: 16px; }
.bbhg-wf-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.bbhg-wf-lbl input, .bbhg-wf-addrow select { padding: 9px 11px; border: 1px solid var(--wf-line); border-radius: 10px; font: inherit; font-size: 14px; background: #fff; color: var(--wf-ink); }
.bbhg-wf-addrow { display: flex; gap: 8px; flex-wrap: wrap; }
.bbhg-wf-addrow select { flex: 1 1 220px; min-width: 0; }
.bbhg-wf-steps { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: wf; }
.bbhg-wf-steps li { counter-increment: wf; display: flex; align-items: center; gap: 6px; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; background: #fff; border: 1px solid var(--wf-line); font-size: 14px; }
.bbhg-wf-steps li::before { content: counter(wf); width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #eef2ff; color: var(--wf); font-weight: 700; font-size: 12px; }
.bbhg-wf-steps li span { flex: 1; }
.bbhg-wf-steps li button { width: 30px; height: 30px; padding: 0 !important; border: 1px solid var(--wf-line) !important; border-radius: 8px !important; background: #fff !important; color: #334155 !important; cursor: pointer; min-width: 0 !important; box-shadow: none !important; }
.bbhg-wf-steps li button:disabled { opacity: .35; cursor: default; }
.bbhg-wf-note { font-size: 12px; color: var(--wf-mute); margin: 8px 0; }
.bbhg-wf-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bbhg-wf-acts .sp { flex: 1; }

/* ---- Step bar (fixed at the bottom of the window) ---- */
.bbhg-wf-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: min(760px, calc(100vw - 24px));
    z-index: 2147483000;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, .96);
    color: #f8fafc;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .35), 0 0 0 1px rgba(255, 255, 255, .06) inset;
    font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: bbhg-wf-in .25s ease-out;
}
.bbhg-wf-bar.is-dock { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
.bbhg-wf-bar * { box-sizing: border-box; }
@keyframes bbhg-wf-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.bbhg-wf-head { display: flex; align-items: center; gap: 10px; }
.bbhg-wf-bar .bbhg-wf-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .1); font-size: 17px; }
.bbhg-wf-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bbhg-wf-ttl b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #a5b4fc; font-weight: 700; }
.bbhg-wf-ttl span { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.bbhg-wf-dots { display: flex; gap: 5px; }
.bbhg-wf-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.bbhg-wf-dots i.done { background: #34d399; }
.bbhg-wf-dots i.on { background: #fff; box-shadow: 0 0 0 3px rgba(165, 180, 252, .45); }
.bbhg-wf-ib { width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0 !important; border: 0 !important; border-radius: 9px !important; background: rgba(255, 255, 255, .08) !important; color: #e2e8f0 !important; cursor: pointer; box-shadow: none !important; min-width: 0 !important; }
.bbhg-wf-ib:hover { background: rgba(255, 255, 255, .16) !important; }
.bbhg-wf-ib svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bbhg-wf-body[hidden] { display: none !important; }
.bbhg-wf-tip { margin: 10px 0 8px; color: #cbd5e1; font-size: 13.5px; }
.bbhg-wf-away { color: #fde68a; }
.bbhg-wf-bar .bbhg-wf-link { color: #a5b4fc !important; }
.bbhg-wf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bbhg-wf-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px !important; border: 1px solid rgba(255, 255, 255, .14) !important; border-radius: 999px !important; background: rgba(255, 255, 255, .06) !important; color: #f1f5f9 !important; font: 500 12.5px/1.3 system-ui, sans-serif !important; cursor: pointer; text-align: left; box-shadow: none !important; min-width: 0 !important; }
.bbhg-wf-chip b { color: #a5b4fc; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.bbhg-wf-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbhg-wf-chip:hover { background: rgba(255, 255, 255, .12) !important; }
.bbhg-wf-chip.add { border-style: dashed !important; color: #cbd5e1 !important; }
.bbhg-wf-none { font-size: 12.5px; color: #94a3b8; align-self: center; }
.bbhg-wf-bar .bbhg-wf-btn.ghost { background: rgba(255, 255, 255, .1) !important; color: #f1f5f9 !important; }
.bbhg-wf-bar .bbhg-wf-btn { background: #6366f1 !important; }
.bbhg-wf-bar .bbhg-wf-btn.ghost:hover { background: rgba(255, 255, 255, .16) !important; }
.bbhg-wf-bar.is-collapsed { padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.bbhg-wf-bar.is-collapsed .bbhg-wf-head { flex: 1; min-width: 0; }
.bbhg-wf-bar.is-collapsed .bbhg-wf-dots { display: none; }
.bbhg-wf-mini { min-height: 32px; padding: 6px 12px !important; }

/* Results you can pick in the current step */
.bbhg-wf-step-on .bbhg-wf-pickable { cursor: pointer; outline: 2px dashed rgba(99, 102, 241, .45); outline-offset: 3px; transition: outline-color .15s; }
.bbhg-wf-step-on .bbhg-wf-pickable:hover { outline-color: #6366f1; outline-style: solid; }
.bbhg-wf-step-on .bbhg-wf-picked { outline: 3px solid #22c55e !important; outline-offset: 3px; }
.bbhg-wf-flash { animation: bbhg-wf-flash 1.4s ease-out; }
@keyframes bbhg-wf-flash { 0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, .55); } 100% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); } }
/* Keep the last results clear of the bar */
.bbhg-modal-overlay:has(.bbhg-wf-bar) .bbhg-wf-step-on { padding-bottom: 190px; }

/* Edit sheet */
.bbhg-wf-edit { position: fixed; inset: 0; z-index: 2147483001; display: grid; place-items: end center; background: rgba(15, 23, 42, .45); padding: 12px; }
.bbhg-wf-edit-in { width: min(620px, 100%); max-height: calc(100vh - 24px); overflow: auto; background: #fff; color: #0f172a; border-radius: 18px; padding: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.bbhg-wf-edit-in h3 { margin: 0 0 12px; font-size: 17px; color: #0f172a; }
.bbhg-wf-edit-in label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-weight: 600; font-size: 13px; color: #0f172a; }
.bbhg-wf-edit-in small { font-weight: 400; color: #64748b; }
.bbhg-wf-edit-in input, .bbhg-wf-edit-in textarea { padding: 9px 11px; border: 1px solid #e2e8f0; border-radius: 10px; font: inherit; font-weight: 400; font-size: 14px; color: #0f172a; background: #fff; resize: vertical; }
.bbhg-wf-toast { position: fixed; left: 50%; bottom: 220px; transform: translateX(-50%) translateY(10px); z-index: 2147483002; padding: 9px 16px; border-radius: 999px; background: #0f172a; color: #fff; font: 600 13px/1.3 system-ui, sans-serif; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.bbhg-wf-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
    .bbhg-wf-bar { width: calc(100vw - 12px); border-radius: 16px; padding: 8px 10px 10px; }
    .bbhg-wf-bar.is-dock { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
    .bbhg-wf-dots, .bbhg-wf-bar .bbhg-wf-ico { display: none; }
    .bbhg-wf-ttl b { font-size: 10.5px; }
    .bbhg-wf-ttl span { font-size: 14px; }
    .bbhg-wf-ib { width: 30px; height: 30px; }
    .bbhg-wf-tip { font-size: 12.5px; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .bbhg-wf-bar .bbhg-wf-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px 8px; padding: 0 10px; }
    .bbhg-wf-bar .bbhg-wf-chips::-webkit-scrollbar { display: none; }
    .bbhg-wf-bar .bbhg-wf-chip { flex: none; max-width: 72vw; }
    .bbhg-wf-bar .bbhg-wf-acts { flex-wrap: nowrap; }
    .bbhg-wf-bar .bbhg-wf-acts .bbhg-wf-btn { flex: 0 0 auto; min-height: 38px; padding: 6px 12px !important; font-size: 13.5px !important; }
    .bbhg-wf-bar .bbhg-wf-acts [data-a="next"] { flex: 1 1 auto; min-width: 0; }
    .bbhg-wf-bar .bbhg-wf-acts .sp { display: none; }
    .bbhg-wf-card { padding: 14px; }
    .bbhg-modal-overlay:has(.bbhg-wf-bar) .bbhg-wf-step-on { padding-bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) {
    .bbhg-wf-bar, .bbhg-wf-flash { animation: none; }
}
