/* ==========================================================================
   ONBOARDING / ACCOUNT-ACTIVATION — FRONTEND PROTOTYPE STYLES
   Scoped styles for: the two-step sign-up page, the dashboard activation
   checklist rail, the "sandbox mode" banner Activate link, and the full-page
   account-activation flow (/activate). Built on Motion design-system tokens
   (var(--color-*)) so views need no inline styles or hardcoded hex.
   Auto-included via Sprockets require_tree.
   ========================================================================== */

/* ---- Shared primitives -------------------------------------------------- */
.op-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-primary, #0029FF); margin: 0 0 8px; }
.op-title { font-size: 22px; line-height: 1.2; font-weight: 700; color: var(--color-mirage, #0D122D); margin: 0; }
.op-subtitle { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--color-mirage-70, #56596C); }
.op-mb { margin-bottom: 18px; }
.op-text-center { text-align: center; }
.op-disabled { pointer-events: none; opacity: .5; }
.op-divider { height: 1px; background-color: var(--color-link-water, #DFEAF2); border: 0; margin: 22px 0; }
.op-note { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--color-mirage-70, #56596C); margin-top: 18px; }
.op-note svg { flex: none; margin-top: 1px; }

.op-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.op-col-span-2 { grid-column: 1 / -1; }
.op-invalid { border-color: var(--color-token-red, #FA3A55) !important; box-shadow: 0 0 0 3px var(--color-secondary-token-red-light, #FFE0EB) !important; }
/* The HTML `hidden` attribute must win over flex/inline-flex component classes (buttons, product rows, menus). */
.activate-page [hidden] { display: none !important; }
.op-error-summary { padding: 12px 14px; border-radius: 8px; background-color: var(--color-secondary-token-red-light, #FFE0EB); color: var(--color-token-red, #FA3A55); font-size: 13px; }
.op-error-summary p { margin: 0; }

.op-consent { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-top: 1px solid var(--color-link-water, #DFEAF2); cursor: pointer; }
.op-consent:first-child { border-top: 0; }
.op-consent input { margin-top: 3px; flex: none; }
.op-consent-text { font-size: 13.5px; line-height: 1.5; color: var(--color-mirage-80, #3D4157); }

.op-review { border: 1px solid var(--color-link-water, #DFEAF2); border-radius: 12px; overflow: hidden; }
.op-review-row { display: flex; justify-content: space-between; gap: 24px; padding: 12px 16px; border-top: 1px solid var(--color-link-water, #DFEAF2); }
.op-review-row:first-child { border-top: 0; }
.op-review-key { font-size: 13.5px; color: var(--color-mirage-70, #56596C); }
.op-review-val { font-size: 13.5px; font-weight: 500; color: var(--color-mirage, #0D122D); text-align: right; }

.op-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.op-step { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.op-step-badge { flex: none; width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background-color: var(--color-mirage-05, #F3F3F5); color: var(--color-mirage-70, #56596C); border: 1px solid var(--color-link-water, #DFEAF2); }
.op-step-label { font-size: 14px; font-weight: 500; color: var(--color-mirage-70, #56596C); }
.op-step.is-current .op-step-badge { background-color: var(--color-primary, #0029FF); color: #FFFFFF; border-color: var(--color-primary, #0029FF); }
.op-step.is-current .op-step-label { color: var(--color-mirage, #0D122D); }
.op-step.is-done .op-step-badge { background-color: var(--color-blue-05, #F2F4FF); color: var(--color-primary, #0029FF); border-color: var(--color-blue-05, #F2F4FF); }

.op-progress-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.op-progress-label { font-size: 13px; font-weight: 600; color: var(--color-mirage, #0D122D); }
.op-progress-count { font-size: 13px; color: var(--color-mirage-70, #56596C); }
.op-progress-track { height: 7px; border-radius: 999px; background-color: var(--color-mirage-05, #F3F3F5); overflow: hidden; }
.op-progress-fill { height: 100%; border-radius: 999px; background-color: var(--color-primary, #0029FF); transition: width .3s ease; }
.op-progress-fill.is-0 { width: 0; } .op-progress-fill.is-25 { width: 25%; } .op-progress-fill.is-50 { width: 50%; } .op-progress-fill.is-75 { width: 75%; } .op-progress-fill.is-100 { width: 100%; }

.op-checklist { display: flex; flex-direction: column; gap: 14px; }
.op-check { display: flex; align-items: flex-start; gap: 12px; }
.op-check-badge { flex: none; width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background-color: var(--color-mirage-05, #F3F3F5); color: var(--color-mirage-70, #56596C); }
.op-check.is-done .op-check-badge { background-color: var(--color-token-green, #00DF81); color: #FFFFFF; }
.op-check.is-current .op-check-badge { background-color: var(--color-primary, #0029FF); color: #FFFFFF; }
.op-check.is-locked { opacity: .55; }
.op-check-body { flex: 1 1 auto; min-width: 0; }
.op-check-title { font-size: 13.5px; font-weight: 600; color: var(--color-mirage, #0D122D); }
.op-check-desc { margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--color-mirage-70, #56596C); }
.op-check-action { margin-top: 10px; }

.op-actions-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* ---- Sign-up page (two-step, Profound-style) ---------------------------- */
.signup-page { display: flex; min-height: 100vh; background-color: var(--color-white, #FFFFFF); }
.signup-left { flex: 1 1 50%; display: flex; justify-content: center; padding: 48px 40px; overflow-y: auto; }
.signup-left-inner { width: 100%; max-width: 400px; margin: auto 0; }
.signup-logo { height: 30px; width: auto; margin-bottom: 40px; }
.signup-title { font-size: 28px; font-weight: 700; letter-spacing: -.01em; color: var(--color-mirage, #0D122D); margin: 0; }
.signup-subtitle { margin: 10px 0 24px; font-size: 15px; line-height: 1.55; color: var(--color-mirage-70, #56596C); }
.signup-progress { display: flex; gap: 6px; margin-bottom: 24px; }
.signup-progress-seg { flex: 1 1 0; height: 4px; border-radius: 999px; background-color: var(--color-mirage-05, #F3F3F5); transition: background-color .2s; }
.signup-progress-seg.is-active { background-color: var(--color-primary, #0029FF); }
.signup-form { display: flex; flex-direction: column; gap: 16px; }
.signup-form .form-field-group + .form-field-group { margin-top: 16px; }
.signup-submit { margin-top: 8px; }
.signup-actions { display: flex; gap: 12px; margin-top: 8px; }
.signup-submit-grow { flex: 1 1 auto; }
.signup-footer { margin-top: 18px; font-size: 14px; color: var(--color-mirage-70, #56596C); }
.signup-demo-card { margin-top: 36px; padding: 18px; border: 1px solid var(--color-link-water, #DFEAF2); border-radius: 12px; background-color: var(--color-app-bg, #F7F9FB); }
.signup-demo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signup-demo-title { font-size: 15px; font-weight: 600; color: var(--color-mirage, #0D122D); }
.signup-demo-sub { margin-top: 2px; font-size: 13px; color: var(--color-mirage-70, #56596C); }
.signup-demo-avatars { display: flex; flex: none; }
.signup-demo-avatars .avatar { margin-left: -8px; border: 2px solid var(--color-white, #FFFFFF); }
.signup-demo-avatars .avatar:first-child { margin-left: 0; }
.signup-demo-avatar { object-fit: cover; padding: 0; }
.signup-demo-btn { margin-top: 14px; width: 100%; box-sizing: border-box; justify-content: center; }
.signup-right { flex: 1 1 50%; position: relative; background-color: var(--color-app-bg, #F7F9FB); background-image: radial-gradient(var(--color-link-water, #DFEAF2) 1.1px, transparent 1.1px); background-size: 22px 22px; display: flex; align-items: center; justify-content: center; padding: 40px 0; overflow: hidden; }
/* Right rail: auto-advancing horizontal testimonial carousel */
@keyframes signup-carousel-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.signup-carousel { width: 100%; animation: signup-carousel-in .7s cubic-bezier(.16, .84, .44, 1) both; }
.signup-carousel-viewport { overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent 0, black 13%, black 87%, transparent 100%); mask-image: linear-gradient(to right, transparent 0, black 13%, black 87%, transparent 100%); }
.signup-carousel-track { display: flex; position: relative; transition: transform .6s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.signup-carousel-track.no-anim { transition: none; }
.signup-carousel-slide { flex: 0 0 clamp(280px, 62%, 460px); min-width: 0; box-sizing: border-box; margin: 0; padding: 24px; transition: opacity .5s ease; }
.signup-testimonial { position: relative; display: flex; flex-direction: column; min-height: 360px; background-color: var(--color-white, #FFFFFF); border: 1px solid var(--color-link-water, #DFEAF2); border-radius: 16px; padding: 28px; box-shadow: 0 8px 22px rgba(13, 18, 45, .08); }
.signup-quote-mark { display: block; height: 26px; font-size: 52px; font-weight: 700; line-height: 1; color: var(--color-primary, #0029FF); opacity: .18; }
.signup-quote { margin: 12px 0 0; font-size: 16px; line-height: 1.55; font-weight: 500; color: var(--color-mirage, #0D122D); }
.signup-author { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--color-mirage-05, #F3F3F5); }
.signup-author-name { font-size: 14px; font-weight: 600; color: var(--color-mirage, #0D122D); }
.signup-author-role { margin-top: 2px; font-size: 13px; color: var(--color-mirage-70, #56596C); }
.signup-carousel-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.signup-carousel-dots { display: flex; align-items: center; gap: 8px; }
.signup-carousel-dot { position: relative; overflow: hidden; width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background-color: var(--color-mirage-20, #CFD0D5); cursor: pointer; transition: width .3s ease, background-color .3s ease; }
.signup-carousel-dot.is-active { width: 30px; background-color: var(--color-primary-light, #E6EAFF); }
.signup-carousel-dot-fill { position: absolute; inset: 0; width: 0; border-radius: 999px; background-color: var(--color-primary, #0029FF); }
.signup-carousel-dot.is-active .signup-carousel-dot-fill { animation: signup-dot-fill var(--sc-interval, 5500ms) linear forwards; }
.signup-carousel.is-paused .signup-carousel-dot.is-active .signup-carousel-dot-fill { animation-play-state: paused; }
@keyframes signup-dot-fill { from { width: 0; } to { width: 100%; } }
.signup-carousel-arrow { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--color-link-water, #DFEAF2); border-radius: 999px; background-color: var(--color-white, #FFFFFF); color: var(--color-mirage-70, #56596C); cursor: pointer; transition: border-color .2s ease, color .2s ease, background-color .2s ease; }
.signup-carousel-arrow:hover { border-color: var(--color-primary, #0029FF); color: var(--color-primary, #0029FF); background-color: var(--color-primary-light, #E6EAFF); }
@media (prefers-reduced-motion: reduce) { .signup-carousel { animation: none; } .signup-carousel-track { transition: none; } .signup-carousel-slide { transition: none; } .signup-carousel-dot.is-active .signup-carousel-dot-fill { animation: none; width: 100%; } }
@media (max-width: 900px) { .signup-right { display: none; } .signup-left { flex-basis: 100%; } }

/* ---- Dashboard activation rail ------------------------------------------ */
.dashboard-layout { display: flex; align-items: flex-start; gap: 24px; }
.dashboard-main { flex: 1 1 auto; min-width: 0; }
.dashboard-rail { flex: 0 0 320px; width: 320px; }
/* Bold "next step" activation panel (sandbox) — dark panel; the CURRENT step's button glows */
.activation-card { position: sticky; top: 20px; margin-top: 24px; border-radius: 16px; padding: 22px; color: #FFFFFF; background: linear-gradient(158deg, #141B40 0%, var(--color-mirage, #0D122D) 52%, #0C1A49 100%); box-shadow: 0 16px 38px rgba(13, 18, 45, .30); }
.activation-card-title { font-size: 17px; font-weight: 700; color: #FFFFFF; margin: 2px 0 16px; }
.activation-card .op-eyebrow { color: #93B6FF; }
.activation-card .op-progress-label { color: #FFFFFF; }
.activation-card .op-progress-count { color: rgba(255, 255, 255, .72); }
.activation-card .op-progress-track { background-color: rgba(255, 255, 255, .16); }
.activation-card .op-progress-fill { background-color: #FFFFFF; }
.activation-card .op-check-badge { background-color: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .88); }
.activation-card .op-check.is-current .op-check-badge { background-color: #FFFFFF; color: var(--color-primary, #0029FF); }
.activation-card .op-check.is-done .op-check-badge { background-color: var(--color-token-green, #00DF81); color: #0B1430; }
.activation-card .op-check-title { margin: 0; line-height: 24px; color: #FFFFFF; }
.activation-card .op-check-desc { color: rgba(255, 255, 255, .68); }
.activation-card .btn-primary { background-color: #FFFFFF; color: var(--color-primary, #0029FF); border-color: #FFFFFF; }
.activation-card .btn-primary:hover { background-color: rgba(255, 255, 255, .92); color: var(--color-primary, #0029FF); }
/* Only the current step expands; its CTA spans the card width and glows gently. */
.activation-card .op-check-action { margin-top: 12px; margin-left: -36px; width: calc(100% + 36px); }
.activation-card .op-check.is-current .btn-primary { animation: activation-cta-glow 2s ease-in-out infinite; }
@keyframes activation-cta-glow { 0%, 100% { box-shadow: 0 0 4px 0 rgba(0, 193, 255, .40); } 50% { box-shadow: 0 0 14px 2px rgba(0, 193, 255, .72); } }
.activation-card .btn-secondary { background-color: transparent; color: #FFFFFF; border: 1px solid rgba(255, 255, 255, .38); }
.activation-card .btn-secondary:hover { background-color: rgba(255, 255, 255, .12); color: #FFFFFF; }
@media (max-width: 1024px) { .dashboard-layout { flex-direction: column; } .dashboard-rail { flex-basis: auto; width: 100%; } .activation-card { position: static; } }
@media (prefers-reduced-motion: reduce) { .activation-card .op-check.is-current .btn-primary { animation: none; box-shadow: 0 0 11px 1px rgba(0, 193, 255, .55); } }

/* ---- "Sandbox mode" banner (+ Activate link) ---------------------------- */
.alert-banner.sandbox-banner { justify-content: space-between; align-items: center; gap: 14px; border-radius: 0; margin: 0; }
.sandbox-banner .sandbox-text { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 auto; }
.sandbox-activate { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 8px; background-color: var(--color-primary, #0029FF); color: #FFFFFF; font-size: 13px; font-weight: 600; border: 0; cursor: pointer; white-space: nowrap; text-decoration: none; }
.sandbox-activate:hover { background-color: var(--color-blue-90, #1A3EFF); color: #FFFFFF; }
.sandbox-activate svg { width: 15px; height: 15px; }

/* ---- Full-page account-activation flow (/activate) ---------------------- */
.activate-page { min-height: 100vh; background-color: var(--color-app-bg, #F7F9FB); }
.activate-topbar { background-color: var(--color-white, #FFFFFF); border-bottom: 1px solid var(--color-link-water, #DFEAF2); position: sticky; top: 0; z-index: 10; }
.activate-topbar-inner { max-width: 760px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 16px; }
.activate-logo { height: 26px; width: auto; display: block; }
.activate-saved { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; font-weight: 500; color: var(--color-token-green, #00DF81); opacity: 0; transition: opacity .2s; }
.activate-saved.is-visible { opacity: 1; }
.activate-exit { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--color-mirage-70, #56596C); }
.activate-exit:hover { color: var(--color-primary, #0029FF); }
.activate-container { max-width: 680px; margin: 0 auto; padding: 36px 24px 64px; }
.activate-foot { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--color-link-water, #DFEAF2); }
.activate-foot-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-mirage-70, #56596C); }

/* Step indicator — vertical badge+label columns so 5 fit any width */
.kyc-steps { gap: 6px; }
.kyc-steps .op-step { flex: 1 1 0; flex-direction: column; gap: 6px; text-align: center; }
.kyc-steps .op-step-label { font-size: 11px; }
@media (max-width: 560px) { .kyc-steps .op-step-label { display: none; } }

.kyc-section-title { font-size: 15px; font-weight: 600; color: var(--color-mirage, #0D122D); margin: 0 0 3px; }
.kyc-section-sub { font-size: 13px; line-height: 1.5; color: var(--color-mirage-70, #56596C); margin: 0 0 16px; }

/* Products */
.kyc-product-list { display: flex; flex-direction: column; gap: 10px; }
.kyc-product { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--color-link-water, #DFEAF2); border-radius: 10px; cursor: pointer; }
.kyc-product:has(input:checked) { border-color: var(--color-primary, #0029FF); background-color: var(--color-blue-05, #F2F4FF); }
.kyc-product input { flex: none; }
.kyc-product-main { flex: 1 1 auto; min-width: 0; }
.kyc-product-name { font-size: 14px; font-weight: 600; color: var(--color-mirage, #0D122D); }
.kyc-product-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.kyc-product-vendor { font-size: 12px; color: var(--color-mirage-70, #56596C); }
.kyc-cascade-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background-color: var(--color-blue-05, #F2F4FF); color: var(--color-primary, #0029FF); font-size: 11px; font-weight: 600; }
.kyc-product-price { flex: none; font-size: 14px; font-weight: 600; color: var(--color-mirage, #0D122D); white-space: nowrap; }
.kyc-product-price span { font-weight: 400; font-size: 12px; color: var(--color-mirage-70, #56596C); }
.kyc-enterprise { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--color-glaucous, #718EBF); border-radius: 10px; background-color: var(--color-app-bg, #F7F9FB); }
.kyc-enterprise-text { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--color-mirage-80, #3D4157); }
.kyc-enterprise .btn-secondary { flex: none; white-space: nowrap; }
.kyc-total-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--color-link-water, #DFEAF2); }
.kyc-total-label { font-size: 14px; color: var(--color-mirage-70, #56596C); }
.kyc-total { font-size: 20px; font-weight: 700; color: var(--color-mirage, #0D122D); }
.kyc-total small { font-size: 12px; font-weight: 400; color: var(--color-mirage-70, #56596C); }
/* Added catalog products + "rolodex" picker */
.kyc-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.kyc-product-added { cursor: default; }
.kyc-product-remove { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--color-link-water, #DFEAF2); border-radius: 8px; background-color: var(--color-white, #FFFFFF); color: var(--color-mirage-70, #56596C); cursor: pointer; }
.kyc-product-remove:hover { border-color: var(--color-token-red, #FA3A55); color: var(--color-token-red, #FA3A55); }
.kyc-rolodex-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 11px 14px; border: 1px dashed var(--color-glaucous, #718EBF); border-radius: 10px; background-color: var(--color-white, #FFFFFF); color: var(--color-primary, #0029FF); font-size: 13px; font-weight: 600; cursor: pointer; }
.kyc-rolodex-toggle:hover { background-color: var(--color-blue-05, #F2F4FF); }
/* Add-products drawer (right sidebar) */
.kyc-drawer-backdrop { position: fixed; inset: 0; z-index: 60; display: none; background-color: rgba(13, 18, 45, .35); }
.kyc-drawer { position: fixed; top: 0; right: 0; z-index: 61; display: none; flex-direction: column; width: 400px; max-width: 92vw; height: 100vh; background-color: var(--color-white, #FFFFFF); box-shadow: -16px 0 44px rgba(13, 18, 45, .20); }
.activate-page.drawer-open .kyc-drawer-backdrop { display: block; animation: kyc-fade-in .2s ease; }
.activate-page.drawer-open .kyc-drawer { display: flex; animation: kyc-drawer-in .28s cubic-bezier(.4, 0, .2, 1); }
@keyframes kyc-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes kyc-drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.kyc-drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--color-link-water, #DFEAF2); }
.kyc-drawer-title { font-size: 16px; font-weight: 700; color: var(--color-mirage, #0D122D); }
.kyc-drawer-close { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background-color: transparent; color: var(--color-mirage-70, #56596C); cursor: pointer; }
.kyc-drawer-close:hover { background-color: var(--color-mirage-05, #F3F3F5); }
.kyc-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 8px; }
.kyc-drawer-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--color-link-water, #DFEAF2); border-radius: 10px; cursor: pointer; }
.kyc-drawer-item:has(input:checked) { border-color: var(--color-primary, #0029FF); background-color: var(--color-blue-05, #F2F4FF); }
.kyc-drawer-item input { flex: none; }
.kyc-drawer-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kyc-drawer-foot { flex: none; padding: 16px 22px; border-top: 1px solid var(--color-link-water, #DFEAF2); }
.kyc-drawer-add { width: 100%; box-sizing: border-box; justify-content: center; }
.kyc-drawer-add:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .activate-page.drawer-open .kyc-drawer, .activate-page.drawer-open .kyc-drawer-backdrop { animation: none; } }

/* Success */
.kyc-done { text-align: center; padding: 48px 16px; }
.kyc-done-icon { width: 72px; height: 72px; border-radius: 999px; background-color: var(--color-token-green, #00DF81); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.kyc-done-icon svg { width: 38px; height: 38px; }
/* ==========================================================================
   TenantIQ Design System
   --------------------------------------------------------------------------
   Self-contained brand system for the TenantIQ (PM tenant-screening) surface
   served at pm.cascades.crscreditapi.com. Warm cream-and-ink palette with a
   single orange accent, per the TenantIQ brand brief.

   This file is INDEPENDENT of the Motion design system (application.css):
   it defines its own --tiq-* tokens and its own `tiq-` component classes and
   references NOTHING from Motion. PM pages load application.css ONLY for the
   shared, palette-agnostic structural utilities (flex / grid / spacing /
   sizing); every brand-bearing class on a TenantIQ page is a `tiq-` class
   defined here.

   Activate the page base by putting `class="tiq"` on <body>. The component
   classes are prefixed (`tiq-`) and stand alone — they do not require a
   `.tiq` ancestor to render.

   Companion docs: documentation/TENANTIQ_DESIGN_SYSTEM.md
   Tokens cheatsheet: .claude/skills/tenantiq-design-system/tokens-cheatsheet.md
   ========================================================================== */

:root {
  /* --- Brand surfaces & ink (from the brand brief) --- */
  --tiq-cream:        #F1ECE3; /* page background — warm paper, never stark white */
  --tiq-cream-deep:   #E6E0D2; /* inset cards, fills, alternating rows */
  --tiq-card:         #FBF8F2; /* raised card surface — a touch lighter than cream */
  --tiq-hair:         #D4CDC0; /* hairline dividers + default borders (warm tan) */
  --tiq-ink:          #1A1814; /* headings, emphasis — warm near-black */
  --tiq-ink-body:     #2D2A26; /* body text, tuned warm against cream */
  --tiq-ink-soft:     #5C574E; /* captions, labels, secondary text */
  --tiq-muted:        #8A8377; /* placeholders, helper text */
  --tiq-disabled:     #B5AE9F; /* disabled text */

  /* --- The accent. The ONLY color other than ink. Used sparingly:
         wordmark, links, active states, focus, numerals, highlights. --- */
  --tiq-orange:        #FE8742;
  --tiq-orange-strong: #E96F2B; /* hover / pressed */
  --tiq-orange-tint:   #F6E0CC; /* light fills, avatar grounds, tertiary buttons */

  /* --- Dark "voice" surface --- */
  --tiq-dark-bg:  #0A0A0A; /* warm near-black, not pure black */
  --tiq-dark-ink: #F5F1E8; /* cream-tinted off-white type on dark — never #FFF */

  /* --- Status: derived warm earth-tones (text / pale-bg / accent-dot).
         The brief defines no status colors and reserves orange for the brand,
         so these are drawn from the brief's earth-tone family. --- */
  --tiq-success:    #3F6B4E; --tiq-success-bg: #DCE6D2; --tiq-success-dot: #6E9469; /* sage  — Pass */
  --tiq-warning:    #8A6420; --tiq-warning-bg: #F1E4C6; --tiq-warning-dot: #C8922A; /* ochre — Review */
  --tiq-error:      #8C3A28; --tiq-error-bg:   #F0DBD2; --tiq-error-dot:   #C0492F; /* sienna— Decline */
  --tiq-info:       #3D5666; --tiq-info-bg:    #DBE3E8; --tiq-info-dot:    #5B7689; /* slate — Running */
  --tiq-neutral:    #5C574E; --tiq-neutral-bg: #E6E0D2; --tiq-neutral-dot: #A89F8E; /* taupe — Revoked */
  --tiq-demo:       #5E4B6B; --tiq-demo-bg:    #E7DEEA; --tiq-demo-dot:    #8C74A0; /* muted plum — demo marker */

  /* --- Effects --- */
  --tiq-focus:    0 0 0 3px rgba(254, 135, 66, 0.30); /* orange focus ring */
  --tiq-shadow:   0 4px 16px rgba(26, 24, 20, 0.10);
  --tiq-shadow-lg:0 8px 28px rgba(26, 24, 20, 0.16);

  /* --- Radii --- */
  --tiq-radius-sm: 6px;   /* inputs */
  --tiq-radius:    9px;   /* buttons, cards */
  --tiq-radius-lg: 12px;  /* page containers */

  /* RGB channels for the card surface — for rgba() fades/overlays that need
     a transparent stop (CSS can't take a transparent stop from a hex var). */
  --tiq-card-rgb: 251, 248, 242;
}

/* ==========================================================================
   Page base — applied via <body class="tiq">
   ========================================================================== */

.tiq {
  background-color: var(--tiq-cream);
  color: var(--tiq-ink-body);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600; /* brand: cream-paper rendering needs 600, not 400 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tiq h1, .tiq h2, .tiq h3, .tiq h4, .tiq h5 {
  color: var(--tiq-ink);
  font-weight: 700;
}

/* Unclassed links in body content pick up the accent. Components that style
   their own links (topnav, .tiq-link, buttons) are unaffected. */
.tiq a:not([class]) { color: var(--tiq-orange); text-decoration: none; }
.tiq a:not([class]):hover { color: var(--tiq-orange-strong); text-decoration: underline; }

/* ==========================================================================
   Typography — wordmark & "voice" headline
   ========================================================================== */

/* Wordmark IS the mark. "Tenant" orange + "IQ" ink, tight IQ cluster.
   Usage: <span class="tiq-wordmark">Tenant<span class="tiq-wordmark-iq">IQ</span></span> */
.tiq-wordmark {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--tiq-orange);
  white-space: nowrap;
}
.tiq-wordmark-iq { color: var(--tiq-ink); letter-spacing: -0.04em; }
/* On dark surfaces, swap IQ to white — orange "Tenant" holds against either ground. */
.tiq-wordmark--on-dark .tiq-wordmark-iq { color: #FFFFFF; }

/* Playfair "voice" headline — reserved for hero / closing / pull-quote
   moments ONLY. Never on UI chrome, feature subheads, or body copy. */
.tiq-voice {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: var(--tiq-ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Color utilities (warm replacements for Motion's text-/bg- token classes)
   ========================================================================== */

.tiq-text-ink     { color: var(--tiq-ink); }
.tiq-text-body    { color: var(--tiq-ink-body); }
.tiq-text-soft    { color: var(--tiq-ink-soft); }
.tiq-text-muted   { color: var(--tiq-muted); }
.tiq-text-disabled{ color: var(--tiq-disabled); }
.tiq-text-accent  { color: var(--tiq-orange); }
.tiq-text-success { color: var(--tiq-success); }
.tiq-text-warning { color: var(--tiq-warning); }
.tiq-text-error   { color: var(--tiq-error); }
.tiq-text-on-dark { color: var(--tiq-dark-ink); }

.tiq-bg-cream      { background-color: var(--tiq-cream); }
.tiq-bg-card       { background-color: var(--tiq-card); }
.tiq-bg-cream-deep { background-color: var(--tiq-cream-deep); }
.tiq-bg-accent     { background-color: var(--tiq-orange); }
.tiq-bg-orange-tint{ background-color: var(--tiq-orange-tint); }
.tiq-bg-dark       { background-color: var(--tiq-dark-bg); }

.tiq-border-hair   { border-color: var(--tiq-hair); }

/* ==========================================================================
   Buttons
   Primary is INK (premium, high-contrast) so the orange accent stays special.
   Use .tiq-btn-accent for the rare loud orange CTA.
   ========================================================================== */

.tiq-btn,
.tiq-btn-secondary,
.tiq-btn-tertiary,
.tiq-btn-accent,
.tiq-btn-danger,
.tiq-btn-danger-outline {
  box-sizing: border-box; /* so .w-full buttons stay inside their container */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--tiq-radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.tiq-btn:focus-visible,
.tiq-btn-secondary:focus-visible,
.tiq-btn-tertiary:focus-visible,
.tiq-btn-accent:focus-visible,
.tiq-btn-danger:focus-visible,
.tiq-btn-danger-outline:focus-visible {
  outline: none;
  box-shadow: var(--tiq-focus);
}

/* Primary — ink fill, cream text */
.tiq-btn { background-color: var(--tiq-ink); border-color: var(--tiq-ink); color: var(--tiq-dark-ink); }
.tiq-btn:hover { background-color: var(--tiq-ink-body); border-color: var(--tiq-ink-body); }

/* Secondary — card fill, hair border, ink text */
.tiq-btn-secondary { background-color: var(--tiq-card); border-color: var(--tiq-hair); color: var(--tiq-ink); }
.tiq-btn-secondary:hover { background-color: var(--tiq-cream-deep); border-color: var(--tiq-ink-soft); }

/* Tertiary — orange-tint fill, orange text */
.tiq-btn-tertiary { background-color: var(--tiq-orange-tint); border-color: var(--tiq-orange-tint); color: var(--tiq-orange-strong); }
.tiq-btn-tertiary:hover { background-color: #F0D2B6; border-color: #F0D2B6; }

/* Accent — the loud orange CTA. Ink text for contrast (white fails on orange). */
.tiq-btn-accent { background-color: var(--tiq-orange); border-color: var(--tiq-orange); color: var(--tiq-ink); }
.tiq-btn-accent:hover { background-color: var(--tiq-orange-strong); border-color: var(--tiq-orange-strong); color: var(--tiq-dark-ink); }

/* Danger — sienna fill, cream text */
.tiq-btn-danger { background-color: var(--tiq-error); border-color: var(--tiq-error); color: var(--tiq-dark-ink); }
.tiq-btn-danger:hover { background-color: #74301F; border-color: #74301F; }

/* Danger outline */
.tiq-btn-danger-outline { background-color: var(--tiq-card); border-color: var(--tiq-error); color: var(--tiq-error); }
.tiq-btn-danger-outline:hover { background-color: var(--tiq-error-bg); }

/* Size modifier */
.tiq-btn-sm { padding: 5px 10px; font-size: 12px; line-height: 16px; gap: 4px; border-radius: var(--tiq-radius-sm); }

.tiq-btn[disabled], .tiq-btn-secondary[disabled], .tiq-btn-accent[disabled],
.tiq-btn:disabled, .tiq-btn-secondary:disabled, .tiq-btn-accent:disabled {
  opacity: 0.5; cursor: not-allowed;
}

/* ==========================================================================
   Form fields
   ========================================================================== */

.tiq-field { display: flex; flex-direction: column; gap: 6px; }
.tiq-field-label { font-size: 14px; font-weight: 600; color: var(--tiq-ink-soft); transition: color 0.2s ease; }
.tiq-field:focus-within .tiq-field-label { color: var(--tiq-orange-strong); }
.tiq-field-required { color: var(--tiq-error); margin-left: 2px; }

/* Form controls are scoped under .tiq so they out-rank application.css's
   global `input[type="…"], textarea { … }` base styles (specificity 0,1,1),
   which otherwise leak onto TenantIQ pages and force inputs back to white.
   Controls only ever render on a .tiq page, so this scoping is correct. */
.tiq .tiq-field-input,
.tiq .tiq-field-select,
.tiq .tiq-field-textarea {
  box-sizing: border-box; /* width:100% + padding must not overflow the card */
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--tiq-ink-body);
  background-color: var(--tiq-card);
  border: 1px solid var(--tiq-hair);
  border-radius: var(--tiq-radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tiq .tiq-field-input::placeholder,
.tiq .tiq-field-textarea::placeholder { color: var(--tiq-muted); font-weight: 500; }
.tiq .tiq-field-input:focus,
.tiq .tiq-field-select:focus,
.tiq .tiq-field-textarea:focus {
  outline: none;
  border-color: var(--tiq-orange);
  box-shadow: var(--tiq-focus);
}
.tiq .tiq-field-select { cursor: pointer; }
.tiq .tiq-field-textarea { resize: vertical; min-height: 84px; }
.tiq .tiq-field-input-error { border-color: var(--tiq-error); }
.tiq .tiq-field-input-error:focus { box-shadow: 0 0 0 3px rgba(140, 58, 40, 0.18); }

.tiq-field-checkbox,
.tiq-field-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--tiq-ink-body);
}
.tiq .tiq-field-checkbox input[type="checkbox"],
.tiq .tiq-field-radio input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--tiq-orange);
  cursor: pointer;
}
.tiq-field-helper { font-size: 12px; font-weight: 500; color: var(--tiq-muted); }
.tiq-field-error  { font-size: 12px; font-weight: 600; color: var(--tiq-error); }

/* ==========================================================================
   Status pills
   ========================================================================== */

.tiq-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.tiq-pill-sm { padding: 3px 10px; font-size: 12px; }
.tiq-pill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.tiq-pill-success { background-color: var(--tiq-success-bg); color: var(--tiq-success); }
.tiq-pill-success .tiq-pill-dot { background-color: var(--tiq-success-dot); }
.tiq-pill-warning { background-color: var(--tiq-warning-bg); color: var(--tiq-warning); }
.tiq-pill-warning .tiq-pill-dot { background-color: var(--tiq-warning-dot); }
.tiq-pill-error   { background-color: var(--tiq-error-bg); color: var(--tiq-error); }
.tiq-pill-error .tiq-pill-dot { background-color: var(--tiq-error-dot); }
.tiq-pill-info    { background-color: var(--tiq-info-bg); color: var(--tiq-info); }
.tiq-pill-info .tiq-pill-dot { background-color: var(--tiq-info-dot); }
.tiq-pill-neutral { background-color: var(--tiq-neutral-bg); color: var(--tiq-neutral); }
.tiq-pill-neutral .tiq-pill-dot { background-color: var(--tiq-neutral-dot); }
.tiq-pill-demo    { background-color: var(--tiq-demo-bg); color: var(--tiq-demo); }
.tiq-pill-demo .tiq-pill-dot { background-color: var(--tiq-demo-dot); }

/* ==========================================================================
   Alerts
   ========================================================================== */

.tiq-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--tiq-radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.tiq-alert-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.tiq-alert-title { font-weight: 700; margin-bottom: 2px; }
.tiq-alert-info    { background-color: var(--tiq-info-bg); border-color: var(--tiq-info-dot); color: var(--tiq-info); }
.tiq-alert-success { background-color: var(--tiq-success-bg); border-color: var(--tiq-success-dot); color: var(--tiq-success); }
.tiq-alert-warning { background-color: var(--tiq-warning-bg); border-color: var(--tiq-warning-dot); color: var(--tiq-warning); }
.tiq-alert-error   { background-color: var(--tiq-error-bg); border-color: var(--tiq-error-dot); color: var(--tiq-error); }

/* ==========================================================================
   Cards
   ========================================================================== */

.tiq-card {
  box-sizing: border-box;
  background-color: var(--tiq-card);
  border: 1px solid var(--tiq-hair);
  border-radius: var(--tiq-radius);
  padding: 24px;
}
.tiq-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tiq-hair);
}
.tiq-card-title { font-size: 18px; font-weight: 700; color: var(--tiq-ink); }

/* --------------------------------------------------------------------------
   Stat cards — compact metric tiles for a dashboard summary row. Drop any
   number of .tiq-stat-card into a .tiq-stat-row; they share the row width and
   wrap on narrow viewports. Add .is-accent to a value for the one orange
   highlight (numerals are an on-brand accent use; keep it to a single tile).
   -------------------------------------------------------------------------- */
.tiq-stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.tiq-stat-card {
  box-sizing: border-box;
  flex: 1 1 0;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--tiq-card);
  border: 1px solid var(--tiq-hair);
  border-radius: var(--tiq-radius);
  padding: 16px 18px;
}
.tiq-stat-card-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--tiq-ink-soft);
}
.tiq-stat-card-value { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--tiq-ink); }
.tiq-stat-card-value.is-accent { color: var(--tiq-orange); }
.tiq-stat-card-sub { font-size: 12px; color: var(--tiq-muted); }

/* ==========================================================================
   Outcome banners (Pass / Review / Decline / Running / Neutral)
   ========================================================================== */

.tiq-outcome {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--tiq-radius);
  border: 1px solid transparent;
}
.tiq-outcome-icon { flex-shrink: 0; width: 22px; height: 22px; }
.tiq-outcome-title { font-weight: 700; font-size: 15px; }
.tiq-outcome-blurb { font-size: 13px; font-weight: 500; margin-top: 2px; opacity: 0.9; }
.tiq-outcome-pass    { background-color: var(--tiq-success-bg); border-color: var(--tiq-success-dot); color: var(--tiq-success); }
.tiq-outcome-review  { background-color: var(--tiq-warning-bg); border-color: var(--tiq-warning-dot); color: var(--tiq-warning); }
.tiq-outcome-fail    { background-color: var(--tiq-error-bg); border-color: var(--tiq-error-dot); color: var(--tiq-error); }
.tiq-outcome-running { background-color: var(--tiq-info-bg); border-color: var(--tiq-info-dot); color: var(--tiq-info); }
.tiq-outcome-neutral { background-color: var(--tiq-cream-deep); border-color: var(--tiq-hair); color: var(--tiq-ink-soft); }

/* ==========================================================================
   Links
   ========================================================================== */

.tiq-link        { color: var(--tiq-orange); text-decoration: none; transition: color 0.2s ease; }
.tiq-link:hover  { color: var(--tiq-orange-strong); text-decoration: underline; }
.tiq-link-muted       { color: var(--tiq-ink-soft); text-decoration: none; transition: color 0.2s ease; }
.tiq-link-muted:hover { color: var(--tiq-ink); text-decoration: underline; }
.tiq-link-danger       { color: var(--tiq-error); text-decoration: none; transition: color 0.2s ease; }
.tiq-link-danger:hover { color: #74301F; text-decoration: underline; }

/* ==========================================================================
   Avatars
   ========================================================================== */

.tiq-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background-color: var(--tiq-orange-tint);
  color: var(--tiq-orange-strong);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.tiq-avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.tiq-avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.tiq-avatar-wrapper { position: relative; display: inline-block; }
.tiq-avatar-status { position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--tiq-card); }
.tiq-avatar-status-online  { background-color: var(--tiq-success-dot); }
.tiq-avatar-status-offline { background-color: var(--tiq-neutral-dot); }

/* ==========================================================================
   Dividers
   ========================================================================== */

.tiq-divider { border: none; border-top: 1px solid var(--tiq-hair); margin: 16px 0; }
.tiq-divider-sm { margin: 8px 0; }
.tiq-divider-lg { margin: 24px 0; }
.tiq-divider-vertical { width: 1px; align-self: stretch; background-color: var(--tiq-hair); }

/* ==========================================================================
   Top navigation
   ========================================================================== */

.tiq-topnav {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 24px;
  background-color: var(--tiq-cream);
  border-bottom: 1px solid var(--tiq-hair);
  position: relative;
  z-index: 60;
}
.tiq-topnav-left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.tiq-topnav-logo-link { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.tiq-topnav-nav { display: flex; align-items: stretch; gap: 32px; height: 100%; flex: 1; padding-left: 40px; }
.tiq-topnav-item {
  display: flex; align-items: center; height: 100%;
  position: relative;
  font-size: 14px; font-weight: 600;
  color: var(--tiq-ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.tiq-topnav-item:hover, .tiq-topnav-item.active { color: var(--tiq-ink); }
.tiq-topnav-item.active::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background-color: var(--tiq-orange); border-radius: 3px 3px 0 0;
}
.tiq-topnav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tiq-topnav-user { position: relative; }
.tiq-topnav-user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--tiq-ink);
}
.tiq-topnav-user-btn:hover { opacity: 0.8; }
.tiq-topnav-user-email { white-space: nowrap; }
.tiq-topnav-chevron { width: 20px; height: 20px; color: var(--tiq-ink-soft); }
.tiq-topnav-dropdown {
  position: absolute; top: 100%; right: 0; min-width: 160px;
  background-color: var(--tiq-card);
  border: 1px solid var(--tiq-hair);
  border-radius: 10px;
  box-shadow: var(--tiq-shadow);
  padding: 6px; z-index: 100;
}
.tiq-topnav-dropdown.hidden { display: none; }
.tiq-topnav-dropdown-item {
  display: block; width: 100%; padding: 9px 12px;
  background: none; border: none; text-align: left;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--tiq-ink-soft); cursor: pointer; border-radius: 6px;
  text-decoration: none; transition: all 0.15s ease;
}
.tiq-topnav-dropdown-item:hover { background-color: var(--tiq-cream-deep); color: var(--tiq-ink); }

/* ==========================================================================
   Toasts
   ========================================================================== */

.tiq-toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.tiq-toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 10px;
  box-shadow: var(--tiq-shadow-lg);
  font-size: 14px; font-weight: 600;
  max-width: 380px; pointer-events: auto;
  animation: tiq-toast-enter 0.3s ease-out;
}
/* The toast Stimulus controller adds `toast-exit` on dismiss. */
.tiq-toast.toast-exit { animation: tiq-toast-exit 0.3s ease-in forwards; }
@keyframes tiq-toast-enter { from { opacity: 0; transform: translateX(110%); } to { opacity: 1; transform: none; } }
@keyframes tiq-toast-exit  { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(110%); } }
.tiq-toast-icon { flex-shrink: 0; width: 20px; height: 20px; }
.tiq-toast-message { flex: 1; line-height: 1.4; }
.tiq-toast-dismiss {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  padding: 6px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: rgba(245, 241, 232, 0.75);
}
.tiq-toast-dismiss:hover { color: var(--tiq-dark-ink); background-color: rgba(245, 241, 232, 0.12); }
.tiq-toast-success { background-color: var(--tiq-success); color: var(--tiq-dark-ink); }
.tiq-toast-error   { background-color: var(--tiq-error); color: var(--tiq-dark-ink); }

/* ==========================================================================
   Empty state
   ========================================================================== */

.tiq-empty { text-align: center; padding: 48px 24px; }
.tiq-empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--tiq-hair); }

/* ==========================================================================
   Wizard progress bar (applicant intake)
   ========================================================================== */

.tiq-progress { display: flex; align-items: stretch; gap: 8px; margin-bottom: 16px; }
.tiq-progress-step {
  flex: 1 1 0;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  background-color: var(--tiq-cream-deep);
  color: var(--tiq-ink-soft);
  font-size: 14px; font-weight: 600;
}
.tiq-progress-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background-color: var(--tiq-card); color: var(--tiq-ink-soft);
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
/* Current step — orange ground, ink text (white fails contrast on orange) */
.tiq-progress-step.is-current { background-color: var(--tiq-orange); color: var(--tiq-ink); }
.tiq-progress-step.is-current .tiq-progress-badge { background-color: var(--tiq-ink); color: var(--tiq-orange); }
/* Completed step — sage */
.tiq-progress-step.is-done { background-color: var(--tiq-success-bg); color: var(--tiq-success); }
.tiq-progress-step.is-done .tiq-progress-badge { background-color: var(--tiq-success-dot); color: #FFFFFF; }

/* ==========================================================================
   Dashboard filter pills
   ========================================================================== */

.tiq-filter-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  background-color: var(--tiq-cream-deep); color: var(--tiq-ink-soft);
  transition: all 0.15s ease;
}
.tiq-filter-pill:hover { background-color: var(--tiq-hair); }
.tiq-filter-pill-badge {
  min-width: 20px; height: 20px; padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background-color: var(--tiq-card); color: var(--tiq-ink-soft);
}
/* Inactive status tints — match the row pill's color family. `neutral` is the
   base look, named explicitly so the "All" tab's modifier isn't a no-op. */
.tiq-filter-pill-neutral { background-color: var(--tiq-cream-deep); color: var(--tiq-ink-soft); }
.tiq-filter-pill-success { background-color: var(--tiq-success-bg); color: var(--tiq-success); }
.tiq-filter-pill-success .tiq-filter-pill-badge { color: var(--tiq-success); }
.tiq-filter-pill-warning { background-color: var(--tiq-warning-bg); color: var(--tiq-warning); }
.tiq-filter-pill-warning .tiq-filter-pill-badge { color: var(--tiq-warning); }
.tiq-filter-pill-error   { background-color: var(--tiq-error-bg); color: var(--tiq-error); }
.tiq-filter-pill-error .tiq-filter-pill-badge { color: var(--tiq-error); }
.tiq-filter-pill-info    { background-color: var(--tiq-info-bg); color: var(--tiq-info); }
.tiq-filter-pill-info .tiq-filter-pill-badge { color: var(--tiq-info); }
/* Active — solid ink, regardless of family */
.tiq-filter-pill.is-active { background-color: var(--tiq-ink); color: var(--tiq-dark-ink); }
.tiq-filter-pill.is-active .tiq-filter-pill-badge { background-color: rgba(245, 241, 232, 0.22); color: var(--tiq-dark-ink); }

/* ==========================================================================
   Tables (docket-style list rows)
   ========================================================================== */

.tiq-table-header {
  display: flex;
  padding: 10px 16px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--tiq-ink-soft);
  border-bottom: 1px solid var(--tiq-hair);
  margin-bottom: 10px;
}
.tiq-table-container { display: flex; flex-direction: column; }
.tiq-table-row {
  display: flex;
  padding: 14px 16px;
  background-color: var(--tiq-card);
  border-bottom: 1px solid var(--tiq-hair);
  transition: background-color 0.15s ease;
  touch-action: manipulation; /* reliable double-tap-to-view on touch (no zoom delay) */
}
.tiq-table-row:hover { background-color: var(--tiq-cream-deep); }
.tiq-table-row:first-child { border-top-left-radius: var(--tiq-radius); border-top-right-radius: var(--tiq-radius); }
.tiq-table-row:last-child { border-bottom: none; border-bottom-left-radius: var(--tiq-radius); border-bottom-right-radius: var(--tiq-radius); }
.tiq-table-container { border: 1px solid var(--tiq-hair); border-radius: var(--tiq-radius); overflow: hidden; }

/* ==========================================================================
   Dark "voice" panel — for the rare warm-black moment
   ========================================================================== */

.tiq-dark-panel {
  background-color: var(--tiq-dark-bg);
  color: var(--tiq-dark-ink);
  border-radius: var(--tiq-radius-lg);
  padding: 32px;
}
.tiq-dark-panel .tiq-voice { color: var(--tiq-dark-ink); }

/* ==========================================================================
   Warm scrollbar utility (for inset scrolling lists)
   ========================================================================== */

.tiq-scroll { scrollbar-width: thin; scrollbar-color: var(--tiq-hair) var(--tiq-cream-deep); }
.tiq-scroll::-webkit-scrollbar { width: 10px; }
.tiq-scroll::-webkit-scrollbar-track { background: var(--tiq-cream-deep); border-radius: 0 6px 6px 0; }
.tiq-scroll::-webkit-scrollbar-thumb { background: var(--tiq-hair); border-radius: 5px; border: 2px solid var(--tiq-cream-deep); }
.tiq-scroll::-webkit-scrollbar-thumb:hover { background: var(--tiq-ink-soft); }

/* ==========================================================================
   Auth — PM portal sign-in (full-screen split shell)
   Rendered by app/views/users/sessions/new.html.erb on the pm.* host. The
   operator (apex) login keeps its own Motion `auth-*` treatment, untouched.
   ========================================================================== */

.tiq-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background-color: var(--tiq-cream);
}
.tiq-auth-panel {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.tiq-auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.tiq-auth-headline { font-size: 42px; }              /* family + weight come from .tiq-voice */
.tiq-auth-subtitle {
  font-size: 15px; font-weight: 500; line-height: 1.55;
  color: var(--tiq-ink-soft); max-width: 40ch;
}
.tiq-auth-card { box-sizing: border-box; width: 100%; max-width: 420px; justify-self: end; }
.tiq-auth-card-head { margin-bottom: 4px; }
.tiq-auth-card-title { font-size: 20px; font-weight: 700; color: var(--tiq-ink); }
.tiq-auth-card-sub { margin-top: 4px; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--tiq-ink-soft); }
.tiq-auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.tiq-auth-forgot { display: flex; justify-content: flex-end; margin-top: -6px; }
.tiq-auth-footer { margin-top: 18px; text-align: center; font-size: 13px; font-weight: 500; color: var(--tiq-ink-soft); }

/* Larger wordmark for hero / login lockups */
.tiq-wordmark-lg { font-size: 30px; }

@media (max-width: 820px) {
  .tiq-auth-panel { grid-template-columns: 1fr; gap: 28px; max-width: 420px; }
  .tiq-auth-card { justify-self: stretch; }
  .tiq-auth-headline { font-size: 32px; }
}

/* ==========================================================================
   Operator "Cascades" list bridge (PM host only)
   --------------------------------------------------------------------------
   The PM topnav's "Cascades" tab routes to /cascades (WorkflowsController) —
   a SHARED operator view (app/views/workflows/*) that ships Motion classes
   and also renders on the apex operator app. Rather than fork it, we re-skin
   the Motion classes the LIST page uses to TenantIQ tokens, but ONLY under
   `.tiq` (the PM <body>), so the operator/apex rendering stays Motion.

   Color / border / background overrides ONLY — Motion's box model (padding,
   radius, layout) is left intact. As a side benefit these also warm the
   shared modals rendered in the PM layout (e.g. btn-primary CTAs).
   Scope: the /cascades index. Not the execution detail or builder.
   ========================================================================== */

/* Warm color-utility remaps (Motion cool grays/blues → TenantIQ ink/orange) */
.tiq .text-mirage-80  { color: var(--tiq-ink-body); }
.tiq .text-mirage-70  { color: var(--tiq-ink-soft); }
.tiq .text-gray-500   { color: var(--tiq-ink-soft); }
.tiq .text-muted      { color: var(--tiq-muted); }
.tiq .text-disabled   { color: var(--tiq-disabled); }
.tiq .text-primary,
.tiq .text-brand-blue { color: var(--tiq-orange); }
.tiq .text-token-green { color: var(--tiq-success); }
.tiq .hover\:text-primary:hover { color: var(--tiq-orange); }

/* Primary button → ink (the "New Cascade" CTA; also warms shared-modal CTAs) */
.tiq .btn-primary {
  background-color: var(--tiq-ink);
  background-image: none;
  border-color: var(--tiq-ink);
  color: var(--tiq-dark-ink);
}
.tiq .btn-primary:hover { background-color: var(--tiq-ink-body); border-color: var(--tiq-ink-body); }

/* Search + status filter controls. Re-skin the shared (Motion) .search-bar
   and .filter-inline so both read as matching warm TenantIQ controls: the
   CONTAINER carries the card surface, hair border, and orange focus ring,
   while the input/select stay transparent inside it. (The base styles the
   input/select transparent + borderless; the previous override wrongly
   re-filled the input — a nested rectangle — and left the search container on
   Motion's white + cool-blue border, mismatching the cream status box.) */
.tiq .search-bar {
  background-color: #FFFFFF; /* white search field (per request — not the cream card surface) */
  border: 1px solid var(--tiq-hair);
}
.tiq .filter-inline {
  background-color: var(--tiq-card);
  border: 1px solid var(--tiq-hair);
}
.tiq .search-bar:focus-within,
.tiq .filter-inline:focus-within {
  border-color: var(--tiq-orange);
  box-shadow: var(--tiq-focus);
}
.tiq .search-bar:focus-within .search-bar-icon { color: var(--tiq-orange); }
.tiq .search-bar-icon { color: var(--tiq-muted); }
.tiq .search-input { background: transparent; color: var(--tiq-ink-body); }
.tiq .search-input::placeholder { color: var(--tiq-muted); }
.tiq .filter-inline-label { color: var(--tiq-ink-soft); }
/* "All" status select — a compact white chip sized to sit inside the 39px
   .filter-inline container with vertical breathing room (it centers, and the
   chip's padding + line-height keep it shorter than the container). */
.tiq .filter-inline-select {
  background: #FFFFFF;
  color: var(--tiq-ink);
  border: 1px solid var(--tiq-hair);
  border-radius: var(--tiq-radius-sm);
  padding: 4px 10px;
  line-height: 16px;
}

/* Quick-stat pills (Active / Draft counts) */
.tiq .stat-pill-green { background-color: var(--tiq-success-bg); color: var(--tiq-success); }
.tiq .stat-pill-gray  { background-color: var(--tiq-cream-deep); color: var(--tiq-ink-soft); }

/* Status pills (e.g. the "Auto-send" row badge) */
.tiq .status-pill-green  { background-color: var(--tiq-success-bg); color: var(--tiq-success); }
.tiq .status-pill-green  .status-pill-dot { background-color: var(--tiq-success-dot); }
.tiq .status-pill-yellow { background-color: var(--tiq-warning-bg); color: var(--tiq-warning); }
.tiq .status-pill-yellow .status-pill-dot { background-color: var(--tiq-warning-dot); }
.tiq .status-pill-red    { background-color: var(--tiq-error-bg); color: var(--tiq-error); }
.tiq .status-pill-red    .status-pill-dot { background-color: var(--tiq-error-dot); }

/* Active/Draft toggle switch */
.tiq .toggle-switch-track { background-color: var(--tiq-hair); }
.tiq .toggle-switch-track.active { background-color: var(--tiq-success-dot); }

/* Docket table — header, rows, zebra, hover, code chip */
.tiq .docket-table-header { border-bottom-color: var(--tiq-hair); color: var(--tiq-ink-soft); }
.tiq .table-container { border-color: var(--tiq-hair); }
.tiq .docket-table-row { border-bottom-color: var(--tiq-hair); }
.tiq .docket-table-row.bg-white { background-color: var(--tiq-card); }
.tiq .docket-table-row.bg-zebra { background-color: var(--tiq-cream); }
.tiq .docket-table-row:hover { background-color: var(--tiq-cream-deep); }
.tiq .docket-table-row code { background-color: var(--tiq-cream-deep); color: var(--tiq-ink-soft); }

/* Row "Actions" dropdown */
.tiq .actions-dropdown { background-color: var(--tiq-card); border-color: var(--tiq-hair); box-shadow: var(--tiq-shadow); }
.tiq .action-item { color: var(--tiq-ink-soft); }
.tiq .action-item:hover { background-color: var(--tiq-cream-deep); color: var(--tiq-ink); }
.tiq .action-item-danger { color: var(--tiq-error); }
.tiq .action-item-danger:hover { background-color: var(--tiq-error-bg); color: var(--tiq-error); }
.tiq .action-divider { background-color: var(--tiq-hair); }
.tiq .action-toggle:hover { background-color: var(--tiq-cream-deep); }

/* Empty states (no cascades / no filter matches) */
.tiq .empty-state-title { color: var(--tiq-ink); }
.tiq .empty-state-description { color: var(--tiq-ink-soft); }
.tiq .empty-state-icon, .tiq .empty-state-icon svg,
.tiq .empty-state-filtered-icon { color: var(--tiq-hair); }
.tiq .link-default { color: var(--tiq-orange); }
.tiq .link-default:hover { color: var(--tiq-orange-strong); }

/* ==========================================================================
   Modal — overlay + dialog. Host for the adverse-action builder; sized for
   two-pane content. Above the topnav (60), below toasts (9999).
   ========================================================================== */
.tiq-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26, 24, 20, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.tiq-modal-overlay.hidden { display: none; }
.tiq-modal {
  background: var(--tiq-card);
  border-radius: var(--tiq-radius-lg);
  box-shadow: var(--tiq-shadow-lg);
  width: min(1160px, calc(100vw - 48px));
  max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tiq-modal-header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--tiq-hair);
  flex-shrink: 0;
}
.tiq-modal-body { flex: 1; overflow-y: auto; min-height: 0; }
.tiq-modal-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--tiq-hair);
  flex-shrink: 0;
}
.tiq-modal-close {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: none; border-radius: var(--tiq-radius-sm);
  background: transparent; color: var(--tiq-ink-soft);
  cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease;
}
.tiq-modal-close:hover { background: var(--tiq-cream-deep); color: var(--tiq-ink); }

/* ==========================================================================
   Tabs — header tab strip (Report | Adverse action). Active tab is an ink
   pill, mirroring .tiq-btn.
   ========================================================================== */
.tiq-tabs { display: flex; align-items: center; gap: 6px; }
.tiq-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  font-size: 14px; font-weight: 600;
  color: var(--tiq-ink-soft);
  background: transparent; border: none; border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.tiq-tab:hover { color: var(--tiq-ink); background: var(--tiq-cream-deep); }
.tiq-tab.is-active { background: var(--tiq-ink); color: var(--tiq-dark-ink); }
.tiq-tab .tiq-tab-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ==========================================================================
   Chip toggle — checkbox-backed pill for multi-select choices ("Deliver by"
   Mail / Digital). Checked = orange-tint fill (active-state accent use).
   ========================================================================== */
.tiq-chip-toggle {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border: 1.5px solid var(--tiq-hair); border-radius: 999px;
  background: var(--tiq-card); color: var(--tiq-ink-soft);
  font-size: 13px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tiq-chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tiq-chip-toggle:focus-within { box-shadow: var(--tiq-focus); }
.tiq-chip-toggle:has(input:checked) {
  background: var(--tiq-orange-tint);
  border-color: var(--tiq-orange);
  color: var(--tiq-ink);
}
.tiq-chip-check { display: none; width: 14px; height: 14px; flex-shrink: 0; color: var(--tiq-orange-strong); }
.tiq-chip-toggle:has(input:checked) .tiq-chip-check { display: inline; }

/* ==========================================================================
   Document facsimile — HTML mirror of the generated notice PDF (Prawn
   renders Helvetica on white), used for the live preview. Deliberately NOT
   warm-cream and NOT Playfair: this is a document artifact, not UI chrome,
   and it must visually match the PDF the applicant receives.
   ========================================================================== */
.tiq-doc {
  background: #FFFFFF; color: #1F1F1F;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 12.5px; line-height: 1.5;
  border: 1px solid var(--tiq-hair); border-radius: var(--tiq-radius-sm);
  box-shadow: var(--tiq-shadow);
  padding: 32px 36px;
}
.tiq-doc-title {
  text-align: center; font-size: 16px; font-weight: 700;
  letter-spacing: 0.01em; margin: 18px 0 2px;
}
.tiq-doc-subtitle { text-align: center; font-style: italic; font-size: 10.5px; color: #555555; margin-bottom: 4px; }
.tiq-doc-banner {
  border-top: 1px solid #444444; border-bottom: 1px solid #444444;
  text-align: center; font-weight: 700; font-size: 12px;
  padding: 4px 0; margin: 10px 0 12px;
}
.tiq-doc-ecoa { border-top: 1px solid #444444; margin-top: 12px; padding-top: 8px; }
.tiq-doc-heading {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #333333;
  border-bottom: 1px solid #B5B5B5; padding-bottom: 3px;
  margin: 16px 0 7px;
}
.tiq-doc-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #777777; }
.tiq-doc-check { display: flex; align-items: baseline; gap: 8px; margin: 3px 0; color: #999999; }
.tiq-doc-check.is-checked { color: #1F1F1F; font-weight: 700; }
.tiq-doc-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; flex-shrink: 0;
  border: 1.5px solid #555555; border-radius: 2px;
  font-size: 10px; font-weight: 700; line-height: 1; color: #1F1F1F;
  transform: translateY(2px);
}
.tiq-doc-footnote {
  font-size: 10.5px; font-style: italic; color: #666666;
  text-align: center; margin-top: 12px;
  border-top: 1px solid #444444; padding-top: 6px;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* ==========================================================================
   CUSTOM THEME COLORS
   Brand colors from Motion/Cascades design system
   ========================================================================== */
:root {
  --color-blue: #1814F3;
  --color-blue-05: #F2F4FF;
  --color-blue-30: #B3BFFF;
  --color-blue-70: #4D69FF;
  --color-blue-90: #1A3EFF;
  --color-catalina-blue: #343C6A;
  --color-glaucous: #718EBF;
  --color-green-ish: #16DBCC;
  --color-emerald: #16DBCC;
  --color-radical-red: #FE5C73;
  --color-link-water: #DFEAF2;
  --color-yellow-orange: #FFBB38;
  --color-token-green: #00DF81;
  --color-token-yellow: #FFBB38;
  --color-token-orange: #FE8742;
  --color-token-red: #FA3A55;
  --color-token-purple: #9233FE;
  --color-mirage: #0D122D;
  --color-mirage-05: #F3F3F5;
  --color-mirage-80: #3D4157;
  --color-mirage-60: #6E7181;
  --color-mirage-70: #56596C;
  --color-mirage-30: #B6B8C0;
  --color-mirage-20: #CFD0D5;
  --color-portage: #8094FF;
  --color-gray-05: #FAFAFA;
  --color-gray-chateau: #9EA0AB;
  --color-secondary-token-green-light: #D9FAEC;
  --color-secondary-token-yellow-light: #FFF5D9;
  --color-secondary-token-orange-light: #FFEFE5;
  --color-secondary-token-red-light: #FFE0EB;
  --color-secondary-token-purple-light: #F4E9FF;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  overflow-x: hidden;
}

/* ==========================================================================
   PAGE LAYOUT - Main app structure with topnav and content container
   ========================================================================== */
.page-layout {
  min-height: 100vh;
  background-color: var(--color-app-bg, #F7F9FB);
  display: flex;
  flex-direction: column;
}

.page-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 24px 24px 24px;
}

.page-content {
  flex: 1;
  background-color: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px 12px 0 0;
  min-height: 0;
  overflow: hidden;
}

.page-content-inner {
  height: 100%;
  overflow-y: auto;
  padding: 24px;
}

/* ==========================================================================
   TOP NAVIGATION - Cascades design system
   ========================================================================== */
.cascades-topnav {
  display: flex;
  align-items: center;
  height: 66px;
  padding: 0 24px;
  background-color: var(--color-app-bg, #F7F9FB);
  position: relative;
  z-index: 60;
  gap: 0;
}

/* Left group: Logo + Mode Toggle */
.topnav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Logo */
.topnav-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.topnav-logo-full {
  height: 25px;
  width: auto;
}

/* Navigation Items - fills middle space */
.topnav-navigation {
  display: flex;
  align-items: stretch;
  gap: 45px;
  height: 100%;
  flex: 1;
  padding-left: 40px;
}

.topnav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  text-decoration: none;
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage-70, #56596C);
  transition: color 0.2s ease;
}

.topnav-item:hover {
  color: var(--color-mirage, #0D122D);
}

.topnav-item.active {
  color: var(--color-mirage, #0D122D);
}

.topnav-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--color-primary, #0029FF);
  border-radius: 3px 3px 0 0;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s ease;
}

.topnav-item:hover .topnav-indicator {
  transform: scaleY(1);
}

.topnav-item.active .topnav-indicator {
  transform: scaleY(1);
}

/* Right Side Actions */
.topnav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav-explore-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-family: Inter, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-primary, #0029FF);
  transition: background-color 0.2s ease;
}

.topnav-explore-btn:hover {
  background-color: var(--color-blue-05, #F2F4FF);
}

.topnav-explore-icon {
  width: 24px;
  height: 24px;
  color: var(--color-primary, #0029FF);
}

.topnav-divider {
  width: 1px;
  height: 26px;
  background-color: var(--color-link-water, #DFEAF2);
  margin: 0 8px;
}

.topnav-user {
  position: relative;
}

.topnav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Lato', Inter, sans-serif;
  font-size: 15px;
  color: var(--color-mirage, #0D122D);
}

.topnav-user-btn:hover {
  opacity: 0.8;
}

.topnav-user-email {
  white-space: nowrap;
}

.topnav-chevron {
  width: 24px;
  height: 24px;
  color: var(--color-mirage, #0D122D);
  transition: transform 0.2s ease;
}

.topnav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 150px;
  background: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px;
  z-index: 100;
}

.topnav-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: var(--color-mirage-70, #56596C);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.topnav-dropdown-item:hover {
  background-color: var(--color-app-bg, #F7F9FB);
  color: var(--color-mirage, #0D122D);
}

/* ==========================================================================
   TOPNAV - Admin/User Mode Toggle
   Segmented pill control for switching between User and Admin modes
   ========================================================================== */
.topnav-mode-toggle {
  display: flex;
  align-items: center;
  background-color: var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  padding: 3px;
}

.topnav-mode-btn {
  padding: 5px 14px;
  border-radius: 6px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  color: var(--color-mirage-70, #56596C);
  text-decoration: none;
  transition: all 0.2s ease;
}

.topnav-mode-btn:hover {
  color: var(--color-mirage, #0D122D);
}

.topnav-mode-btn.active {
  background-color: white;
  color: var(--color-mirage, #0D122D);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Mobile admin section label */
.topnav-mobile-section-label {
  display: block;
  padding: 8px 16px 4px;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-70, #56596C);
}

/* ==========================================================================
   IMPERSONATION BANNER
   Shown when an admin is logged in as another user
   ========================================================================== */
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background-color: var(--color-token-yellow-10, #FFF8E6);
  border-bottom: 1px solid var(--color-token-yellow, #FFBB38);
  z-index: 59;
  font-family: Inter, sans-serif;
  color: var(--color-mirage, #0D122D);
}

/* ==========================================================================
   TOPNAV - Hamburger Button (hidden on desktop)
   ========================================================================== */
.topnav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 9px;
  transition: background-color 0.2s ease;
}

.topnav-hamburger:hover {
  background-color: var(--color-blue-05, #F2F4FF);
}

.topnav-hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-mirage, #0D122D);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.topnav-hamburger-active .topnav-hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topnav-hamburger-active .topnav-hamburger-line:nth-child(2) {
  opacity: 0;
}

.topnav-hamburger-active .topnav-hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   TOPNAV - Mobile Overlay
   ========================================================================== */
.topnav-mobile-overlay {
  position: fixed;
  inset: 0;
  top: 66px;
  background-color: rgba(13, 18, 45, 0.3);
  z-index: 40;
}

.topnav-mobile-overlay.hidden {
  display: none;
}

/* ==========================================================================
   TOPNAV - Mobile Menu Panel
   ========================================================================== */
.topnav-mobile-menu {
  display: none;
}

.topnav-mobile-menu-inner {
  padding: 12px 0;
}

.topnav-mobile-nav {
  display: flex;
  flex-direction: column;
}

.topnav-mobile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 20px;
  color: var(--color-mirage-70, #56596C);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.topnav-mobile-item:hover {
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
}

.topnav-mobile-item.active {
  color: var(--color-primary, #0029FF);
  border-left: 3px solid var(--color-primary, #0029FF);
  padding-left: 21px;
}

.topnav-mobile-item .topnav-explore-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary, #0029FF);
}

.topnav-mobile-signout {
  color: var(--color-token-red, #FA3A55);
}

.topnav-mobile-signout:hover {
  color: var(--color-token-red, #FA3A55);
  background-color: var(--color-secondary-token-red-light, #FFE0EB);
}

.topnav-mobile-user {
  padding: 10px 24px;
}

.topnav-mobile-user-email {
  font-family: Inter, sans-serif;
  font-size: 13px;
  color: var(--color-muted, #868896);
  font-weight: 400;
}

.topnav-mobile-menu .divider {
  margin: 8px 24px;
}

/* ==========================================================================
   TOPNAV - Responsive Breakpoint (1000px)
   ========================================================================== */
@media (max-width: 1000px) {
  .cascades-topnav {
    padding: 0 16px;
  }

  .topnav-mode-toggle {
    display: none;
  }

  .topnav-navigation {
    display: none;
  }

  .topnav-actions {
    display: none;
  }

  .topnav-hamburger {
    display: flex;
  }

  .topnav-mobile-menu {
    display: block;
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    background-color: var(--color-white, #FFFFFF);
    border-bottom: 1px solid var(--color-link-water, #DFEAF2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 50;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  }

  .topnav-mobile-menu-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 480px) {
  .cascades-topnav {
    padding: 0 12px;
  }
}

/* ==========================================================================
   MODAL STYLES - Explore Products and generic modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  position: relative;
  background-color: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

/* Explore Products Modal */
.explore-modal {
  display: flex;
  width: 1200px;
  max-width: calc(100vw - 48px);
  height: 600px;
  padding: 15px;
  overflow: hidden;
}

/* Left Sidebar */
.explore-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.explore-sidebar-title {
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 24px;
  color: var(--color-mirage);
  margin: 0;
  padding: 4px 0 12px;
}

.explore-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--color-link-water);
  background: white;
  color: var(--color-mirage-70);
  cursor: pointer;
  z-index: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.explore-close-btn:hover {
  background-color: var(--color-app-bg);
  color: var(--color-mirage);
}

.explore-section-header {
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  color: var(--color-mirage);
  padding: 8px 0;
}

.explore-section-spacer {
  height: 12px;
}

.explore-nav-item {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.explore-nav-indicator {
  width: 3px;
  height: 38px;
  display: flex;
  align-items: center;
}

.explore-nav-indicator::after {
  content: '';
  width: 3px;
  height: 18px;
  background-color: transparent;
  border-radius: 0 10px 10px 0;
  transition: background-color 0.2s ease;
}

.explore-nav-item.active .explore-nav-indicator::after,
.explore-nav-item:hover .explore-nav-indicator::after {
  background-color: var(--color-blue);
}

.explore-nav-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px;
  height: 38px;
  border-radius: 9px;
  transition: background-color 0.2s ease;
}

.explore-nav-item:hover .explore-nav-content {
  background-color: var(--color-blue-05);
}

.explore-nav-item.active .explore-nav-content {
  background-color: var(--color-primary-light);
}

.explore-nav-icon {
  width: 24px;
  height: 24px;
  color: var(--color-mirage-70);
  flex-shrink: 0;
}

.explore-nav-item.active .explore-nav-icon {
  color: var(--color-blue);
}

.explore-nav-category-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.explore-nav-category-svg {
  width: 16px;
  height: 16px;
  color: var(--color-mirage-70);
}

.explore-nav-vendor-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  color: var(--color-mirage-80);
}

.explore-nav-label {
  flex: 1;
  font-family: Inter, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage-70);
  transition: color 0.2s ease, font-weight 0.15s ease;
}

.explore-nav-item.active .explore-nav-label {
  color: var(--color-blue);
  font-weight: 600;
}

.explore-nav-badge {
  min-width: 32px;
  padding: 6px 9px;
  background-color: var(--color-app-bg);
  border-radius: 12px;
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  color: var(--color-mirage-70);
  text-align: center;
}

.explore-nav-item.active .explore-nav-badge {
  background-color: white;
}

/* Right Content */
.explore-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

.explore-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.explore-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 333px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-link-water);
  border-radius: 8px;
  background-color: white;
  transition: border-color 0.15s ease;
}

.explore-search-bar:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

.explore-search-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-mirage-50);
}

.explore-search-input,
.explore-search-input:focus {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: Inter, sans-serif;
  font-size: 13px;
  line-height: 20px;
  color: var(--color-mirage);
  background: transparent !important;
  padding: 0 !important;
  margin: 0;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.explore-search-input::placeholder {
  color: var(--color-mirage-50);
}

.explore-result-count {
  font-size: 12px;
  color: var(--color-mirage-60);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Products List */
.explore-products-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 4px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.explore-products-list::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

/* Empty search state */
.explore-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
}

.explore-empty.hidden {
  display: none;
}

.explore-empty-icon {
  width: 32px;
  height: 32px;
  color: var(--color-mirage-30);
}

.explore-empty-text {
  font-size: 14px;
  color: var(--color-mirage-60);
  margin: 0;
}

.explore-product-item {
  display: flex;
  flex-direction: column;
  background-color: white;
  border: 1px solid var(--color-link-water);
  border-radius: 12px;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

.explore-product-item:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.explore-product-item.expanded {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.explore-product-item.hidden {
  display: none;
}

/* Product Header Button (collapsed state trigger) */
.explore-product-header-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.explore-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.explore-product-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.explore-product-vendor-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 42px;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  color: var(--color-mirage-80);
}

.explore-product-name {
  font-family: Inter, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage);
}

.explore-product-description {
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-mirage-60);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* Product meta — price + inquiry pill */
.explore-product-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}

.explore-product-price {
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage);
  white-space: nowrap;
}

.explore-product-price-unit {
  font-weight: 400;
  font-size: 12px;
  color: var(--color-mirage-60);
}

.explore-inquiry-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.explore-inquiry-pill--soft {
  background-color: var(--color-secondary-token-green-light);
  color: var(--color-token-green);
}

.explore-inquiry-pill--hard {
  background-color: var(--color-secondary-token-yellow-light);
  color: var(--color-mirage-80);
}

.explore-product-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--color-mirage-30);
  transition: transform 0.2s ease;
}

.explore-product-item.expanded .explore-product-chevron {
  transform: rotate(90deg);
}

/* Expanded Content */
.explore-product-expanded {
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 0 18px 18px 18px;
}

.explore-product-item.expanded .explore-product-expanded {
  display: flex;
}

.explore-product-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.explore-detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--color-app-bg);
  border: 1px solid var(--color-link-water);
  border-radius: 8px;
  padding: 12px 16px;
}

.explore-detail-section--workflows .explore-detail-icon {
  color: var(--color-token-green);
}

.explore-detail-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.explore-detail-icon {
  width: 18px;
  height: 18px;
  color: var(--color-blue);
}

.explore-detail-title {
  font-family: Inter, sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
  color: var(--color-mirage);
}

.explore-detail-text {
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 18px;
  color: var(--color-mirage-60);
  margin: 0;
  text-align: justify;
}

.explore-use-cases {
  margin: 0;
  padding-left: 16px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 20px;
  color: var(--color-mirage-60);
}

.explore-use-cases li {
  margin-bottom: 2px;
}

.explore-detail-section--workflows .explore-use-cases li {
  text-align: justify;
}

.explore-detail-section--limitations {
  grid-column: 1 / -1;
  background-color: var(--color-secondary-token-yellow-light);
  border: 1px solid var(--color-token-yellow);
  border-radius: 8px;
  padding: 12px 16px;
}

.explore-detail-section--limitations .explore-detail-icon {
  color: var(--color-token-yellow);
}

.explore-product-cta {
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   MOTION BRAND FONT CLASSES
   ========================================================================== */
.motion-heading-font {
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-mirage);
  font-size: 28px;
}

.motion-semi-bold-font {
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--color-mirage);
  font-size: 15px;
  line-height: 150%;
}

.motion-regular-font {
  color: var(--color-mirage-80);
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 150%;
}

/* ==========================================================================
   BUTTON STYLES
   Primary, Secondary, and Tertiary button variants
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #0029ff;
  border: 1px solid #0029ff;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #001fcf;
  border-color: #001fcf;
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.3);
}

.btn-primary svg {
  color: #ffffff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #ffffff;
  border: 1px solid #0029ff;
  border-radius: 9px;
  color: #0029ff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #f2f4ff;
}

.btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.3);
}

.btn-secondary svg {
  color: #0029ff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #f2f4ff;
  border: 1px solid #f2f4ff;
  border-radius: 9px;
  color: #0029ff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tertiary:hover {
  background-color: #e5eaff;
  border-color: #e5eaff;
}

.btn-tertiary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.15);
}

.btn-tertiary svg {
  color: #0029ff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-0.5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes appear-then-fade {
  0%, 100% {
    opacity: 0;
  }
  5%, 60% {
    opacity: 1;
  }
}

/* ==========================================================================
   FLASH MESSAGES
   ========================================================================== */
.flash {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
  width: max-content;
  padding: 0 1rem;
  z-index: 9999;
}

.flash__message {
  font-size: 1rem;
  color: white;
  padding: 0.5rem 1rem;
  background-color: black;
  animation: appear-then-fade 4s both;
  border-radius: 999px;
}

.flash__notice {
  background-color: #4CAF50;
}

.flash__alert {
  background-color: #FFC107;
}

.flash__error {
  background-color: #F44336;
}

/* ==========================================================================
   TOOLTIP STYLES
   ========================================================================== */
.tooltip {
  position: fixed;
  display: none;
  background-color: #1F2937;
  color: white;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  z-index: 9999;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.group:hover .tooltip {
  display: block;
}

/* ==========================================================================
   DROPDOWN STYLES
   ========================================================================== */
.dropdown-menu {
  display: none;
  min-width: 150px;
  z-index: 50;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 5px;
}

.dropdown-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #1d4ed8;
  background-color: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  text-decoration: none;
  margin-bottom: 0.25rem;
  width: 100%;
}

.dropdown-item:hover {
  background-color: #e5e7eb;
}

.dropdown-menu.show {
  display: block;
}

/* ==========================================================================
   DOCKET TABLE STYLES
   Flex-based table layout matching Motion brand design
   ========================================================================== */
.docket-table-header {
  display: flex;
  background-color: var(--color-mirage-05, #F3F3F5);
  padding: 12px 15px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-mirage-80, #3D4157);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docket-table-header a {
  color: inherit;
  text-decoration: none;
}

.docket-table-header a:hover {
  color: inherit;
}

.docket-table-row {
  display: flex;
  flex-wrap: wrap;
  padding: 14px 15px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
}

.docket-table-row:last-child {
  border-bottom: none;
}

/* ==========================================================================
   FILTER DROPDOWN STYLES
   Search and filter UI components
   ========================================================================== */
.filter-dropdown {
  background: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 9px;
  padding: 16px;
  min-width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.filter-inline {
  background: var(--color-white, #FFFFFF);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 39px;
  padding: 0 12px;
  border-radius: 9px;
}

.filter-inline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-inline-select {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  padding: 0;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.filter-inline-toggle {
  background: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 39px;
  padding: 0 14px;
  border-radius: 9999px;
  font-size: 14px;
  color: var(--color-mirage-70, #56596C);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.filter-inline-toggle:hover {
  border-color: #FFBB38;
}

.filter-inline-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.filter-inline-toggle .status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  display: inline-block;
  background: #FFBB38;
}

.filter-inline-toggle:has(input:checked) {
  background-color: #FFF4DB;
  color: #B07A00;
  border-color: #FFBB38;
  font-weight: 600;
}

.filter-inline-toggle:has(input:checked) .status-pill-dot {
  background: #B07A00;
}

/* Keyboard focus ring (checkbox is hidden, so ring goes on the label) */
.filter-inline-toggle:focus-within {
  outline: 2px solid rgba(255, 187, 56, 0.35);
  outline-offset: 2px;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-blue-90, #1A3EFF);
  box-shadow: 0 0 0 3px rgba(26, 62, 255, 0.15);
}

.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.filter-divider {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* Hidden utility class for Stimulus controllers */
.hidden {
  display: none !important;
}

/* ==========================================================================
   WORKFLOWS UI CUSTOM CLASSES
   Custom width, height, gap, and styling for workflows table
   ========================================================================== */

/* Table column widths */
.col-w-60 { width: 60px; flex-shrink: 0; }
.col-w-80 { width: 80px; flex-shrink: 0; }
.col-w-100 { width: 100px; flex-shrink: 0; }
.col-w-120 { width: 120px; flex-shrink: 0; }
.col-w-160 { width: 160px; flex-shrink: 0; }
.col-w-150 { width: 150px; flex-shrink: 0; }
.col-code-sm { width: 120px; flex-shrink: 0; }
.col-created { width: 170px; flex-shrink: 0; }

/* Flex columns for name/code - share remaining space */
.col-name {
  flex: 1.1;
  min-width: 0;
}

.col-code {
  flex: 0.9;
  min-width: 0;
}

.col-owner {
  width: 180px;
  flex-shrink: 0;
}

/* Search bar */
.search-bar {
  background: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  gap: 8px;
  height: 39px;
  align-items: center;
  padding: 0 10px;
  border-radius: 9px;
  width: 333px;
  transition: border-color 0.15s ease;
}

.search-bar:focus-within {
  border-color: var(--color-primary, #0029FF);
}

.search-bar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-mirage-30, #B6B8C0);
}

.search-bar:focus-within .search-bar-icon {
  color: var(--color-primary, #0029FF);
}

.search-input {
  width: 100%;
  font-weight: 400;
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  line-height: 20px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.search-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.search-clear-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--color-mirage-30, #B6B8C0);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.search-clear-btn:hover {
  color: var(--color-mirage-80, #3D4157);
  background-color: var(--color-mirage-05, #F3F3F5);
}

/* Search loading state */
.search-loading .search-bar-icon {
  animation: search-spin 0.8s linear infinite;
  color: var(--color-primary, #0029FF);
}

@keyframes search-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Filter button */
.filter-btn {
  background: white;
  border: 1px solid #dfeaf2;
  display: flex;
  gap: 12px;
  height: 39px;
  align-items: center;
  padding: 0 9px;
  border-radius: 9px;
  cursor: pointer;
}

.filter-btn:hover {
  background: #f9fafb;
}

.filter-icon-box {
  background: #f7f9fb;
  border: 1px solid #f2f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Icon sizes */
.icon-15 { width: 15px; height: 15px; }
.icon-18 { width: 18px; height: 18px; }
.icon-19 { width: 19px; height: 19px; }

/* Gap utilities */
.gap-15 { gap: 15px; }

/* Colors */
.text-mirage { color: #0D122D; }
.text-mirage-80 { color: #3D4157; }
.text-mirage-70 { color: #56596C; }
.text-mirage-60 { color: #6E7181; }
.text-mirage-30 { color: #B6B8C0; }
.text-muted { color: #868896; }
.text-brand-blue { color: #1a3eff; }
.bg-zebra { background-color: #FAFAFA; }

/* Status badge with dot */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 28px;
  box-sizing: border-box;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge-active {
  border: 1px solid #bbf7d0;
}

.status-badge-draft {
  border: 1px solid #e5e7eb;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot-active {
  background-color: #16a34a;
}

.status-dot-draft {
  background-color: #9ca3af;
}

.status-badge-failed {
  border: 1px solid #fecaca;
}

.status-dot-failed {
  background-color: #dc2626;
}

/* Row actions dropdown */
.actions-dropdown {
  position: absolute;
  right: 0;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 100;
  width: max-content;
  min-width: 80px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.action-item {
  display: flex;
  align-items: center;
  padding: 8px;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  border-radius: 6px;
  font-size: 14px;
  color: #3D4157;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.action-item:hover {
  background-color: var(--color-primary-light, #E6EAFF);
}

.action-item-danger {
  color: #dc2626;
}

.action-item-danger:hover {
  background-color: #fef2f2;
}

.action-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
}

.action-divider {
  height: 1px;
  background-color: var(--color-link-water, #DFEAF2);
  margin: 4px 0;
}

.action-toggle {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-mirage-60, #6E7181);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.action-toggle:hover,
.action-toggle-active {
  background: #f5f7ff;
  border-color: var(--color-blue-30, #B3BFFF);
  color: var(--color-blue, #1814F3);
}

.action-toggle:focus-visible {
  outline: none;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.15);
}

/* Pagination */
.pagy-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 14px;
  color: var(--color-mirage-70, #56596C);
}

.pagy-nav .page a,
.pagy-nav .page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-mirage-70, #56596C);
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pagy-nav .page a:hover {
  background: var(--color-primary-light, #E6EAFF);
  color: var(--color-blue, #1814F3);
}

.pagy-nav .page.active {
  background: var(--color-blue, #0029FF);
  color: #ffffff;
  font-weight: 600;
  border-radius: 8px;
}

.pagy-nav .page.disabled {
  color: var(--color-disabled, #C4C6C8);
  pointer-events: none;
}

.pagy-nav .page.gap {
  background: transparent;
  min-width: auto;
  padding: 0 4px;
  letter-spacing: 2px;
}

.pagy-nav .page.prev,
.pagy-nav .page.next {
  margin: 0 4px;
}

.pagy-nav .page.prev a,
.pagy-nav .page.next a {
  font-weight: 500;
  color: var(--color-mirage-80, #3D4157);
}

/* ==========================================================================
   DISABLED STATES
   ========================================================================== */
a:disabled,
button:disabled,
input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:disabled {
  background-color: #d1d5db;
  color: #6b7280;
}

input:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
}

a.disabled {
  background-color: #d1d5db;
  color: #6b7280;
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tailwind-like utility classes */
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-white { background-color: #ffffff; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-600 { background-color: #16a34a; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-gray-400 { background-color: #9ca3af; }

.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-blue-900 { color: #1e3a8a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-red-800 { color: #991b1b; }
.text-red-900 { color: #7f1d1d; }
.text-yellow-800 { color: #92400e; }
.text-purple-800 { color: #6b21a8; }
.text-white { color: #ffffff; }

.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-500 { border-color: #3b82f6; }
.border-green-400 { border-color: #4ade80; }
.border-green-200 { border-color: #bbf7d0; }
.border-amber-400 { border-color: #fbbf24; }
.border-red-200 { border-color: #fecaca; }
.border-transparent { border-color: transparent; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }

.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   DRAWFLOW OVERRIDES
   Custom styling for workflow canvas and nodes
   ========================================================================== */
#drawflow {
  width: 100%;
  height: 100%;
  background: #ffffff;
  background-size: 14px 14px;
  background-image: radial-gradient(#DFEAF2 1px, transparent 1px);
}

/* Original drawflow styles - keep for other visualizations */
.drawflow .drawflow-node {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #0D122D !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-family: 'Inter', sans-serif !important;
  width: max-content !important;
  min-width: 240px;
  max-width: 420px;
}

.drawflow .drawflow-node.selected .custom-node,
.drawflow .drawflow-node.selected .base-node {
  border: 1px solid var(--color-blue-90, #1A3EFF) !important;
}


.node-warning-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  width: 28px;
  height: 28px;
  padding: 0;
  z-index: 5;
}

/* Decision nodes: move warning badge to the left to avoid overlapping port labels */
#drawflow .drawflow .drawflow-node.IfElse .node-warning-badge,
#drawflow .drawflow .drawflow-node.Condition .node-warning-badge,
#drawflow .drawflow .drawflow-node.Decision .node-warning-badge {
  right: auto;
  left: -10px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  box-sizing: border-box;
}

.node-warning-badge svg {
  width: 18px;
  height: 18px;
}

.node-warning-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  z-index: 6;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0D122D;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.node-warning-badge:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.node-warning-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(245, 158, 11, 0.5);
}

/* Node context menu trigger button */
#drawflow .node-menu-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  z-index: 5;
  padding: 0;
  outline: none;
  box-shadow: none;
}

#drawflow .node-menu-btn:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage-80, #3D4157);
}

/* Shared floating context menu for nodes */
.node-context-menu {
  position: fixed;
  z-index: 10000;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  min-width: 160px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.node-context-menu.hidden {
  display: none;
}

.drawflow .drawflow-node .inputs,
.drawflow .drawflow-node .outputs {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.drawflow .drawflow-node .input,
.drawflow .drawflow-node .output {
  border: 0 !important;
  background: transparent !important;
  cursor: crosshair !important;
}

.drawflow .connection .main-path {
  fill: none !important;
  stroke-width: 5px !important;
  stroke: #DFEAF2 !important;
  pointer-events: all !important;
  cursor: pointer !important;
}

.drawflow .connection .main-path:hover {
  stroke: var(--color-blue-90, #1A3EFF) !important;
  stroke-width: 6px !important;
}

.drawflow .drawflow-delete {
  background: #ef4444;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   CUSTOM OUTPUT PORTS
   Circle-style output ports with labels
   ========================================================================== */
.custom-outputs {
  position: absolute;
  right: 0;
  top: 46%;
  transform: translate(50%, -50%);
}

.drawflow-node-output {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 20px;
  height: 20px;
  justify-content: center;
  margin-bottom: 5px;
}

.drawflow-node-output::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  width: 14px;
  height: 14px;
  background: #DFEAF2;
  border-radius: 50%;
  border: 1.5px solid #DFEAF2;
}

.custom-port-label {
  max-width: 40px;
  margin-left: -40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

/* ==========================================================================
   CUSTOM INPUT PORT (Arrow style)
   ========================================================================== */
.custom-port-arrow {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-81%, -67%);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   VERTICAL LAYOUT MODE
   Adjustments for vertical workflow orientation (applied when #drawflow has
   the `.vertical` class)
   ========================================================================== */

/* Inputs container: tall enough to span the detached "Connect Here" pill
   AND the node's top edge. pointer-events is gated by .connection-mode so it
   only intercepts clicks while a connection drag is in flight (otherwise
   panning/clicks above the node would be eaten by the invisible container). */
#drawflow.vertical .drawflow .drawflow-node .inputs {
  position: absolute !important;
  left: 50% !important;
  top: 0 !important;
  right: auto !important;
  transform: translate(-50%, -100%) !important;
  display: block !important;
  height: 44px !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  isolation: isolate;
}

/* Outputs container: decision-style nodes keep a tight flex layout for the
   3 branch labels (PASS / HUMAN_REVIEW / REJECT). Non-decision override is
   below: a tall block container that covers the "Connect" pill area. */
#drawflow.vertical .drawflow .drawflow-node .outputs {
  position: absolute !important;
  left: 50% !important;
  top: 100% !important;
  bottom: auto !important;
  right: auto !important;
  transform: translate(-50%, -66%) !important;
  flex-direction: row !important;
  display: flex !important;
  gap: 0;
  width: auto !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
  isolation: isolate;
}

#drawflow.vertical .drawflow .drawflow-node:not(.IfElse):not(.Condition):not(.Decision) .outputs {
  transform: translate(-50%, 0) !important;
  display: block !important;
  height: 44px !important;
  cursor: crosshair !important;
}

/* Match cursor on the input container during a drag so the "Drop Here"
   pill area reads as a valid drop target. */
#drawflow.vertical.connection-mode .drawflow .drawflow-node .inputs {
  cursor: crosshair !important;
}

/* Activate hit testing on the input container only while a connection drag
   is active. This is what makes mouseup land on .inputs (a node descendant)
   when the user releases on the detached "Drop Here" pill cue. Output
   containers stay pointer-events: none so connection-line clicks pass
   through to the SVG path for selection/deletion. */
#drawflow.vertical.connection-mode .drawflow .drawflow-node .inputs {
  pointer-events: auto !important;
}

/* Width of the tall input/output hit container for non-decision nodes. */
#drawflow.vertical .drawflow .drawflow-node:not(.IfElse):not(.Condition):not(.Decision) .inputs,
#drawflow.vertical .drawflow .drawflow-node:not(.IfElse):not(.Condition):not(.Decision) .outputs {
  width: calc(100% - 44px) !important;
  min-width: 170px !important;
  max-width: 360px !important;
}

/* The .input/.output port is the actual Drawflow drag anchor. We pin it
   absolutely inside the (now tall) inputs/outputs container so the visible
   port still sits at the node edge — Drawflow's drag-start hit detection
   and our custom path routing both expect the anchor at the edge. The
   surrounding tall container covers the pill area for mouseup capture. */
#drawflow.vertical .drawflow .drawflow-node .input,
#drawflow.vertical .drawflow .drawflow-node .input:hover {
  position: absolute !important;
  left: 50% !important;
  bottom: -7px !important;
  transform: translateX(-50%) !important;
  width: 280px !important;
  height: 14px !important;
  margin: 0 !important;
  cursor: crosshair !important;
  background: transparent !important;
  pointer-events: auto !important;
  border-radius: 8px;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  z-index: 100 !important;
}

#drawflow.vertical .drawflow .drawflow-node:not(.IfElse):not(.Condition):not(.Decision) .output,
#drawflow.vertical .drawflow .drawflow-node:not(.IfElse):not(.Condition):not(.Decision) .output:hover {
  position: absolute !important;
  left: 50% !important;
  top: -7px !important;
  transform: translateX(-50%) !important;
  width: 280px !important;
  height: 14px !important;
  margin: 0 !important;
  cursor: crosshair !important;
  background: transparent !important;
  pointer-events: auto !important;
  border-radius: 8px;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  z-index: 100 !important;
}

#drawflow.vertical .drawflow .drawflow-node .input:hover,
#drawflow.vertical .drawflow .drawflow-node .output:hover {
  background: transparent !important;
}

/* Detached connect affordance: explicit enough to teach the interaction,
   but anchored off the node's real width instead of a fixed port strip. */
#drawflow.vertical .drawflow .drawflow-node.port-hover-output:not(.IfElse):not(.Condition):not(.Decision),
#drawflow.vertical .drawflow .drawflow-node.port-hover-input {
  border-color: rgba(77, 105, 255, 0.44) !important;
}

/* (Stale flex sizing rule removed — .input/.output are absolutely positioned
   inside their now-tall container, see rules above.) */

/* Detached pill cue rendered above (input) or below (output) the node card.
   The pill has pointer-events: none; releases that land on it are caught by
   the document-level fallback in visualization_controller.js. */
#drawflow.vertical .drawflow .drawflow-node.port-hover-output:not(.IfElse):not(.Condition):not(.Decision) .outputs::after,
#drawflow.vertical .drawflow .drawflow-node.port-hover-input .inputs::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1A3EFF;
  background: #FFFFFF;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(84, 109, 255, 0.32);
  box-shadow: 0 4px 14px rgba(13, 18, 45, 0.1);
  pointer-events: none;
  white-space: nowrap;
  z-index: 1000;
}

/* Pill sits INSIDE the tall .inputs/.outputs container — that way mouseup
   on the pill area falls through (pill has pointer-events: none) onto the
   container, which is a node descendant and gets caught by the canvas
   mouseup fallback. Anchored near the inner edge of the container so the
   pill sits close to the node card (about 8px gap), not floating far away. */
#drawflow.vertical .drawflow .drawflow-node.port-hover-input .inputs::after {
  bottom: 8px;
  content: "Connect Here";
}

#drawflow.vertical .drawflow .drawflow-node.port-hover-output:not(.IfElse):not(.Condition):not(.Decision) .outputs::after {
  top: 8px;
  content: "Connect";
}

#drawflow.vertical.connection-mode .drawflow .drawflow-node.port-hover-input .inputs::after {
  content: "Drop Here";
  color: #FFFFFF;
  background: #1A3EFF;
  border-color: #1A3EFF;
  box-shadow: 0 6px 16px rgba(26, 62, 255, 0.32);
}

/* Decision node: 3 outputs spread across the row, each wide enough for
   its label so clicking the label drags from that specific port. */
#drawflow.vertical .drawflow .drawflow-node.IfElse .outputs,
#drawflow.vertical .drawflow .drawflow-node.Condition .outputs,
#drawflow.vertical .drawflow .drawflow-node.Decision .outputs {
  width: 260px;
  justify-content: space-between;
}

#drawflow.vertical .drawflow .drawflow-node.IfElse .output,
#drawflow.vertical .drawflow .drawflow-node.Condition .output,
#drawflow.vertical .drawflow .drawflow-node.Decision .output {
  width: 100px !important;
  height: 14px !important;
  flex: 0 0 100px !important;
  margin: 0 !important;
  position: relative !important;
  cursor: crosshair !important;
}

/* Decision port labels: sit near the TOP of the port, just below the
   node edge, so they read as belonging to the Decision node.
   pointer-events: none so clicks pass through to the parent port. */
#drawflow.vertical .drawflow .drawflow-node.IfElse .output_1::after,
#drawflow.vertical .drawflow .drawflow-node.IfElse .output_2::after,
#drawflow.vertical .drawflow .drawflow-node.IfElse .output_3::after,
#drawflow.vertical .drawflow .drawflow-node.Condition .output_1::after,
#drawflow.vertical .drawflow .drawflow-node.Condition .output_2::after,
#drawflow.vertical .drawflow .drawflow-node.Condition .output_3::after,
#drawflow.vertical .drawflow .drawflow-node.Decision .output_1::after,
#drawflow.vertical .drawflow .drawflow-node.Decision .output_2::after,
#drawflow.vertical .drawflow .drawflow-node.Decision .output_3::after {
  left: 50% !important;
  top: 2px !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  pointer-events: none;
}

#drawflow.vertical .drawflow .drawflow-node.IfElse .output_1:hover::after,
#drawflow.vertical .drawflow .drawflow-node.Condition .output_1:hover::after,
#drawflow.vertical .drawflow .drawflow-node.Decision .output_1:hover::after,
#drawflow.vertical .drawflow .drawflow-node.IfElse .output_2:hover::after,
#drawflow.vertical .drawflow .drawflow-node.Condition .output_2:hover::after,
#drawflow.vertical .drawflow .drawflow-node.Decision .output_2:hover::after,
#drawflow.vertical .drawflow .drawflow-node.IfElse .output_3:hover::after,
#drawflow.vertical .drawflow .drawflow-node.Condition .output_3:hover::after,
#drawflow.vertical .drawflow .drawflow-node.Decision .output_3:hover::after {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(13, 18, 45, 0.08);
}

/* Vertical layout: Decision node matches the height of other nodes (72px).
   The extra 100px height from the horizontal layout was only needed to stack
   3 output ports vertically along the right edge. */
#drawflow.vertical .drawflow .drawflow-node.IfElse .base-node,
#drawflow.vertical .drawflow .drawflow-node.Condition .base-node,
#drawflow.vertical .drawflow .drawflow-node.Decision .base-node {
  height: 72px !important;
}

/* Node drag items */
.node-drag-item {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.node-drag-item:hover {
  transform: translateY(-1px);
}

.node-drag-item:active {
  transform: scale(0.98);
  opacity: 0.8;
}

/* Sidebar transitions */
[data-visualization-ui-target="leftSidebar"],
[data-visualization-ui-target="rightSidebar"] {
  transition: width 0.2s ease, opacity 0.2s ease;
}

[data-visualization-ui-target="leftSidebar"].collapsed,
[data-visualization-ui-target="rightSidebar"].collapsed {
  opacity: 0;
}

/* Form inputs */
input[type="text"],
input[type="url"],
input[type="number"],
input[type="email"],
select:not(.btn-demo-select),
textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #111827;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:not(.btn-demo-select):focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Form input - Motion styled */
.form-input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-mirage, #0D122D);
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

/* Form card */
.form-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-link-water, #DFEAF2);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
  background: linear-gradient(135deg, #f3f6ff 0%, #f7fbf5 55%, #fff7f0 100%);
  position: relative;
  overflow: hidden;
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  color: #0b1227;
}

.auth-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 48px;
  align-items: center;
  max-width: 1100px;
  width: 100%;
}

.auth-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(0);
  opacity: 0.6;
  animation: auth-float 16s ease-in-out infinite;
}

.auth-orb-1 {
  width: 260px;
  height: 260px;
  top: -40px;
  left: -60px;
  background: radial-gradient(circle at 30% 30%, #b9d3ff, transparent 70%);
}

.auth-orb-2 {
  width: 220px;
  height: 220px;
  bottom: -60px;
  right: 15%;
  background: radial-gradient(circle at 50% 50%, #c5f2d8, transparent 70%);
  animation-delay: -4s;
}

.auth-orb-3 {
  width: 180px;
  height: 180px;
  top: 30%;
  right: -40px;
  background: radial-gradient(circle at 40% 40%, #ffd7b0, transparent 70%);
  animation-delay: -8s;
}

@keyframes auth-float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
  100% {
    transform: translateY(0);
  }
}

.auth-side {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.auth-brand {
  display: block;
  height: 28px;
  width: auto;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 600;
  margin-bottom: 16px;
}

.auth-subtitle {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 32px;
}

.auth-metrics {
  display: flex;
  gap: 24px;
}

.auth-metric {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(24, 20, 243, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 140px;
  box-shadow: 0 6px 16px rgba(12, 20, 36, 0.06);
}

.auth-metric-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #0b1227;
}

.auth-metric-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(24, 20, 243, 0.08);
  box-shadow: 0 18px 40px rgba(12, 20, 36, 0.12);
  padding: 28px;
  animation: auth-rise 0.5s ease-out;
}

@keyframes auth-rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-card-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.auth-card-header p {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  display: block;
  margin-bottom: 8px;
}

.auth-field .form-input {
  background: #f5f7ff;
  border-color: #d9e1f7;
}

.auth-field .form-input:focus {
  background: #ffffff;
}

.auth-submit {
  margin-top: 8px;
  height: 44px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 12px;
}

.auth-forgot-link {
  text-align: right;
  margin-top: 16px;
  font-size: 13px;
}

.auth-errors {
  background: var(--color-secondary-token-red-light, #FFE0EB);
  color: var(--color-token-red, #FA3A55);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.auth-errors p {
  margin: 0;
}

.auth-errors p + p {
  margin-top: 4px;
}

.auth-footer-link {
  text-align: center;
  font-size: 14px;
  color: var(--color-mirage-70, #56596C);
  margin-top: 20px;
}

.invite-modal-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-color: var(--color-primary-light, #E6EAFF);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .auth-shell {
    padding: 40px 20px;
  }

  .auth-content {
    grid-template-columns: 1fr;
  }

  .auth-side {
    text-align: center;
    margin: 0 auto;
  }

  .auth-metrics {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Workflow badge */
.workflow-badge {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  border: 1px solid rgba(24, 20, 243, 0.1);
  border-radius: 24px;
  font-size: 13px;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 32px;
}

.workflow-badge strong {
  color: var(--color-blue, #1814F3);
  font-weight: 600;
}

/* Signed-in user chip */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: #f0f4ff;
  border: 1px solid #dfeaf2;
  color: #1a3eff;
  font-size: 12px;
  font-weight: 500;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #1814F3;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-email {
  color: #1a3eff;
}

@media (max-width: 640px) {
  .user-email {
    display: none;
  }
}

/* Goal cards */
.goal-cards-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.goal-cards-container form,
.goal-cards-container button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.goal-card {
  background-color: #ffffff;
  border-radius: 12px;
  border: none !important;
  outline: none !important;
  padding: 20px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.goal-card:hover {
  box-shadow: 0 8px 24px rgba(24, 20, 243, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.goal-card-custom {
  background-color: #fafafa;
}

/* Goal template text */
.goal-template-text {
  text-decoration: none !important;
}

.goal-icon-container {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   WORKFLOW BUILDER STYLES
   ========================================================================== */

/* Top toolbar */
.builder-toolbar {
  height: 56px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background-color: var(--color-link-water, #DFEAF2);
}

.builder-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--color-mirage-60, #6E7181);
  transition: all 0.2s ease;
  text-decoration: none;
}

.builder-back-btn:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

.builder-workflow-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-workflow-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0;
}

.builder-workflow-code {
  display: none;
}

.builder-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--color-mirage-05, #F3F3F5);
  border-radius: 8px;
  padding: 4px;
}

.builder-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-zoom-btn:hover {
  background-color: #ffffff;
  color: var(--color-mirage, #0D122D);
}

.builder-zoom-label {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  cursor: pointer;
  background: none;
  border: none;
}

.builder-zoom-label:hover {
  color: var(--color-mirage, #0D122D);
}

.builder-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-icon-btn:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

/* Left sidebar */
.builder-sidebar {
  width: 340px;
  background-color: #ffffff;
  border-right: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
}

.builder-sidebar.collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
}

/* Sidebar edge toggle - positioned relative to main content area */
.sidebar-edge-toggle {
  position: absolute;
  top: 50%;
  left: 328px;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: left 0.2s ease, background 0.2s ease;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar-edge-toggle:hover {
  background: #f3f4f6;
}

.sidebar-toggle-icon {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

/* Collapsed state */
.builder-sidebar.collapsed + .sidebar-edge-toggle {
  left: 0;
}

.builder-sidebar.collapsed + .sidebar-edge-toggle .sidebar-toggle-icon {
  transform: rotate(180deg);
}

/* Right Sidebar - Node Configuration */
.builder-right-sidebar {
  width: 340px;
  min-width: 340px;
  max-width: 340px;
  flex-shrink: 0;
  background-color: #ffffff;
  border-left: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  flex-direction: column;
  opacity: 1;
  overflow: hidden;
  transition: min-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease,
              border-color 0.3s ease;
}

.builder-right-sidebar.collapsed {
  min-width: 0;
  max-width: 0;
  opacity: 0;
  border-color: transparent;
  pointer-events: none;
}

/* Header - matches left sidebar tabs area */
.builder-right-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 14px 16px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  background-color: #ffffff;
  flex-shrink: 0;
}

.builder-right-sidebar-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.builder-right-sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--color-mirage-60, #6E7181);
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-right-sidebar-close:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

/* Node info card - matches left sidebar node items */
.builder-right-sidebar-node-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 12px 16px 0 16px;
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.builder-right-sidebar-node-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--node-vendor-color, var(--color-blue, #1814F3));
  border-radius: 10px 0 0 10px;
}

.builder-right-sidebar-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background-color: var(--color-blue-05, #F2F4FF);
  color: var(--color-blue, #1814F3);
}

.builder-right-sidebar-node-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-node-initials {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.builder-right-sidebar-node-info {
  flex: 1;
  min-width: 0;
}

.builder-right-sidebar-node-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-right-sidebar-node-type {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.builder-right-sidebar-node-type-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
  padding: 2px 6px;
  border-radius: 4px;
}

.builder-right-sidebar-node-desc {
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
}

.builder-right-sidebar-node-code {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-blue, #1814F3);
  background: var(--color-blue-05, #F2F4FF);
  padding: 1px 5px;
  border-radius: 4px;
}

.builder-right-sidebar-node-price {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-token-green, #00DF81);
  background: var(--color-secondary-token-green-light, #D9FAEC);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Form content area */
.builder-right-sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  box-sizing: border-box;
  max-width: 100%;
}

.builder-right-sidebar-content * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Empty state */
.builder-right-sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 13px;
  text-align: center;
}

/* Form section styling - matches left sidebar groups */
.builder-form-section {
  margin-bottom: 16px;
}

.builder-form-section:last-child {
  margin-bottom: 0;
}

.builder-form-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-30, #B6B8C0);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Form inputs - matches left sidebar search input */
.builder-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mirage-80, #3D4157);
  margin-bottom: 4px;
}

.builder-form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.builder-form-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-form-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236E7181'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

.builder-form-select:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
}

.builder-form-textarea::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-form-textarea:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-help {
  font-size: 11px;
  color: var(--color-mirage-60, #6E7181);
  margin-top: 3px;
  line-height: 1.4;
}

/* Info boxes in forms */
.builder-form-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: var(--color-blue-05, #F2F4FF);
  border: 1px solid var(--color-blue-30, #B3BFFF);
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-info svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-blue, #1814F3);
}

.builder-form-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-warning svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #D97706;
}

.builder-form-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: #ECFDF5;
  border: 1px solid #6EE7B7;
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-success svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #059669;
}

/* Form container */
.builder-form-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Tabs */
.builder-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-tab {
  flex: 1;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-tab:hover {
  color: var(--color-mirage, #0D122D);
}

.builder-tab-active {
  color: var(--color-blue, #1814F3);
  border-bottom-color: var(--color-blue, #1814F3);
}

/* Search */
.builder-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.builder-search-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-search-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

/* Node list */
.builder-node-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.builder-node-empty {
  color: var(--color-mirage-60, #6E7181);
  font-size: 13px;
  padding: 12px 8px;
  text-align: center;
}

.builder-tab-description {
  font-size: 12px;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 16px;
}

/* Node groups */
.builder-node-group {
  margin-bottom: 20px;
}

.builder-node-group:last-child {
  margin-bottom: 0;
}

.builder-node-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.builder-node-group-title:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.builder-group-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-group-title-text {
  flex: 1;
  text-align: left;
}

/* Collapsed state */
.builder-node-group[data-collapsed="true"] .builder-group-chevron {
  transform: rotate(-90deg);
}

.builder-node-group[data-collapsed="true"] .builder-node-items {
  display: none;
}

.builder-vendor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.builder-node-count {
  font-weight: 400;
  color: var(--color-mirage-30, #B6B8C0);
  margin-left: auto;
}

/* Node items */
.builder-node-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-node-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  cursor: grab;
  transition: all 0.2s ease;
  min-height: 44px;
  touch-action: none;
  position: relative;
  overflow: hidden;
}

.builder-node-item[data-tooltip] {
  overflow: visible;
}

.builder-node-vendor-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 10px 0 0 10px;
}

.builder-node-item:hover {
  border-color: var(--color-blue-30, #B3BFFF);
  box-shadow: 0 2px 8px rgba(24, 20, 243, 0.08);
}

.builder-node-item:active {
  cursor: grabbing;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 4px 12px rgba(24, 20, 243, 0.15);
}

.builder-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.builder-node-icon svg {
  width: 18px;
  height: 18px;
}

.builder-node-initials {
  font-size: 10px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* Vendor initials on canvas nodes */
.canvas-node-initials {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* Drag preview - minimal node representation */
.builder-drag-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.builder-drag-preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

.builder-drag-preview-icon svg {
  width: 16px;
  height: 16px;
  color: #374151;
}

.builder-drag-preview-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage, #0D122D);
  white-space: nowrap;
}

.builder-node-content {
  flex: 1;
  min-width: 0;
}

.builder-node-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage, #0D122D);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-node-desc {
  font-size: 11px;
  color: var(--color-mirage-60, #6E7181);
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-node-configurable-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.builder-node-api-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #005934;
  background-color: #D9FAEC;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  margin-left: 4px;
}

.builder-node-mock-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92640D;
  background-color: #FFF3D6;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  margin-left: 4px;
}

.builder-node-drag-handle {
  color: var(--color-mirage-30, #B6B8C0);
  flex-shrink: 0;
}

/* Node tooltip on hover */
.builder-node-item {
  position: relative;
}

.builder-node-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 12px;
  top: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0D122D;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  max-width: 240px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.1s ease-out, transform 0.1s ease-out, visibility 0.1s ease-out;
  z-index: 20;
  pointer-events: none;
}

.builder-node-item[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 100%;
  margin-top: 0;
  border: 6px solid transparent;
  border-bottom-color: #0D122D;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease-out, visibility 0.1s ease-out;
  z-index: 20;
  pointer-events: none;
}

.builder-node-item[data-tooltip]:hover::after,
.builder-node-item[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hide hover effects during drag operations */
.builder-sidebar-dragging .builder-node-item:hover {
  border-color: var(--color-link-water, #DFEAF2);
  box-shadow: none;
}

.builder-sidebar-dragging .builder-node-item[data-tooltip]::after,
.builder-sidebar-dragging .builder-node-item[data-tooltip]::before {
  opacity: 0;
  visibility: hidden;
}

.builder-node-drag-handle svg {
  width: 16px;
  height: 16px;
}

/* Canvas wrapper — positions the empty-state overlay relative to the canvas */
.builder-canvas-wrapper {
  flex: 1 1 0%;
  min-height: 0;
  position: relative;
}

/* Canvas area */
.builder-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: grab;
  background-color: var(--color-mirage-05, #F3F3F5);
  background-image: radial-gradient(var(--color-mirage-20, #CFD0D5) 1px, transparent 1px);
  background-size: 20px 20px;
}

.builder-canvas:active {
  cursor: grabbing;
}

/* Empty canvas state — centered in visible canvas area */
.builder-canvas-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}

.builder-canvas-empty.hidden {
  display: none;
}

.builder-canvas-empty-icon {
  width: 48px;
  height: 48px;
  color: var(--color-mirage-30);
  margin-bottom: 16px;
}

.builder-canvas-empty-heading {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-mirage-70);
  margin: 0 0 8px 0;
}

.builder-canvas-empty-subtext {
  font-size: 14px;
  color: var(--color-mirage-30);
  margin: 0;
}

/* Start node prompt — shown when canvas has nodes but no ApplicantSource */
.builder-start-prompt {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-blue-05);
  border: 1px solid var(--color-blue-30);
  border-radius: 8px;
  color: var(--color-mirage-80);
  font-size: 13px;
  font-weight: 500;
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.builder-start-prompt svg {
  color: var(--color-blue-70);
  flex-shrink: 0;
}

.builder-start-prompt.hidden {
  display: none;
}

/* START badge on ApplicantSource nodes */
.node-start-badge {
  position: absolute;
  top: -8px;
  left: 12px;
  padding: 0 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 16px;
  color: var(--color-blue-90, #1A3EFF);
  background: var(--color-blue-05, #F2F4FF);
  border: 1px solid var(--color-blue-30, #B3BFFF);
  border-radius: 10px;
  z-index: 2;
}

/* ==========================================================================
   CRITICAL: Drawflow container hierarchy must ALL fill the canvas

   After Drawflow.start(), the structure becomes:
   #drawflow.builder-canvas.parent-drawflow
     └── .drawflow (created by Drawflow - handles pan events)
           └── .precanvas (holds nodes, gets transformed)
   ========================================================================== */

/* The element we initialize Drawflow on - becomes .parent-drawflow */
#drawflow.parent-drawflow,
.builder-canvas.parent-drawflow {
  width: 100% !important;
  height: 100% !important;
  min-height: 400px;
  position: relative !important;
  overflow: hidden !important;
  display: block !important;
}

/* The main drawflow container - THIS handles pan/drag events */
#drawflow.parent-drawflow > .drawflow,
.parent-drawflow > .drawflow {
  width: 100% !important;
  height: 100% !important;
  min-height: inherit !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  cursor: grab !important;
  background: transparent !important;
  overflow: visible !important;
  transform-origin: 0 0 !important;
}

#drawflow.parent-drawflow > .drawflow:active,
.parent-drawflow > .drawflow:active {
  cursor: grabbing !important;
}

/* Drawflow v0.x uses `.drawflow` as the transform layer */

/* Nodes should have move cursor */
.drawflow .drawflow-node {
  cursor: move !important;
}

/* ==========================================================================
   WORKFLOW BUILDER - Drawflow node customizations
   ========================================================================== */

#drawflow .drawflow .drawflow-node {
  background: #ffffff !important;
  border: 1px solid var(--color-link-water, #DFEAF2) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  padding: 0 !important;
  min-width: 220px !important;
  width: auto !important;
  overflow: visible !important;
}

#drawflow .drawflow .drawflow-node:hover {
  border-color: var(--color-blue-30, #B3BFFF) !important;
  box-shadow: 0 4px 12px rgba(24, 20, 243, 0.08) !important;
}

#drawflow .drawflow .drawflow-node.selected {
  border-color: var(--color-blue, #1814F3) !important;
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.15) !important;
}

/* Multi-select: same visual ring as Drawflow's .selected */
#drawflow .drawflow .drawflow-node.multi-selected {
  border-color: var(--color-blue, #1814F3) !important;
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.15) !important;
}

.drawflow .drawflow-node.multi-selected .custom-node,
.drawflow .drawflow-node.multi-selected .base-node {
  border: 1px solid var(--color-blue-90, #1A3EFF) !important;
}

/* Lasso selection rectangle */
.lasso-selection-rect {
  position: fixed;
  border: 1.5px dashed var(--color-blue-70, #4D69FF);
  background: rgba(24, 20, 243, 0.06);
  pointer-events: none;
  z-index: 9999;
}

/* Position connection port containers to align with visible node edges */
#drawflow .drawflow .drawflow-node .inputs {
  position: absolute !important;
  left: 10px !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 10 !important;
}

#drawflow .drawflow .drawflow-node .outputs {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translate(50%, -50%) !important;
  z-index: 10 !important;
}

/* Invisible clickable connection points */
#drawflow .drawflow .drawflow-node .input,
#drawflow .drawflow .drawflow-node .output {
  width: 20px !important;
  height: 30px !important;
  background: transparent !important;
  border: none !important;
  cursor: crosshair !important;
}

/* Decision node: give more vertical room for 3 ports */
#drawflow .drawflow .drawflow-node.IfElse .output,
#drawflow .drawflow .drawflow-node.Condition .output,
#drawflow .drawflow .drawflow-node.Decision .output {
  height: 26px !important;
  margin: 2px 0 !important;
}

/* Decision node output port labels — 3 branches: Pass / Human Review / Fail */
#drawflow .drawflow .drawflow-node.IfElse .output_1::after,
#drawflow .drawflow .drawflow-node.IfElse .output_2::after,
#drawflow .drawflow .drawflow-node.IfElse .output_3::after,
#drawflow .drawflow .drawflow-node.Decision .output_1::after,
#drawflow .drawflow .drawflow-node.Decision .output_2::after,
#drawflow .drawflow .drawflow-node.Decision .output_3::after {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#drawflow .drawflow .drawflow-node.IfElse .output_1::after,
#drawflow .drawflow .drawflow-node.Decision .output_1::after {
  content: 'Pass';
  color: #00DF81;
}

#drawflow .drawflow .drawflow-node.IfElse .output_2::after,
#drawflow .drawflow .drawflow-node.Decision .output_2::after {
  content: 'Human Review';
  color: #FFBB38;
}

#drawflow .drawflow .drawflow-node.IfElse .output_3::after,
#drawflow .drawflow .drawflow-node.Decision .output_3::after {
  content: 'Reject';
  color: #FA3A55;
}

/* Connection lines - thicker for easier manipulation */
#drawflow .drawflow .connection .main-path {
  stroke: var(--color-mirage-30, #B6B8C0) !important;
  stroke-width: 3px !important;
  cursor: pointer !important;
  marker-end: url(#drawflow-arrow) !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  transition: stroke 140ms ease, stroke-width 140ms ease, opacity 140ms ease !important;
}

#drawflow .drawflow .connection:not(.connection--decision-pass):not(.connection--decision-human-review):not(.connection--decision-fail) .main-path:hover {
  stroke: var(--color-blue, #1814F3) !important;
  stroke-width: 4px !important;
}

/* Selected connection: thicker line so the user can tell their click landed.
   Clicking a connection sets Drawflow's connection_selected; pressing Delete
   or Backspace then removes it (handleGlobalKeydown in the controller). */
#drawflow .drawflow .connection.selected .main-path {
  stroke-width: 5px !important;
  filter: drop-shadow(0 0 4px rgba(26, 62, 255, 0.45));
}

/* Floating delete button shown at the midpoint of a connection on hover.
   Position is computed in JS from path.getPointAtLength(totalLength/2). */
#drawflow .connection-delete-btn {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  color: #FA3A55;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 2px 8px rgba(13, 18, 45, 0.14);
}

#drawflow .connection-delete-btn.is-visible {
  display: flex;
}

#drawflow .connection-delete-btn:hover {
  background: #FA3A55;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(250, 58, 85, 0.32);
}

#drawflow .connection-delete-btn svg {
  width: 12px;
  height: 12px;
  display: block;
}

/* Arrow head color on hover */
#drawflow .drawflow .connection:hover:not(.connection--decision-pass):not(.connection--decision-human-review):not(.connection--decision-fail) .main-path {
  marker-end: url(#drawflow-arrow-hover) !important;
}

/* Decision node branch colors: pass=green, human_review=yellow, fail=red */
#drawflow .drawflow .connection.connection--decision-pass .main-path {
  stroke: #00DF81 !important;
  marker-end: url(#drawflow-arrow-pass) !important;
}
#drawflow .drawflow .connection.connection--decision-human-review .main-path {
  stroke: #FFBB38 !important;
  marker-end: url(#drawflow-arrow-human-review) !important;
}
#drawflow .drawflow .connection.connection--decision-fail .main-path {
  stroke: #FA3A55 !important;
  marker-end: url(#drawflow-arrow-fail) !important;
}

/* Connection preview while composing an association */
#drawflow .drawflow .connection.connection--preview .main-path {
  stroke-width: 3px !important;
  stroke-dasharray: 8 6 !important;
  opacity: 0.92 !important;
  animation: drawflow-connection-preview 0.9s linear infinite;
}

#drawflow .drawflow .connection.connection--preview:not(.connection--decision-pass):not(.connection--decision-human-review):not(.connection--decision-fail) .main-path {
  stroke: #7B8193 !important;
  marker-end: url(#drawflow-arrow) !important;
}

#drawflow .drawflow .drawflow-node.connection-target--preview .base-node,
#drawflow .drawflow .drawflow-node.connection-target--preview .custom-node {
  box-shadow: 0 0 0 2px rgba(24, 20, 243, 0.16), 0 12px 26px rgba(24, 20, 243, 0.12) !important;
}

#drawflow .drawflow .drawflow-node.connection-target--preview::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 24px;
  border: 2px dashed rgba(24, 20, 243, 0.28);
  pointer-events: none;
}

@keyframes drawflow-connection-preview {
  from {
    stroke-dashoffset: 14;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* ==========================================================================
   DECISION MODAL
   Two-pane modal (Logic Builder + Preview) for configuring Decision nodes
   ========================================================================== */
.decision-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 18, 45, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.decision-modal-overlay.hidden { display: none; }

.decision-modal {
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 32px);
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(13, 18, 45, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.decision-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 22px 14px;
  border-bottom: 1px solid #DFEAF2;
  gap: 16px;
}
.decision-modal-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.decision-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.decision-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #F4E9FF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0029FF;
  flex-shrink: 0;
}
.decision-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #0D122D;
  margin: 0;
  line-height: 1.2;
}
.decision-modal-subtitle {
  font-size: 12px;
  color: #56596C;
  margin: 0;
  line-height: 1.4;
}
.decision-modal-close {
  background: transparent;
  border: none;
  color: #56596C;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.decision-modal-close:hover { background: #F3F3F5; color: #0D122D; }

.decision-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: minmax(0, 1fr);
  height: min(680px, calc(100vh - 140px));
  overflow: hidden;
}

.decision-modal-logic,
.decision-modal-preview {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.decision-modal-preview {
  background: linear-gradient(180deg, #F7F9FB 0%, #FFFFFF 100%);
  border-left: 1px solid #DFEAF2;
}

.decision-modal-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid #DFEAF2;
  flex-wrap: wrap;
}
.decision-modal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1.5px solid #DFEAF2;
  background: #FFFFFF;
  color: #56596C;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.decision-modal-tab:hover { border-color: #B6B8C0; color: #0D122D; }
.decision-modal-tab-active.decision-modal-tab-pass {
  border-color: #00DF81;
  background: rgba(0, 223, 129, 0.08);
  color: #0D122D;
}
.decision-modal-tab-active.decision-modal-tab-human-review {
  border-color: #FFBB38;
  background: rgba(255, 187, 56, 0.1);
  color: #0D122D;
}
.decision-modal-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.decision-modal-tab-label { white-space: nowrap; }
.decision-modal-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #0D122D;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
}
.decision-modal-tab-count-empty {
  background: #F3F3F5;
  color: #868896;
}
.decision-modal-fallback-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #FFF1F3;
  color: #FA3A55;
  font-size: 12px;
  font-weight: 600;
}

.decision-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

.decision-modal-preview-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.decision-modal-preview-canvas svg { width: 100%; height: 100%; max-height: 400px; }

.decision-preview-branch-hit { cursor: pointer; }
.decision-preview-branch-hit:hover rect { filter: brightness(0.97); }

.decision-modal-preview-label {
  padding: 12px 18px 0;
  font-size: 10px;
  font-weight: 700;
  color: #868896;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* decision-preview-path: no drop-shadow; flow animation handled by SVG packets */
.decision-preview-path { transition: stroke-width 0.15s ease; }

.decision-modal-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #F2F4FF;
  color: #3D4157;
  font-size: 12px;
  line-height: 1.4;
}
.decision-modal-hint svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #0029FF;
  margin-top: 1px;
}

/* ==========================================================================
   DECISION MODAL — SENTENCE-STYLE RULE BUILDER
   ========================================================================== */
.decision-rule-scope {
  border-radius: 10px;
  padding: 14px 16px 12px;
  margin: -6px -4px 0;
  transition: background 0.2s ease;
  box-sizing: border-box;
  max-width: 100%;
}
.decision-rule-scope-pass {
  background: rgba(0, 223, 129, 0.05);
  border: 1px solid rgba(0, 223, 129, 0.18);
}
.decision-rule-scope-human-review {
  background: rgba(255, 187, 56, 0.06);
  border: 1px solid rgba(255, 187, 56, 0.22);
}

.decision-rule-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(13, 18, 45, 0.04);
  color: #56596C;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  cursor: default;
}
.decision-rule-hint svg { color: #868896; }

.decision-rule-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: #3D4157;
  line-height: 1.4;
}
.decision-rule-branch-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.decision-rule-branch-chip-pass {
  background: rgba(0, 223, 129, 0.15);
  color: #007a45;
}
.decision-rule-branch-chip-human-review,
.decision-rule-branch-chip-human_review {
  background: rgba(255, 187, 56, 0.2);
  color: #9a6500;
}
.decision-rule-logic {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  overflow: visible;
  margin: 0;
}
.decision-rule-logic.hidden { display: none; }
.decision-rule-logic .decision-rule-logic-btn.ifelse-logic-btn {
  flex: 0 0 auto;
  padding: 3px 12px;
  border: none;
  background: transparent;
  color: #56596C;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-transform: lowercase;
  line-height: 1.4;
}
.decision-rule-logic .decision-rule-logic-btn.ifelse-logic-btn-active {
  background: #0D122D;
  color: #FFFFFF;
}
.decision-rule-logic .decision-rule-logic-btn.ifelse-logic-btn:hover {
  color: #0D122D;
}
.decision-rule-logic .decision-rule-logic-btn.ifelse-logic-btn-active:hover {
  color: #FFFFFF;
}

.decision-rule-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.decision-rule-row.ifelse-condition-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1.5fr) 28px;
  gap: 6px;
  align-items: center;
  padding: 8px;
  margin: 0;
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
/* When remove button is hidden (only 1 condition), collapse its column so Value fills the space */
.decision-rule-row.ifelse-condition-row:has(.decision-rule-remove[style*="display:none"]),
.decision-rule-row.ifelse-condition-row:has(.decision-rule-remove[style*="display: none"]) {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1.5fr) 0;
}
.decision-rule-row.ifelse-condition-row:focus-within {
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}
.decision-rule-row .decision-rule-cell {
  display: block;
  min-width: 0;
  max-width: 100%;
}
.decision-rule-row .builder-form-label { display: none; }
.decision-rule-row .decision-rule-cell > * {
  max-width: 100%;
  box-sizing: border-box;
}
.decision-rule-cell {
  min-width: 0;
}
.decision-rule-cell .ifelse-field-picker { margin: 0; }
.decision-rule-cell .ifelse-field-picker-input-wrap {
  border: 1px solid transparent;
  background: #F7F9FB;
  border-radius: 7px;
  min-height: 34px;
}
.decision-rule-cell .ifelse-field-picker-input-wrap:hover {
  background: #F3F3F5;
}
.decision-rule-cell .ifelse-field-picker-input {
  font-size: 13px;
  padding: 6px 10px;
  background: transparent;
}
.decision-rule-cell .builder-form-select {
  width: 100%;
  font-size: 13px;
}
.decision-rule-operator,
.decision-rule-value {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid transparent;
  background: #F7F9FB;
  border-radius: 7px;
  color: #0D122D;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.decision-rule-operator { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23868896' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 26px;
}
.decision-rule-operator:hover,
.decision-rule-value:hover {
  background: #F3F3F5;
}
.decision-rule-operator:focus,
.decision-rule-value:focus {
  outline: none;
  background: #FFFFFF;
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}
.decision-rule-remove {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #868896;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.decision-rule-remove:hover {
  background: #FFF1F3;
  color: #FA3A55;
}

.decision-rule-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 2px;
  background: transparent;
  border: none;
  color: #0029FF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
}
.decision-rule-add:hover {
  color: #0022cc;
  text-decoration: underline;
}

/* ---- Grouped conditions (AND between groups, OR/AND within a group) ---- */
.decision-groups-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.decision-group {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #DFEAF2;
  border-radius: 10px;
}

.decision-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 12px;
}

.decision-group-title {
  font-size: 11px;
  font-weight: 700;
  color: #56596C;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.decision-group-header-label {
  font-size: 12px;
  color: #56596C;
  font-weight: 500;
}

.decision-group-inner-logic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
}
.decision-group-inner-logic.hidden { display: none; }
.decision-group-inner-logic .decision-rule-logic-btn.ifelse-group-inner-logic-btn {
  flex: 0 0 auto;
  padding: 3px 10px;
  border: none;
  background: transparent;
  color: #56596C;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.4;
}
.decision-group-inner-logic .decision-rule-logic-btn.ifelse-group-inner-logic-btn.ifelse-logic-btn-active {
  background: #0D122D;
  color: #FFFFFF;
}
.decision-group-inner-logic .decision-rule-logic-btn.ifelse-group-inner-logic-btn:hover {
  color: #0D122D;
}
.decision-group-inner-logic .decision-rule-logic-btn.ifelse-group-inner-logic-btn.ifelse-logic-btn-active:hover {
  color: #FFFFFF;
}
.decision-group-inner-logic > .decision-group-header-label {
  padding: 0 4px;
}

.decision-group-remove {
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #868896;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.decision-group-remove:hover {
  background: #FFF1F3;
  color: #FA3A55;
}

/* Top-level AND/OR separator between groups */
.decision-group-top-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  margin: 2px 0;
  padding: 4px 0;
}
.decision-group-top-separator::before,
.decision-group-top-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  height: 1px;
  background: #DFEAF2;
  width: 38%;
}
.decision-group-top-separator::before { left: 0; }
.decision-group-top-separator::after { right: 0; }
.decision-group-top-separator .ifelse-group-top-logic-btn {
  position: relative;
  z-index: 1;
  padding: 5px 14px;
  border: 1px solid #DFEAF2;
  background: #FFFFFF;
  color: #0D122D;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.decision-group-top-separator .ifelse-group-top-logic-btn:first-of-type {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
  border-right: none;
}
.decision-group-top-separator .ifelse-group-top-logic-btn:last-of-type {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}
.decision-group-top-separator .ifelse-group-top-logic-btn.ifelse-logic-btn-active {
  background: #0D122D;
  color: #FFFFFF;
  border-color: #0D122D;
}
.decision-group-top-separator .ifelse-group-top-logic-btn:not(.ifelse-logic-btn-active):hover {
  color: #0D122D;
  background: #F7F9FB;
}

.decision-group-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 1px dashed #DFEAF2;
  color: #0029FF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  width: 100%;
}
.decision-group-add:hover {
  background: rgba(0, 41, 255, 0.04);
  border-color: #0029FF;
}

.decision-rule-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 16px;
  color: #868896;
  text-align: center;
  font-size: 13px;
}
.decision-rule-empty svg { color: #C4C6C8; }
.decision-rule-empty p { margin: 0; max-width: 320px; line-height: 1.4; }

.decision-rule-hint-subtle {
  /* no-op placeholder */
}

.decision-modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}
.decision-modal-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #DFEAF2;
  border-top-color: #0029FF;
  border-radius: 50%;
  animation: decision-modal-spin 0.8s linear infinite;
}
@keyframes decision-modal-spin { to { transform: rotate(360deg); } }
.decision-modal-error {
  padding: 14px;
  border-radius: 8px;
  background: #FFF1F3;
  color: #FA3A55;
  font-size: 13px;
}

@media (max-width: 768px) {
  .decision-modal-body {
    grid-template-columns: 1fr;
  }
  .decision-modal-preview {
    border-left: none;
    border-top: 1px solid #DFEAF2;
  }
}

/* Base node styling on canvas */
#drawflow .drawflow .base-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: none !important;
  width: 100%;
  box-sizing: border-box;
}

#drawflow .drawflow .base-node.border-amber-400 {
  background: #fffbeb;
}

#drawflow .drawflow .node-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

#drawflow .drawflow .node-icon-container svg {
  width: 20px;
  height: 20px;
}

/* Buttons */
.cursor-pointer { cursor: pointer; }
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }

/* Layout utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-full { width: 100%; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-2 { height: 0.5rem; }
.w-2 { width: 0.5rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-72 { width: 18rem; }
.w-80 { width: 20rem; }
.w-0 { width: 0; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-6 { padding-top: 1.5rem; }
.pl-2 { padding-left: 0.5rem; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-10 { margin-left: 2.5rem; }
.mr-3 { margin-right: 0.75rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }

.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-visible { overflow: visible; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-table { max-width: 1100px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.shrink-0 { flex-shrink: 0; }

.whitespace-nowrap { white-space: nowrap; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.tracking-wider { letter-spacing: 0.05em; }

.inline-flex { display: inline-flex; }
.divide-y > * + * { border-top-width: 1px; }
.divide-gray-200 > * + * { border-color: #e5e7eb; }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }

/* Hover states */
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-white:hover { background-color: #ffffff; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:text-blue-800:hover { color: #1e40af; }
.hover\:text-blue-900:hover { color: #1e3a8a; }
.hover\:text-red-900:hover { color: #7f1d1d; }
.hover\:border-gray-300:hover { border-color: #d1d5db; }
.hover\:shadow-sm:hover { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.no-underline { text-decoration: none; }
.hover\:underline:hover { text-decoration: underline; }

/* Ring utilities */
.ring-2 { box-shadow: 0 0 0 2px var(--tw-ring-color, currentColor); }
.ring-green-100 { --tw-ring-color: rgba(220, 252, 231, 1); }
.ring-amber-100 { --tw-ring-color: rgba(254, 243, 199, 1); }
.ring-blue-200 { --tw-ring-color: rgba(191, 219, 254, 1); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); }
.focus\:border-blue-500:focus { border-color: #3b82f6; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
}

@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Table styles */
table { border-collapse: collapse; }
th, td { padding: 0.75rem 1.5rem; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
  animation: toast-enter 0.3s ease-out;
  max-width: 380px;
}

.toast-success {
  background-color: #10B981;
  color: white;
}

.toast-error {
  background-color: #EF4444;
  color: white;
}

.toast-warning {
  background-color: #F59E0B;
  color: white;
}

.toast-info {
  background-color: var(--color-blue, #1814F3);
  color: white;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.toast-dismiss:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.toast-exit {
  animation: toast-exit 0.3s ease-in forwards;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ==========================================================================
   DEMO EXECUTION STYLES
   n8n-style workflow execution visualization
   ========================================================================== */

/* Demo button in toolbar */
.btn-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  height: 38px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-demo:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-demo svg {
  width: 16px;
  height: 16px;
}

.btn-demo-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  height: 38px;
  background: var(--color-mirage-05, #F3F3F5);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 13px;
  font-weight: 500;
  cursor: default;
}

.btn-demo-disabled svg {
  width: 16px;
  height: 16px;
}

.btn-demo-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 38px;
  margin-left: 8px;
}

.btn-demo-dropdown-toggle:hover {
  background: #e5e7eb;
}

.btn-demo-dropdown-toggle svg {
  width: 14px;
  height: 14px;
  color: #6b7280;
}

/* Info icon with tooltip */
.scenario-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #9ca3af;
  cursor: help;
  position: relative;
}

.scenario-info-icon:hover {
  color: #6b7280;
}

.scenario-info-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 8px 12px;
  background: #1f2937;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  pointer-events: none;
  width: 200px;
  text-align: left;
}

.scenario-info-icon[data-tooltip]::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  right: 4px;
  border: 6px solid transparent;
  border-bottom-color: #1f2937;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
}

.scenario-info-icon[data-tooltip]:hover::after,
.scenario-info-icon[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

.scenario-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 100;
  min-width: 120px;
}

.scenario-dropdown.hidden {
  display: none;
}

.scenario-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.scenario-option:hover {
  background: #f3f4f6;
}

.scenario-option:first-child {
  border-bottom: 1px solid #e5e7eb;
}

.btn-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-stop:hover {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-stop svg {
  width: 16px;
  height: 16px;
}

/* Demo Modal */
.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-modal.hidden {
  display: none;
}

.demo-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.demo-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 500px;
  margin: 20px;
  animation: modal-enter 0.3s ease-out;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.demo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.demo-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.demo-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-modal-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.demo-modal-body {
  padding: 24px;
}

.demo-modal-description {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 20px 0;
}

.demo-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  border-radius: 0 0 16px 16px;
}

/* Scenario options */
.demo-scenario-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.demo-scenario-option {
  cursor: pointer;
}

.demo-scenario-option input[type="radio"] {
  display: none;
}

.demo-scenario-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.demo-scenario-option input[type="radio"]:checked + .demo-scenario-card {
  border-color: var(--color-blue, #1814F3);
  background-color: #f8faff;
}

.demo-scenario-card:hover {
  border-color: #d1d5db;
}

.demo-scenario-icon {
  flex-shrink: 0;
}

.demo-scenario-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.demo-scenario-info p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.demo-scenario-result {
  font-weight: 600;
}

/* Speed control */
.demo-speed-control {
  display: flex;
  align-items: center;
  gap: 16px;
}

.demo-speed-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.demo-speed-options {
  display: flex;
  gap: 8px;
}

.demo-speed-option {
  cursor: pointer;
}

.demo-speed-option input[type="radio"] {
  display: none;
}

.demo-speed-option span {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.demo-speed-option input[type="radio"]:checked + span {
  background: var(--color-blue, #1814F3);
  color: #ffffff;
}

.demo-speed-option span:hover {
  background: #e5e7eb;
}

.demo-speed-option input[type="radio"]:checked + span:hover {
  background: var(--color-blue-90, #1A3EFF);
}

/* Progress Panel */
.demo-progress-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 340px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.demo-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
}

.demo-progress-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-progress-title h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.demo-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.demo-progress-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-progress-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-progress-list {
  padding: 16px 20px;
  max-height: 300px;
  overflow-y: auto;
}

.demo-progress-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.demo-progress-item:last-child {
  border-bottom: none;
}

.demo-progress-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-progress-dot {
  width: 8px;
  height: 8px;
  background: #d1d5db;
  border-radius: 50%;
}

.demo-progress-icon-pending .demo-progress-dot {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

.demo-progress-icon-running svg {
  animation: spin 1s linear infinite;
}

.demo-progress-info {
  flex: 1;
  min-width: 0;
}

.demo-progress-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
}

.demo-progress-status {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.demo-progress-status-success {
  color: #059669;
}

.demo-progress-status-running {
  color: #2563eb;
}

.demo-progress-status-skipped {
  color: #9ca3af;
}

.demo-progress-footer {
  padding: 12px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.demo-progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

/* Node states - targets the inner .base-node element */
/* RUNNING STATE - Blue glow with pulsing animation */
.demo-node-running .base-node {
  border: 2px solid #3b82f6 !important;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 4px 20px rgba(59, 130, 246, 0.3) !important;
  animation: node-running-glow 1.5s ease-in-out infinite;
}

/* SUCCESS STATE - Green with solid background */
.demo-node-success .base-node {
  border: 2px solid #10b981 !important;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 4px 12px rgba(16, 185, 129, 0.15) !important;
}

/* FAILED STATE - Red with strong visual feedback */
.demo-node-failed .base-node {
  border: 2px solid #ef4444 !important;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 4px 12px rgba(239, 68, 68, 0.15) !important;
}

/* PENDING STATE - Yellow/amber waiting indicator with clear "queued" appearance */
.demo-node-pending .base-node {
  border: 2px dashed #f59e0b !important;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15) !important;
  animation: node-pending-pulse 1.5s ease-in-out infinite;
  opacity: 0.85;
}

/* WAITING STATE - Orange with pulsing animation (for Wait nodes) */
.demo-node-waiting .base-node {
  border: 2px solid #f97316 !important;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 4px 20px rgba(249, 115, 22, 0.3) !important;
  animation: node-waiting-glow 1.5s ease-in-out infinite;
}

/* SKIPPED STATE - Grayed out */
.demo-node-skipped .base-node {
  opacity: 0.5;
  border: 1px dashed #9ca3af !important;
  background: #f9fafb !important;
}

/* Running state glow animation */
@keyframes node-running-glow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 4px 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.15), 0 4px 30px rgba(59, 130, 246, 0.4);
  }
}

/* Pending state pulse - more noticeable "waiting in queue" effect */
@keyframes node-pending-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
    opacity: 0.85;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.08);
    opacity: 0.7;
  }
}

/* Waiting state glow animation */
@keyframes node-waiting-glow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 4px 20px rgba(249, 115, 22, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(249, 115, 22, 0.15), 0 4px 30px rgba(249, 115, 22, 0.4);
  }
}

/* Waiting countdown overlay on node */
.demo-waiting-countdown {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
  z-index: 15;
  white-space: nowrap;
  animation: countdown-pop-in 0.3s ease-out;
}

@keyframes countdown-pop-in {
  0% {
    transform: translateX(-50%) scale(0);
    opacity: 0;
  }
  60% {
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

/* Status indicator on nodes - badge that appears at top-right */
.demo-status-indicator {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  border: 2px solid #ffffff;
  animation: badge-pop-in 0.3s ease-out;
}

@keyframes badge-pop-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.demo-status-indicator svg {
  width: 18px;
  height: 18px;
}

/* Running indicator - blue background with spinning icon */
.demo-status-running {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #3b82f6;
}

.demo-status-running svg {
  color: #ffffff !important;
  animation: status-spin 1s linear infinite;
}

/* Waiting indicator - orange background with spinning icon */
.demo-status-waiting {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-color: #f97316;
}

.demo-status-waiting svg {
  color: #ffffff !important;
  animation: status-spin 1s linear infinite;
}

@keyframes status-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Success indicator - green background with check */
.demo-status-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
}

.demo-status-success svg {
  color: #ffffff !important;
}

/* Failed indicator - red background */
.demo-status-failed {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #ef4444;
}

.demo-status-failed svg {
  color: #ffffff !important;
}

/* Pending indicator - amber background with subtle pulse */
.demo-status-pending {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #f59e0b;
  animation: status-pending-pulse 1.2s ease-in-out infinite;
}

.demo-status-pending svg {
  color: #ffffff !important;
}

@keyframes status-pending-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.9);
    opacity: 0.7;
  }
}

/* Skipped indicator - gray */
.demo-status-skipped {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.demo-status-skipped svg {
  color: #6b7280 !important;
}

/* Connection animation */
.demo-connection-active .main-path {
  stroke: #10b981 !important;
  stroke-width: 3px !important;
  animation: connection-flow 0.5s ease-out;
}

@keyframes connection-flow {
  0% {
    stroke-dasharray: 10, 10;
    stroke-dashoffset: 20;
  }
  100% {
    stroke-dasharray: 10, 10;
    stroke-dashoffset: 0;
  }
}

/* Live execution: marching-ants flow animation on edges while the upstream
   node has completed but the downstream hasn't started yet. Respects the
   per-branch colors applied to Decision edges. */
.connection.connection--flowing .main-path {
  stroke-width: 3.5px;
  stroke-dasharray: 8 6;
  animation: connection-flowing 1s linear infinite;
  filter: drop-shadow(0 0 4px currentColor);
}

.connection.connection--flowing.connection--decision-pass .main-path {
  stroke: #00DF81;
  color: rgba(0, 223, 129, 0.55);
}

.connection.connection--flowing.connection--decision-human-review .main-path {
  stroke: #FFBB38;
  color: rgba(255, 187, 56, 0.55);
}

.connection.connection--flowing.connection--decision-fail .main-path {
  stroke: #FA3A55;
  color: rgba(250, 58, 85, 0.55);
}

.connection.connection--flowing:not(.connection--decision-pass):not(.connection--decision-human-review):not(.connection--decision-fail) .main-path {
  stroke: #0029FF;
  color: rgba(0, 41, 255, 0.45);
}

@keyframes connection-flowing {
  from { stroke-dashoffset: 28; }
  to   { stroke-dashoffset: 0; }
}

/* Spin animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Completion Toast - replaces modal for better UX */
.demo-completion-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  max-width: 450px;
  animation: toast-slide-in 0.4s ease-out;
  pointer-events: auto;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.demo-toast-exit {
  animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.demo-toast-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
}

.demo-toast-failed {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #ffffff;
}

.demo-toast-notice {
  background: linear-gradient(135deg, var(--color-mirage) 0%, #1a2040 100%);
  color: #ffffff;
}
.demo-notice-links {
  margin-top: 8px;
}
.demo-notice-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.demo-notice-link-label {
  font-size: 12px;
  opacity: 0.85;
  flex: 1;
}
.demo-notice-btn {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  transition: background-color 0.15s;
}
.demo-notice-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.demo-toast-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-toast-icon svg {
  width: 24px;
  height: 24px;
}

.demo-toast-content {
  flex: 1;
  min-width: 0;
}

.demo-toast-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.demo-toast-subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.demo-toast-action {
  flex-shrink: 0;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-toast-action:hover {
  background: rgba(255, 255, 255, 0.3);
}

.demo-toast-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.demo-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Legacy completion modal - kept for backwards compatibility */
.demo-completion-content {
  text-align: center;
  padding: 40px 24px;
}

.demo-completion-icon {
  margin-bottom: 20px;
}

.demo-completion-icon svg {
  width: 64px;
  height: 64px;
}

.demo-completion-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px 0;
}

.demo-completion-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.demo-stat {
  text-align: center;
}

.demo-stat-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.demo-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

/* Inspector panel */
.demo-inspector-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 400px;
  max-height: 400px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  animation: slide-in-right 0.3s ease-out;
}

.demo-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1f2937;
  color: #ffffff;
}

.demo-inspector-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.demo-inspector-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-inspector-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-inspector-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
}

.demo-inspector-tab {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-inspector-tab:hover {
  color: #374151;
}

.demo-inspector-tab.active {
  color: var(--color-blue, #1814F3);
  border-bottom-color: var(--color-blue, #1814F3);
}

.demo-inspector-content {
  padding: 16px;
  max-height: 280px;
  overflow-y: auto;
  background: #1f2937;
}

.demo-inspector-content pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.demo-inspector-content code {
  color: #a5f3fc;
  font-family: 'Monaco', 'Menlo', monospace;
}

/* ==========================================================================
   WORKFLOW MODAL - Based on Figma design (node 58:3706)
   Two-step modal for creating workflows
   ========================================================================== */
.workflow-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: workflow-modal-fade-in 0.2s ease-out;
}

.workflow-modal-overlay.hidden {
  display: none;
}

@keyframes workflow-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.workflow-modal {
  background-color: white;
  border: 1px solid #dfeaf2;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  animation: workflow-modal-slide-in 0.25s ease-out;
}

@keyframes workflow-modal-slide-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modal Header */
.workflow-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #dfeaf2;
}

.workflow-modal-title-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.workflow-modal-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f7f9fb;
  border: 1px solid #f2f4ff;
  border-radius: 9px;
}

.workflow-modal-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-blue, #1814F3);
}

.workflow-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #0d122d;
  margin: 0;
  line-height: 22px;
}

.workflow-modal-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #6e7181;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.workflow-modal-close:hover {
  color: #0d122d;
  background-color: #f5f7fa;
}

/* Modal Body */
.workflow-modal-body {
  padding: 24px;
}

.workflow-modal-description {
  font-size: 16px;
  line-height: 24px;
  color: #252a42;
  margin: 0 0 15px 0;
}

.workflow-modal-hint {
  font-size: 14px;
  line-height: 20px;
  color: #868896;
  margin: 0;
}

/* Modal Footer */
.workflow-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  padding: 18px 24px;
  border-top: 1px solid #dfeaf2;
}

/* Step indicator */
.workflow-modal-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.workflow-modal-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #dfeaf2;
  transition: background-color 0.2s ease;
}

.workflow-modal-step.active {
  background-color: var(--color-blue, #1814F3);
}

/* Goal cards for step 2 */
.workflow-modal-goals {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
  overflow-y: auto;
}

.workflow-modal-goal {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  background-color: white;
  border: 1px solid #dfeaf2;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.workflow-modal-goal:hover {
  border-color: var(--color-blue-30, #B3BFFF);
  background-color: #fafbfc;
}

.workflow-modal-goal.selected {
  border-color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
}

.workflow-modal-goal-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.workflow-modal-goal-content {
  flex: 1;
  min-width: 0;
}

.workflow-modal-goal-name {
  font-size: 15px;
  font-weight: 600;
  color: #0d122d;
  margin: 0 0 4px 0;
}

.workflow-modal-goal-description {
  font-size: 13px;
  color: #6e7181;
  margin: 0;
  line-height: 18px;
}

.workflow-modal-goal-arrow {
  width: 20px;
  height: 20px;
  color: #b6b8c0;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.workflow-modal-goal:hover .workflow-modal-goal-arrow {
  color: var(--color-blue, #1814F3);
}

/* Form inside modal */
.workflow-modal-form .form-input {
  width: 100%;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - FORM FIELDS
   Standardized form field components with focus-within label color change
   ========================================================================== */
.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #56596C;
  transition: color 0.2s ease;
}

.form-field-group:focus-within .form-field-label {
  color: #0029FF;
}

.form-field-required {
  color: #FA3A55;
  margin-left: 2px;
}

.form-field-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 20px;
  color: #3D4157;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-field-input::placeholder {
  color: #868896;
}

.form-field-input:focus {
  outline: none;
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

.form-field-input-error {
  border-color: #FA3A55;
}

.form-field-input-error:focus {
  border-color: #FA3A55;
  box-shadow: 0 0 0 3px rgba(250, 58, 85, 0.1);
}

.form-field-select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 20px;
  color: #3D4157;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

/* Multi-line text input. Mirrors .form-field-input — the explicit
   font-family is what kills the browser-default monospace UA style
   that <textarea> inherits when no font is declared. */
.form-field-textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 20px;
  font-family: inherit;
  color: #3D4157;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  resize: vertical;
}

.form-field-textarea::placeholder {
  color: #868896;
}

.form-field-textarea:focus {
  outline: none;
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

/* AA draft panel: 2-col PDF preview + form on wide viewports, single
   column on narrow. Set inline by the partial because Tailwind's
   lg: variants aren't reliably compiled in this project. */
@media (max-width: 960px) {
  .aa-draft-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Principal-reasons scroll box: force a visible scrollbar so PMs can
   tell the list is scrollable. macOS Safari/Chrome hide scrollbars by
   default when overflow:auto is used; setting overflow-y: scroll on
   the element plus the explicit ::-webkit-scrollbar rules below
   guarantees the track + thumb render at all times. */
.aa-reasons-scroll {
  scrollbar-width: thin;
  scrollbar-color: #C4C6C8 #F3F3F5;
}
.aa-reasons-scroll::-webkit-scrollbar {
  width: 10px;
}
.aa-reasons-scroll::-webkit-scrollbar-track {
  background: #F3F3F5;
  border-radius: 0 6px 6px 0;
}
.aa-reasons-scroll::-webkit-scrollbar-thumb {
  background: #C4C6C8;
  border-radius: 5px;
  border: 2px solid #F3F3F5;
}
.aa-reasons-scroll::-webkit-scrollbar-thumb:hover {
  background: #868896;
}

.form-field-select:focus {
  outline: none;
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

.form-field-helper {
  font-size: 12px;
  color: #868896;
  margin-top: 4px;
}

.form-field-error-msg {
  font-size: 12px;
  color: #FA3A55;
  margin-top: 4px;
}

.form-field-input--error {
  border-color: var(--color-token-red);
}

.form-field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-field-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0029FF;
  cursor: pointer;
}

.form-field-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-field-radio input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #0029FF;
  cursor: pointer;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #0D122D;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #DFEAF2;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #DFEAF2;
}

.form-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  background-color: #0029FF;
  border: 1px solid #0029FF;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-submit-btn:hover {
  background-color: #001fcf;
  border-color: #001fcf;
}

.form-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 9px;
  color: #56596C;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.form-cancel-btn:hover {
  background-color: #F7F9FB;
  border-color: #B6B8C0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - STATUS PILLS
   Status indicator badges with colored dots
   ========================================================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.status-pill-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill-green {
  background-color: #D9FAEC;
  color: #005934;
}

.status-pill-green .status-pill-dot {
  background-color: #00DF81;
}

.status-pill-red {
  background-color: #FFE0EB;
  color: #641722;
}

.status-pill-red .status-pill-dot {
  background-color: #FA3A55;
}

.status-pill-yellow {
  background-color: #FFF5D9;
  color: #664B16;
}

.status-pill-yellow .status-pill-dot {
  background-color: #FFBB38;
}

.status-pill-info {
  background-color: var(--color-primary-light, #E6EAFF);
  color: var(--color-primary, #0029FF);
}

.status-pill-info .status-pill-dot {
  background-color: var(--color-primary, #0029FF);
}

.status-pill-gray {
  background-color: #F3F3F5;
  color: #56596C;
}

.status-pill-gray .status-pill-dot {
  background-color: #9EA0AB;
}

.status-pill-blue {
  background-color: #E5F9FF;
  color: #004D66;
}

.status-pill-blue .status-pill-dot {
  background-color: #00C1FF;
}

.status-pill-purple {
  background-color: #F4E9FF;
  color: #3A1466;
}

.status-pill-purple .status-pill-dot {
  background-color: #9233FE;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - DANGER BUTTONS
   Destructive action buttons
   ========================================================================== */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #FA3A55;
  border: 1px solid #FA3A55;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-danger:hover {
  background-color: #C82E44;
  border-color: #C82E44;
}

.btn-danger:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 58, 85, 0.3);
}

.btn-danger svg {
  color: #ffffff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #ffffff;
  border: 1px solid #FA3A55;
  border-radius: 9px;
  color: #FA3A55;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-danger-outline:hover {
  background-color: #FFF5F6;
}

.btn-danger-outline:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 58, 85, 0.3);
}

.btn-danger-outline svg {
  color: #FA3A55;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- btn-xs: compact button size modifier ---------- */
.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 16px;
  border-radius: 6px;
  gap: 4px;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - ALERT BANNERS
   Contextual alert/notification banners
   ========================================================================== */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 9px;
  border: 1px solid;
}

.alert-banner-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-banner-content {
  flex: 1;
  min-width: 0;
}

.alert-banner-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert-banner-message {
  font-size: 14px;
  line-height: 1.5;
}

.alert-info {
  background-color: #E5F9FF;
  border-color: #00C1FF;
  color: #004D66;
}

.alert-info .alert-banner-icon {
  color: #00C1FF;
}

.alert-success {
  background-color: #D9FAEC;
  border-color: #00DF81;
  color: #005934;
}

.alert-success .alert-banner-icon {
  color: #00DF81;
}

.alert-warning {
  background-color: #FFF5D9;
  border-color: #FFBB38;
  color: #664B16;
}

.alert-warning .alert-banner-icon {
  color: #FFBB38;
}

.alert-error {
  background-color: #FFE0EB;
  border-color: #FA3A55;
  color: #641722;
}

.alert-error .alert-banner-icon {
  color: #FA3A55;
}

/* ==========================================================================
   PM screening request — outcome banner
   Wider, multi-state header used on the screening-request detail page.
   Layout differs from .alert-banner (left-aligned circular icon avatar +
   title/blurb stack), so it gets its own class family rather than reusing
   alert-* directly. Color triplets are intentionally desaturated relative
   to the design-system tokens so the banner doesn't compete with the
   primary CTA in the rail.
   ========================================================================== */
.outcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid;
}

.outcome-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.outcome-banner-title {
  font-size: 16px;
  font-weight: 600;
}

.outcome-banner-blurb {
  font-size: 13px;
}

.outcome-banner-pass    { background: #E6F9F1; border-color: #00DF81; color: #007A4A; }
.outcome-banner-review  { background: #FFF4DC; border-color: #FFBB38; color: #8A5A00; }
.outcome-banner-fail    { background: #FFE6EA; border-color: #FA3A55; color: #8A1027; }
.outcome-banner-running { background: #E6F4FF; border-color: #00C1FF; color: #005C7A; }
.outcome-banner-neutral { background: #F3F3F5; border-color: #C4C6C8; color: #56596C; }

.outcome-banner-pass    .outcome-banner-icon { background: #00DF81; }
.outcome-banner-review  .outcome-banner-icon { background: #FFBB38; }
.outcome-banner-fail    .outcome-banner-icon { background: #FA3A55; }
.outcome-banner-running .outcome-banner-icon { background: #00C1FF; }
.outcome-banner-neutral .outcome-banner-icon { background: #C4C6C8; }

/* ==========================================================================
   MOTION DESIGN SYSTEM - LINKS
   Styled link variants
   ========================================================================== */
.link-default {
  color: #0029FF;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-default:hover {
  color: #001899;
  text-decoration: underline;
}

.link-muted {
  color: #56596C;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-muted:hover {
  color: #3D4157;
  text-decoration: underline;
}

.link-danger {
  color: #FA3A55;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-danger:hover {
  color: #C82E44;
  text-decoration: underline;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - AVATARS
   User avatar components
   ========================================================================== */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #F2F4FF;
  color: #0029FF;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.avatar-status-online {
  background-color: #00DF81;
}

.avatar-status-offline {
  background-color: #9EA0AB;
}

.avatar-status-busy {
  background-color: #FA3A55;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - DIVIDERS
   Horizontal divider lines
   ========================================================================== */
.divider {
  border: none;
  border-top: 1px solid #DFEAF2;
  margin: 16px 0;
}

.divider-sm {
  margin: 8px 0;
}

.divider-lg {
  margin: 24px 0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - ACTION DROPDOWNS
   Dropdown menus for table row actions
   ========================================================================== */
.action-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  padding: 6px;
  z-index: 40;
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #3D4157;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.action-dropdown-item:hover {
  background-color: #F7F9FB;
}

.action-dropdown-item svg {
  width: 18px;
  height: 18px;
  color: #56596C;
}

.action-dropdown-item-danger {
  color: #FA3A55;
}

.action-dropdown-item-danger:hover {
  background-color: #FFF5F6;
}

.action-dropdown-item-danger svg {
  color: #FA3A55;
}

.action-dropdown-divider {
  border-top: 1px solid #DFEAF2;
  margin: 6px 0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - INPUT GROUPS
   Input with prefix/suffix elements
   ========================================================================== */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group-prefix,
.input-group-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background-color: #F7F9FB;
  border: 1px solid #DFEAF2;
  color: #56596C;
  font-size: 14px;
}

.input-group-prefix {
  border-right: none;
  border-radius: 6px 0 0 6px;
}

.input-group-suffix {
  border-left: none;
  border-radius: 0 6px 6px 0;
}

.input-group .form-field-input {
  border-radius: 0;
}

.input-group .form-field-input:first-child {
  border-radius: 6px 0 0 6px;
}

.input-group .form-field-input:last-child {
  border-radius: 0 6px 6px 0;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - CARDS
   Card container styling
   ========================================================================== */
.ds-card {
  background: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 9px;
  padding: 24px;
}

.ds-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #DFEAF2;
}

.ds-card-title {
  font-size: 18px;
  font-weight: 600;
  color: #0D122D;
}

/* ==========================================================================
   MOTION DESIGN SYSTEM - EMPTY STATES
   Empty state containers for pages with no content
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 200px);
}

.empty-state-filtered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-filtered-icon {
  width: 32px;
  height: 32px;
  color: var(--color-mirage-30);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  background-color: #F2F4FF;
}

.empty-state-icon svg {
  width: 40px;
  height: 40px;
  color: #0029FF;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  color: #0D122D;
  margin-bottom: 8px;
}

.empty-state-description {
  font-size: 14px;
  color: #868896;
  max-width: 24rem;
  margin-bottom: 32px;
}

/* Table container minimum height */
.table-container {
  min-height: 400px;
}

/* Stat badges/pills */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 20px;
  border-radius: 9999px;
  font-size: 14px;
}

.stat-pill-green {
  background-color: #D9FAEC;
  color: #00DF81;
}

.stat-pill-red {
  background-color: #FFE0EB;
  color: #FA3A55;
}

.stat-pill-gray {
  background-color: #F3F3F5;
  color: #56596C;
}

.stat-pill-yellow {
  background-color: #FFF4DB;
  color: #B07A00;
}

/* ==========================================================================
   SINGLE-APPLICANT PAGE
   Layout-only styles for the single-applicant screening form and results.
   Colors use DS variables; components reuse DS classes (ds-card, form-field-*,
   alert-banner, status-pill, divider, btn-*).
   ========================================================================== */

.sa-page {
  min-height: calc(100vh - 64px);
}

.sa-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.sa-header { margin-bottom: 24px; }

.sa-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sa-mode-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 4px;
}

.sa-mode-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sa-mode-hint {
  font-size: 11px;
  color: var(--color-mirage-30, #B6B8C0);
  margin: 0;
}

.sa-mode-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

.sa-mode-badge-test {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage-60, #6E7181);
}

.sa-mode-badge-live {
  background-color: rgba(0, 223, 129, 0.12);
  color: #00a85e;
}

.sa-mode-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage-30, #B6B8C0);
  transition: color 0.2s ease;
  user-select: none;
}

.sa-mode-label-active {
  color: var(--color-mirage-80, #3D4157);
}

.sa-mode-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background-color: var(--color-mirage-10, #E8E8EC);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 0;
}

.sa-mode-switch.sa-mode-live {
  background-color: var(--color-token-green, #00DF81);
}

.sa-mode-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.sa-mode-switch.sa-mode-live .sa-mode-switch-thumb {
  transform: translateX(18px);
}

/* Reusable toggle switch */
.toggle-switch,
.toggle-switch button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.toggle-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  background-color: var(--color-mirage-10, #E8E8EC);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.toggle-switch-track.active {
  background-color: var(--color-token-green, #00DF81);
}

.toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.toggle-switch-track.active .toggle-switch-thumb {
  transform: translateX(18px);
}

.sa-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-mirage);
}

.sa-subtitle {
  font-size: 14px;
  color: var(--color-mirage-60);
  margin-top: 4px;
}

.sa-card { margin-bottom: 20px; }

.sa-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.sa-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--color-blue-05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sa-card-icon-svg {
  width: 20px;
  height: 20px;
  color: var(--color-blue);
}

.sa-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-mirage);
}

.sa-card-desc {
  font-size: 13px;
  color: var(--color-mirage-60);
  margin-top: 2px;
}

.sa-section-divider {
  border-top: 1px solid var(--color-link-water);
  margin: 24px 0;
}

.sa-node-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage);
}

/* Form grid — 2 columns */
.sa-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sa-col-span-2 { grid-column: span 2; }

@media (max-width: 640px) {
  .sa-form-grid { grid-template-columns: 1fr; }
  .sa-col-span-2 { grid-column: span 1; }
}

/* Workflow search + count bar */
.sa-workflow-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sa-workflow-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--color-link-water);
  border-radius: 9px;
  padding: 0 12px;
  height: 36px;
  flex: 1;
  max-width: 280px;
  transition: border-color 0.15s ease;
}

.sa-workflow-search:focus-within {
  border-color: var(--color-blue);
}

.sa-workflow-search-icon {
  width: 16px;
  height: 16px;
  color: var(--color-mirage-60);
  flex-shrink: 0;
}

.sa-workflow-search-input {
  width: 100%;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-mirage-80);
  line-height: 20px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent;
}

.sa-workflow-search-input::placeholder {
  color: var(--color-mirage-60);
}

.sa-workflow-count {
  font-size: 13px;
  color: var(--color-mirage-60);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Scrollable workflow container */
.sa-workflow-scroll {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--color-link-water);
  border-radius: 9px;
  padding: 12px;
  background: var(--color-app-bg);
}

/* Workflow selector grid */
.sa-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* Empty search state */
.sa-workflow-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
}

.sa-workflow-empty-icon {
  width: 32px;
  height: 32px;
  color: var(--color-mirage-30);
}

/* Workflow selector cards — only custom styles that utilities can't cover */
.sa-workflow-card {
  border: 2px solid var(--color-link-water);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sa-workflow-card:hover {
  border-color: var(--color-blue-30);
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.06);
}

.sa-workflow-card--selected {
  border-color: var(--color-blue);
  background: var(--color-blue-05);
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.12);
}

/* Check icon — hidden by default, shown when selected */
.sa-workflow-check {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sa-workflow-card--selected .sa-workflow-check {
  opacity: 1;
}

/* Dim unselected cards when a selection has been made */
.sa-workflow-scroll--has-selection .sa-workflow-card:not(.sa-workflow-card--selected) {
  opacity: 0.45;
  filter: grayscale(0.2);
}

.sa-workflow-scroll--has-selection .sa-workflow-card:not(.sa-workflow-card--selected):hover {
  opacity: 0.8;
  filter: none;
}

.sa-product-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sa-workflow-card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water);
}

/* Submit area */
.sa-actions { display: flex; justify-content: flex-end; }

.sa-submit-btn { min-width: 260px; justify-content: center; }

/* ── Results view ─────────────────────────────────────────────────── */

.sa-results-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sa-results-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sa-elapsed {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage-60);
  font-variant-numeric: tabular-nums;
}

/* Node result cards */
.sa-node-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sa-node-card {
  background: var(--color-gray-05);
  border: 1px solid var(--color-link-water);
  border-radius: 8px;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.sa-node-card--pending  { opacity: 0.55; }
.sa-node-card--running  { border-color: var(--color-blue-30); box-shadow: 0 0 0 2px rgba(0, 41, 255, 0.08); opacity: 1; }
.sa-node-card--waiting  { border-color: var(--color-token-orange); opacity: 1; }
.sa-node-card--success  { border-color: var(--color-token-green); opacity: 1; }
.sa-node-card--failed   { border-color: var(--color-token-red); opacity: 1; }
.sa-node-card--skipped  { opacity: 0.45; }

/* Collapsed skipped summary row */
.sa-skipped-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--color-mirage-60);
  background: var(--color-gray-05);
  border: 1px solid var(--color-link-water);
  border-radius: 8px;
  opacity: 0.55;
}

.sa-skipped-summary svg { flex-shrink: 0; color: var(--color-mirage-30); }

.sa-node-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.sa-node-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sa-node-card-status-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sa-node-card--pending .sa-node-card-status-icon { color: var(--color-mirage-30); }
.sa-node-card--running .sa-node-card-status-icon { color: var(--color-blue); }
.sa-node-card--waiting .sa-node-card-status-icon { color: var(--color-token-orange); }
.sa-node-card--success .sa-node-card-status-icon { color: var(--color-token-green); }
.sa-node-card--failed  .sa-node-card-status-icon { color: var(--color-token-red); }
.sa-node-card--skipped .sa-node-card-status-icon { color: var(--color-mirage-30); }

/* Expand/collapse toggle on cards with output */
.sa-node-card[data-expandable] .sa-node-card-header { cursor: pointer; }

.sa-node-card-toggle {
  display: flex;
  align-items: center;
  color: var(--color-mirage-30);
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.sa-node-card--collapsed .sa-node-card-toggle { transform: rotate(-90deg); }

.sa-node-card-status-text { font-size: 13px; font-weight: 500; color: var(--color-mirage-60); }
.sa-status-running { color: var(--color-blue); }
.sa-status-success { color: var(--color-token-green); }
.sa-status-failed  { color: var(--color-token-red); }
.sa-status-skipped { color: var(--color-mirage-30); }

/* Node type badges — uses DS status colors */
.sa-node-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.sa-type-product   { background: var(--color-blue-05);                        color: var(--color-blue); }
.sa-type-condition  { background: var(--color-secondary-token-yellow-light);   color: var(--color-catalina-blue); }
.sa-type-action     { background: var(--color-secondary-token-purple-light);   color: var(--color-token-purple); }
.sa-type-wait       { background: var(--color-secondary-token-orange-light);   color: var(--color-token-orange); }
.sa-type-goto       { background: var(--color-secondary-token-purple-light);   color: var(--color-token-purple); }
.sa-type-trigger    { background: var(--color-secondary-token-green-light);    color: var(--color-token-green); }
.sa-type-default    { background: var(--color-mirage-05);                      color: var(--color-mirage-60); }

/* Node output area */
.sa-node-card-output {
  border-top: 1px solid var(--color-link-water);
  padding: 14px 16px;
}

.sa-output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

@media (max-width: 640px) {
  .sa-output-grid { grid-template-columns: 1fr; }
}

.sa-output-item { display: flex; flex-direction: column; gap: 2px; }

.sa-output-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-mirage-60);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sa-output-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mirage);
  word-break: break-word;
}

.sa-output-toggle {
  display: block;
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-blue);
}

.sa-score-factors {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water);
}
.sa-score-factors-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-mirage-70);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.sa-score-factors-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sa-score-factors-list li {
  font-size: 13px;
  color: var(--color-mirage-80);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}
.sa-score-factors-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-mirage-30, #C4C6C8);
}
.sa-score-factor-code {
  font-weight: 600;
  color: var(--color-mirage);
}

.sa-notice-links {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water);
}
.sa-notice-links-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-mirage-70);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.sa-notice-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.sa-notice-link-label {
  font-size: 13px;
  color: var(--color-mirage-80);
}
.sa-notice-link-actions {
  display: flex;
  gap: 8px;
}
.sa-notice-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-blue);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.15s;
}
.sa-notice-btn:hover {
  background-color: var(--color-primary-light);
}

.sa-node-error { font-size: 13px; color: var(--color-token-red); }

/* Utilities */
.sa-icon-sm { width: 20px; height: 20px; }

@keyframes sa-spin { to { transform: rotate(360deg); } }
.sa-spin { animation: sa-spin 1s linear infinite; }

/* Confirm delete dialog */
.confirm-delete-dialog { max-width: 420px; width: 100%; }

.confirm-delete-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background-color: var(--color-secondary-token-red-light, #FFE0EB);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-token-red, #FA3A55);
}

.confirm-delete-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* CSV Upload Modal */
.csv-upload-modal {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  animation: workflow-modal-slide-in 0.25s ease-out;
}

.csv-upload-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px 10px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  flex-shrink: 0;
}

.csv-upload-modal-header > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.csv-upload-modal-header h3,
.csv-upload-modal-header p {
  margin: 0;
}

.csv-upload-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-mirage-70, #56596C);
  border-radius: 6px;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.csv-upload-modal-close:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.csv-upload-modal-body {
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.csv-upload-modal-state {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.csv-upload-modal-state-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.csv-upload-modal-preview-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.csv-upload-modal-file-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.csv-upload-modal-table-panel {
  flex: 1;
  min-height: 180px;
  overflow: auto;
}

.csv-upload-modal-status-list {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
}

.csv-upload-modal-footer {
  flex-shrink: 0;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-link-water, #DFEAF2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, #ffffff 18px);
}

.csv-upload-modal-progress-content {
  gap: 10px;
}

.csv-upload-modal-progress-header,
.csv-upload-modal-progress-bar-block {
  margin: 0;
}

.csv-upload-modal-progress-header h5 {
  margin: 0;
}

.csv-upload-modal-progress-search {
  margin-bottom: 0;
}

.csv-upload-modal-progress-state {
  margin-top: -4px;
}

.csv-upload-modal-progress-footer {
  margin-top: 8px;
  padding-top: 10px;
}

.batch-export-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.batch-export-step-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.batch-export-step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.batch-export-step-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
}

.batch-export-step-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
}

.batch-export-step-list {
  flex: 1;
  min-height: 240px;
  overflow-y: auto;
}

.batch-export-step-footer {
  flex-shrink: 0;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-form-container .batch-export-step-list {
  max-height: 360px;
}

/* ── Single-Applicant Modal ─────────────────────────────── */

.single-applicant-modal {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  width: 900px;
  max-width: calc(100vw - 48px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: workflow-modal-slide-in 0.25s ease-out;
}

.sa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  flex-shrink: 0;
}

.sa-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-mirage-70, #56596C);
  cursor: pointer;
  transition: background 0.15s ease;
}

.sa-modal-close:hover {
  background: var(--color-mirage-05, #F3F3F5);
}

.sa-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sa-modal-mode-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* Override sa-container sizing for modal context */
.sa-modal-body .sa-container {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Reduce workflow scroll height in modal */
.sa-modal-body .sa-workflow-scroll {
  max-height: 220px;
}

/* Results header in modal */
.sa-modal-body .sa-results-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

/* ==========================================================================
   PRODUCT INFO DIALOG (sidebar "i" button)
   ========================================================================== */

/* Info button on sidebar node items — top-right corner */
.builder-node-info-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.builder-node-item:hover .builder-node-info-btn {
  opacity: 1;
}

.builder-node-info-btn:hover {
  color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
}

/* Product info dialog */
.product-info-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 640px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.product-info-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  z-index: 1;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.product-info-close-btn:hover {
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
}

.product-info-body {
  padding: 44px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-mirage-20, #CFD0D5) transparent;
}

.product-info-body::-webkit-scrollbar {
  width: 6px;
}

.product-info-body::-webkit-scrollbar-track {
  background: transparent;
}

.product-info-body::-webkit-scrollbar-thumb {
  background-color: var(--color-mirage-20, #CFD0D5);
  border-radius: 3px;
}

.product-info-body::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-mirage-30, #B6B8C0);
}

.product-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 28px;
}

.product-info-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.product-info-name {
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
  color: var(--color-mirage, #0D122D);
  margin: 0;
}

.product-info-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.product-info-price {
  font-family: Inter, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-mirage, #0D122D);
  white-space: nowrap;
}

.product-info-price-unit {
  font-weight: 400;
  font-size: 12px;
  color: var(--color-mirage-60, #6E7181);
}

.product-info-description {
  font-family: Inter, sans-serif;
  font-size: 13px;
  line-height: 20px;
  color: var(--color-mirage-60, #6E7181);
  margin: 0;
}

.product-info-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Limitations spans full width */
.product-info-sections .explore-detail-section--limitations {
  grid-column: 1 / -1;
}

/* Sections align to top so shorter columns don't stretch */
.product-info-sections .explore-detail-section {
  align-self: start;
}

/* Override justified text in dialog — left-align reads better at this width */
.product-info-sections .explore-detail-text,
.product-info-sections .explore-use-cases li {
  text-align: left;
}

.product-info-cta {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.product-info-loading {
  text-align: center;
  padding: 32px 16px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  color: var(--color-mirage-60, #6E7181);
}

/* ==========================================================================
   BILLING PRODUCT FORM - Tab navigation
   ========================================================================== */
.bp-tab-nav {
  display: flex;
  border-bottom: 2px solid var(--color-link-water, #DFEAF2);
  margin-bottom: 16px;
  position: sticky;
  top: -16px;
  margin-top: -16px;
  padding-top: 16px;
  background: white;
  z-index: 2;
}

.bp-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bp-tab:hover {
  color: var(--color-mirage, #0D122D);
}

.bp-tab.bp-tab-active {
  color: var(--color-primary, #0029FF);
  border-bottom-color: var(--color-primary, #0029FF);
}

.bp-tab-panel {
  display: none;
}

.bp-tab-panel.bp-tab-panel-active {
  display: block;
}

/* ---------- Output tab field list ---------- */
.bp-output-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bp-output-group-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-70, #56596C);
  margin-bottom: 4px;
}

.bp-output-group-body {
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 8px;
  padding: 2px 0;
}

.bp-output-field-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px 12px;
}

.bp-output-field-row + .bp-output-field-row {
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

.bp-output-field-label {
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.bp-output-enum-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.bp-output-enum-pill {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  background: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  padding: 0 5px;
  border-radius: 3px;
  line-height: 18px;
}

/* ---------- If/Else multi-condition ---------- */
.ifelse-logic-toggle {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-link-water, #DFEAF2);
  margin-bottom: 10px;
}

.ifelse-logic-toggle.hidden {
  display: none;
}

.ifelse-logic-btn {
  flex: 1;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  background: var(--color-mirage-05, #F3F3F5);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ifelse-logic-btn:hover {
  color: var(--color-mirage, #0D122D);
}

.ifelse-logic-btn-active {
  background: var(--color-primary, #0029FF);
  color: white;
}

.ifelse-logic-btn-active:hover {
  color: white;
}

.ifelse-condition-row {
  position: relative;
  padding: 12px;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ifelse-condition-row .builder-form-label {
  font-size: 14px;
  font-weight: 500;
  color: #56596C;
  margin-bottom: 4px;
}

.ifelse-condition-row .builder-form-input,
.ifelse-condition-row .builder-form-select {
  padding: 10px 12px;
  font-size: 14px;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
}

.ifelse-condition-row .builder-form-input:focus,
.ifelse-condition-row .builder-form-select:focus {
  border-color: #0029FF;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
}

.ifelse-condition-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #868896;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ifelse-condition-remove:hover {
  color: #FA3A55;
  background: rgba(250, 58, 85, 0.08);
}

.ifelse-condition-remove:hover {
  color: var(--color-token-red, #FA3A55);
  background: rgba(250, 58, 85, 0.08);
}

.ifelse-add-condition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary, #0029FF);
  background: none;
  border: 1px dashed var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ifelse-add-condition:hover {
  border-color: var(--color-primary, #0029FF);
  background: var(--color-primary-light, #E6EAFF);
}

.ifelse-add-condition-icon {
  width: 14px;
  height: 14px;
}

/* Searchable field picker (combobox) */
.ifelse-field-picker {
  position: relative;
}

.ifelse-field-picker-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 0;
  background-color: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ifelse-field-picker-input-wrap:hover {
  border-color: #0029FF;
}

.ifelse-field-picker-open {
  border-color: #0029FF;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.1);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

input.ifelse-field-picker-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 14px;
  background: transparent;
  cursor: pointer;
  color: #3D4157;
  min-width: 0;
  box-shadow: none;
  border-radius: 0;
}

input.ifelse-field-picker-input:focus {
  border: none;
  box-shadow: none;
}

.ifelse-field-picker-open .ifelse-field-picker-input {
  cursor: text;
}

.ifelse-field-picker-input::placeholder {
  color: var(--color-muted, #868896);
}

.ifelse-field-picker-chevron {
  width: 16px;
  height: 16px;
  color: var(--color-mirage-60, #6E7181);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.ifelse-field-picker-open .ifelse-field-picker-chevron {
  transform: rotate(180deg);
}

.ifelse-field-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: white;
  border: 1px solid #0029FF;
  border-top: none;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.ifelse-field-picker-dropdown.hidden {
  display: none;
}

.ifelse-field-picker-options {
  max-height: 240px;
  overflow-y: auto;
}

/* Inside the Decision modal, the dropdown gets clipped by .decision-modal overflow:hidden.
   Cap it tighter so it fits within the modal viewport, and always show the scrollbar
   so users know there are more options below the fold. */
.decision-modal .ifelse-field-picker-dropdown {
  overflow: visible;
}
/* macOS hides overlay scrollbars — keep max-height generous so common field lists fit.
   When they don't (e.g., upstream Product with many fields), force a native scrollbar. */
.decision-modal .ifelse-field-picker-options {
  max-height: 400px;
  overflow-y: auto;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  scrollbar-width: thin;
  scrollbar-color: #868896 #F3F3F5;
}
.decision-modal .ifelse-field-picker-options::-webkit-scrollbar {
  width: 8px;
  -webkit-appearance: none;
}
.decision-modal .ifelse-field-picker-options::-webkit-scrollbar-track {
  background: #F3F3F5;
}
.decision-modal .ifelse-field-picker-options::-webkit-scrollbar-thumb {
  background: #C4C6C8;
  border-radius: 4px;
}
/* Add a subtle fade at the bottom when content does overflow, as a universal scroll cue */
.decision-modal .ifelse-field-picker-dropdown {
  position: absolute;
}
.decision-modal .ifelse-field-picker-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 8px;
  bottom: 0;
  height: 22px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92));
  pointer-events: none;
  border-bottom-left-radius: 6px;
}

.ifelse-field-picker-group-label {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-70, #56596C);
  background: var(--color-mirage-05, #F3F3F5);
  position: sticky;
  top: 0;
}

.ifelse-field-picker-option {
  padding: 7px 10px 7px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-mirage-80, #3D4157);
}

.ifelse-field-picker-option:hover {
  background: var(--color-primary-light, #E6EAFF);
}

.ifelse-field-picker-option-selected {
  color: var(--color-primary, #0029FF);
  font-weight: 500;
}

.ifelse-field-picker-empty {
  padding: 16px 10px;
  font-size: 12px;
  color: var(--color-muted, #868896);
  text-align: center;
}

.ifelse-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 8px;
  border: 1px dashed var(--color-link-water, #DFEAF2);
}

.ifelse-empty-state-icon {
  width: 32px;
  height: 32px;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 12px;
}

.ifelse-empty-state-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0 0 4px;
}

.ifelse-empty-state-desc {
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   TEST STEP - Mode toggle and result panel
   ========================================================================== */
.test-mode-btn {
  background: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage-70, #56596C);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.test-mode-btn:hover:not(.test-mode-active) {
  background: var(--color-link-water, #DFEAF2);
}

.test-mode-btn.test-mode-active {
  background: var(--color-mirage, #0D122D);
  color: white;
}

#test-step-btn:hover:not(:disabled) {
  opacity: 0.9;
}

#test-step-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#test-step-btn .animate-spin {
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   VARIABLE AUTOCOMPLETE - Dropdown, browse button, preview tags
   ========================================================================== */

/* Dropdown container */
.variable-autocomplete-dropdown {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: autocomplete-fade-in 0.15s ease-out;
  max-height: 320px;
  overflow: hidden;
  position: relative;
}

.variable-autocomplete-options {
  max-height: 300px;
  overflow-y: auto;
}

/* Scroll indicator gradient at bottom */
.variable-autocomplete-dropdown::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, white);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s;
}

.variable-autocomplete-dropdown.scrolled-to-bottom::after {
  opacity: 0;
}

@keyframes autocomplete-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Group headers */
.autocomplete-group {
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.autocomplete-group-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-mirage-30, #B6B8C0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.autocomplete-group-line {
  flex: 1;
  height: 1px;
  background: var(--color-link-water, #DFEAF2);
}

/* Options */
.autocomplete-option {
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background-color 0.1s ease;
}

.autocomplete-option:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.autocomplete-option.highlighted {
  background-color: var(--color-blue-05, #F2F4FF);
}

.autocomplete-option.hidden,
.autocomplete-group.hidden {
  display: none;
}

.autocomplete-option-label {
  font-size: 13px;
  color: var(--color-mirage-80, #3D4157);
  white-space: nowrap;
}

.autocomplete-option .var-code {
  font-size: 10px;
  color: var(--color-mirage-30, #B6B8C0);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.autocomplete-option:hover .var-code,
.autocomplete-option.highlighted .var-code {
  opacity: 1;
}

.autocomplete-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--color-mirage-30, #B6B8C0);
  text-align: center;
}

/* Input wrapper with browse button */
.variable-input-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
}

.variable-input-wrapper .builder-form-input,
.variable-input-wrapper .builder-form-textarea {
  flex: 1;
  padding-right: 36px;
}

.variable-browse-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.variable-browse-btn:hover {
  background: var(--color-blue-05, #F2F4FF);
  color: var(--color-blue, #1814F3);
}

/* For textareas, position the browse button at top-right */
.variable-input-wrapper .builder-form-textarea ~ .variable-browse-btn {
  top: 10px;
  transform: none;
}

/* Variable input left-border indicator */
.builder-form-input.has-variables,
.builder-form-textarea.has-variables {
  border-left: 3px solid var(--color-blue-05, #F2F4FF);
}

/* Preview row with variable tags */
.variable-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 0 0;
}

.variable-preview.hidden {
  display: none;
}

.variable-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.variable-tag-context {
  background: var(--color-secondary-token-green-light, #D9FAEC);
  color: #0a8a54;
}

.variable-tag-upstream {
  background: var(--color-blue-05, #F2F4FF);
  color: var(--color-blue, #1814F3);
}

/* Pill overlay for variable inputs (Zapier-style) */
.variable-pill-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 36px;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  z-index: 1;
  cursor: text;
}

/* Align pill to top in textareas */
.variable-input-wrapper:has(.builder-form-textarea) .variable-pill-overlay {
  align-items: flex-start;
  padding-top: 8px;
}

/* Mixed content overlay: text + inline pill tags */
.variable-pill-overlay-mixed {
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: var(--color-mirage-05, #F3F3F5);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-mirage, #0D122D);
  padding: 10px 12px;
  padding-right: 36px;
  border-radius: 8px;
  overflow-y: auto;
  right: 0;
}

.variable-pill-inline {
  display: inline-flex;
  vertical-align: middle;
  margin: 1px 2px;
}

.variable-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 6px;
  background: var(--color-blue-05, #F2F4FF);
  border: 1px solid rgba(24, 20, 243, 0.12);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.variable-pill-tag:hover {
  border-color: rgba(24, 20, 243, 0.3);
  box-shadow: 0 1px 3px rgba(24, 20, 243, 0.08);
}

.variable-pill-source {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-mirage-30, #B6B8C0);
}

.variable-pill-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-blue, #1814F3);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.variable-pill-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.variable-pill-clear:hover,
.variable-pill-remove:hover {
  color: var(--color-token-red, #FA3A55);
}

/* Variable pill remove button (inside contenteditable pills) */
.variable-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

/* Rich editor for reason field (contenteditable) */
.reason-rich-editor {
  flex: 1;
  min-height: 80px;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  resize: none;
  overflow-y: auto;
  line-height: 1.6;
}

.reason-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--color-mirage-30, #B6B8C0);
  pointer-events: none;
}

.reason-rich-editor .variable-pill-tag {
  display: inline-flex;
  vertical-align: baseline;
  margin: 2px 2px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* Position browse button at top-right for the reason editor */
.variable-input-wrapper .reason-rich-editor ~ .variable-browse-btn {
  top: 10px;
  transform: none;
}

/* Rich variable editor (shared contenteditable with inline pills) */
.rich-variable-editor {
  flex: 1;
  min-height: 80px;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  resize: none;
  overflow-y: auto;
  line-height: 1.6;
}

.rich-variable-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--color-mirage-30, #B6B8C0);
  pointer-events: none;
}

.rich-variable-editor .variable-pill-tag {
  display: inline-flex;
  vertical-align: baseline;
  margin: 2px 2px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.rich-variable-editor--single-line {
  min-height: unset;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Position browse button at top-right for rich editors */
.variable-input-wrapper .rich-variable-editor ~ .variable-browse-btn {
  top: 50%;
  transform: translateY(-50%);
}

.variable-input-wrapper .rich-variable-editor:not(.rich-variable-editor--single-line) ~ .variable-browse-btn {
  top: 10px;
  transform: none;
}

/* SMS character counter */
#sms-char-count {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   EXECUTIONS PAGE — Batch expand, error preview, timeline
   ========================================================================== */

/* Fixed-width column for workflow name */
.col-w-200 { width: 200px; flex-shrink: 0; }

/* Batch children container */
.batch-children-indent {
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  border-left: 3px solid var(--color-primary, #0029FF);
  margin-left: 16px;
  background: var(--color-mirage-05, #F3F3F5);
}

/* Indent only the name column in child rows to preserve column alignment */
.batch-children-indent .col-name {
  padding-left: 12px;
  position: relative;
}

.batch-children-indent .docket-table-row {
  background: var(--color-mirage-05, #F3F3F5);
}

.batch-children-indent .docket-table-row:hover {
  background: var(--color-primary-light, #E6EAFF);
}

.batch-children-indent .docket-table-row + .docket-table-row {
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* Batch child inline status (dot + plain text, no pill) */
.batch-child-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-child-status .status-pill-dot {
  width: 6px !important;
  height: 6px !important;
  min-width: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--color-mirage-30, #B6B8C0);
}

.batch-child-status .dot-green { background-color: var(--color-token-green, #00DF81) !important; }
.batch-child-status .dot-red { background-color: var(--color-token-red, #FA3A55) !important; }
.batch-child-status .dot-blue { background-color: var(--color-primary, #0029FF) !important; }
.batch-child-status .dot-yellow { background-color: var(--color-token-yellow, #FFBB38) !important; }

.batch-child-review-dot-yellow { color: #B07A00; font-weight: 500; }
.batch-child-review-dot-green  { color: #008A51; font-weight: 500; }
.batch-child-review-dot-red    { color: #B3233D; font-weight: 500; }

.review-aging {
  color: #B3233D !important;
}

/* Tighten the status pills inside the executions table so they hug their
   labels instead of carrying a global ~10px padding that makes short
   labels (Approved, Denied) look mostly background. Scoped to docket
   rows so the rest of the design system's pill usage stays untouched. */
.docket-table-row .status-pill-sm {
  padding: 4px 8px;
  gap: 4px;
}

/* Re-evaluation chain indicators */
.chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 9999px;
  background: #F2F4FF;
  color: #0029FF;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.chain-superseded-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
  padding: 6px 12px;
  background: #F2F4FF;
  border-left: 3px solid #0029FF;
}

.chain-superseded-banner svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.chain-pill svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.reeval-connector svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Nested re-evaluation rows in the batch drill-down. Visually distinct
   from the original batch-child rows so users understand they're derived. */
.reeval-row {
  background: #F7F9FB;
  border-left: 3px solid #0029FF;
}

.reeval-row:hover {
  background: #EEF3FF;
}

.reeval-connector {
  color: var(--color-mirage-70, #56596C);
  margin-right: 6px;
  flex-shrink: 0;
}

/* Bulk-review selection UI on the executions index */
.bulk-review-checkbox-col {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
}

.bulk-review-checkbox-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary, #0029FF);
}

.bulk-review-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(13, 18, 45, 0.18);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 100;
  min-width: 420px;
}

.bulk-review-bar.hidden { display: none; }

.bulk-review-bar-count {
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  padding-right: 8px;
  border-right: 1px solid var(--color-link-water, #DFEAF2);
}

.bulk-review-over-limit {
  color: #B3233D !important;
  font-weight: 600;
}

.bulk-review-bar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.batch-child-status .dot-gray { background-color: var(--color-mirage-30, #B6B8C0) !important; }

/* Batch "View all" link */
.batch-view-all {
  border-top: 1px solid var(--color-link-water, #DFEAF2);
  padding: 10px 16px;
}

.batch-view-all-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary, #0029FF);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.batch-view-all-link:hover {
  color: var(--color-blue-90, #1A3EFF);
  text-decoration: underline;
}

/* Chevron rotation for batch expand */
.rotate-90 {
  transform: rotate(90deg);
}

.transition-transform {
  transition: transform 0.2s ease;
}

/* Truncated error preview */
.execution-error-preview {
  font-size: 12px;
  color: var(--color-token-red, #FA3A55);
  margin-top: 2px;
  line-height: 1.4;
  max-width: 600px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Batch row summary text */
.batch-summary-text {
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
}

/* Clickable execution row */
.execution-row-link {
  display: flex;
  width: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.execution-row-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Execution detail page timeline */
.exec-timeline {
  position: relative;
  padding-left: 28px;
}

.exec-timeline-line {
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-link-water, #DFEAF2);
}

.exec-timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.exec-timeline-item:last-child {
  padding-bottom: 0;
}

.exec-timeline-dot {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-link-water, #DFEAF2);
  background: white;
}

.exec-timeline-dot-completed {
  border-color: var(--color-token-green, #00DF81);
  background: var(--color-secondary-token-green-light, #D9FAEC);
}

.exec-timeline-dot-failed {
  border-color: var(--color-token-red, #FA3A55);
  background: var(--color-secondary-token-red-light, #FFE0EB);
}

.exec-timeline-dot-pending {
  border-color: var(--color-mirage-30, #B6B8C0);
  background: var(--color-mirage-05, #F3F3F5);
}

.exec-timeline-dot-running {
  border-color: var(--color-blue-70, #4D69FF);
  background: var(--color-blue-05, #F2F4FF);
}

.exec-timeline-dot-waiting {
  border-color: var(--color-token-yellow, #FFBB38);
  background: var(--color-secondary-token-yellow-light, #FFF5D9);
}

.exec-timeline-dot-skipped {
  border-color: var(--color-mirage-20, #CFD0D5);
  background: var(--color-mirage-05, #F3F3F5);
  border-style: dashed;
}

/* Nested children inside a Human Review timeline block: indent + connector
   line so the grouping reads visually without a heavier container. */
.exec-timeline-children {
  position: relative;
  margin-top: 12px;
  padding-left: 28px;
}

.exec-timeline-children-line {
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-link-water, #DFEAF2);
}

.exec-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.exec-detail-header > :first-child {
  flex: 1;
  min-width: 0;
}

/* ========================================
   Dashboard Recent Cascades Section
   ======================================== */

.dashboard-recent {
  background-color: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  padding: 24px;
  max-width: 1200px;
  margin: 24px auto 0;
  box-sizing: border-box;
}

.dashboard-recent-list {
  display: flex;
  flex-direction: column;
}

.dashboard-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.dashboard-recent-item:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.dashboard-recent-item + .dashboard-recent-item {
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* CSV drag-and-drop active state */
.csv-drop-active {
  background-color: var(--color-primary-light, #E6EAFF) !important;
  outline: 2px dashed var(--color-primary, #0029FF);
  outline-offset: -2px;
}

.docket-table-row.csv-drop-active {
  background-color: var(--color-primary-light, #E6EAFF) !important;
}

.dashboard-recent-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color: var(--color-primary-light, #E6EAFF);
  color: var(--color-primary, #0029FF);
  flex-shrink: 0;
}

.dashboard-recent-info {
  flex: 1;
  min-width: 0;
}

.exec-detail-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
}

.exec-detail-meta dt {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 2px;
}

.exec-detail-meta dd {
  margin: 0;
}

/* Collapsible output JSON */
.exec-output-toggle {
  font-size: 12px;
  color: var(--color-blue-90, #1A3EFF);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin-top: 4px;
}

.exec-output-toggle:hover {
  text-decoration: underline;
}

.exec-output-json {
  font-size: 12px;
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  color: var(--color-mirage-80, #3D4157);
}

/* Execution detail — two-column layout when a review panel is present */
.exec-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.exec-detail-layout:has(.exec-detail-rail) {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.exec-detail-main { min-width: 0; }

.exec-detail-rail {
  position: sticky;
  top: 24px;
}

@media (max-width: 1100px) {
  .exec-detail-layout:has(.exec-detail-rail) {
    grid-template-columns: minmax(0, 1fr);
  }
  .exec-detail-rail { position: static; }
}

/* Review panel card */
.review-panel-card {
  background: #FFFFFF;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(13, 18, 45, 0.03);
}

.review-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
}

.review-panel-decided {
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
  padding: 8px 10px;
  background: #F7F9FB;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-panel-branch-outcome {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.review-panel-decided-ok   { background: #D9FAEC; color: #008A51; }
.review-panel-decided-err  { background: #FFE0EB; color: #B3233D; }
.review-panel-decided-warn { background: #FFF4DB; color: #B07A00; }

.review-panel-locked {
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
  padding: 10px 12px;
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 6px;
  border-left: 3px solid #C4C6C8;
}

.review-panel-linked-note {
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
  padding: 6px 10px;
  background: #F2F4FF;
  border-radius: 6px;
  border-left: 3px solid #0029FF;
}

.review-panel-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-panel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-70, #56596C);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-panel-assignee {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.review-assignee-link button {
  background: transparent;
  border: none;
  color: var(--color-mirage-70, #56596C);
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}

.review-assignee-link button:hover {
  color: var(--color-primary, #0029FF);
  text-decoration: underline;
}

.review-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-btn-full {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.review-note-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-note-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  resize: vertical;
}

.review-note-form input[type="submit"] {
  align-self: flex-start;
}

.review-event-list-wrap {
  position: relative;
}

.review-event-list-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #FFFFFF);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.review-event-list-wrap.is-scrollable::after {
  opacity: 1;
}

.review-event-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #C4C6C8 transparent;
}

/* Inline variant rendered inside the Execution Timeline's Human Review
   step. Fits the card background, with a left rail to visually nest the
   events under the step title. */
.review-event-list-inline {
  margin-top: 6px;
  padding: 8px 8px 8px 14px;
  border-left: 2px solid #DFEAF2;
  max-height: none;
  overflow-y: visible;
}

.review-event-list::-webkit-scrollbar {
  width: 8px;
}

.review-event-list::-webkit-scrollbar-track {
  background: transparent;
}

.review-event-list::-webkit-scrollbar-thumb {
  background: #DFEAF2;
  border-radius: 4px;
}

.review-event-list::-webkit-scrollbar-thumb:hover {
  background: #C4C6C8;
}

.review-event-item {
  padding: 8px 10px;
  background: #F7F9FB;
  border-radius: 6px;
  font-size: 13px;
}

.review-event-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.review-event-label {
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  font-size: 13px;
}

.review-event-time {
  font-size: 11px;
  color: var(--color-muted, #868896);
}

.review-event-actor {
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
}

.review-event-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
  background: #FFFFFF;
  padding: 6px 8px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Expandable long note: one-line preview + disclosure toggle.
   Uses the native <details> element so it's accessible + JS-free. */
.review-event-note-expandable {
  margin-top: 6px;
  background: #FFFFFF;
  border-radius: 4px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.review-event-note-expandable > summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.review-event-note-expandable > summary::-webkit-details-marker { display: none; }

.review-event-note-preview {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-event-note-toggle::before {
  content: "Show more";
  color: var(--color-primary, #0029FF);
  font-weight: 500;
  font-size: 11px;
  white-space: nowrap;
}

.review-event-note-expandable[open] > summary .review-event-note-preview {
  display: none;
}

.review-event-note-expandable[open] > summary .review-event-note-toggle::before {
  content: "Show less";
}

.review-event-note-expandable[open] > summary {
  padding-bottom: 2px;
  justify-content: flex-end;
}

.review-event-note-full {
  margin-top: 0;
  border-top: 1px solid var(--color-mirage-05, #F3F3F5);
}

/* Review decision confirmation modal */
.review-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 18, 45, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
}

/* The modal overlay lives inside a sticky-positioned ancestor
   (.exec-detail-rail) which forms a stacking context. When the modal is
   open we temporarily raise that ancestor above the topnav (z-index: 60)
   so the overlay actually paints over the page header. We also lock body
   scroll here so the JS controller doesn't have to mutate inline styles. */
body.review-modal-open {
  overflow: hidden;
}
body.review-modal-open .exec-detail-rail {
  z-index: 9001;
}

.review-confirm-overlay.hidden { display: none; }

.review-confirm-dialog {
  background: #FFFFFF;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(13, 18, 45, 0.25);
}

.review-confirm-dialog--with-preview {
  max-width: 1100px;
}

.review-confirm-split {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
}

.review-confirm-split .review-confirm-body {
  overflow-y: auto;
  border-right: 1px solid var(--color-link-water, #DFEAF2);
}

.review-confirm-preview-pane {
  display: flex;
  flex-direction: column;
  background: #F7F9FB;
  min-height: 0;
}

.review-confirm-preview-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  background: #FFFFFF;
}

.review-confirm-preview-tab {
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  cursor: pointer;
}

.review-confirm-preview-tab.active {
  background: var(--color-tertiary, #F2F4FF);
  color: var(--color-primary, #0029FF);
  border-color: var(--color-primary, #0029FF);
}

.review-confirm-preview-frame-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #FFFFFF;
}

.review-confirm-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.review-confirm-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}

.review-confirm-preview-loading.is-loading {
  opacity: 1;
}

@media (max-width: 900px) {
  .review-confirm-dialog--with-preview { max-width: 520px; }
  .review-confirm-split { grid-template-columns: 1fr; }
  .review-confirm-split .review-confirm-body { border-right: 0; }
  .review-confirm-preview-pane { display: none; }
}

.review-confirm-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.review-confirm-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
}

.review-confirm-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #E5E7EB;
  color: var(--color-mirage-70, #56596C);
  font-weight: 600;
  font-size: 12px;
}

.review-confirm-step.is-active .review-confirm-step-num {
  background: var(--color-primary, #0029FF);
  color: #FFFFFF;
}

.review-confirm-step.is-active .review-confirm-step-label {
  color: var(--color-mirage, #0D122D);
  font-weight: 600;
}

.review-confirm-step.is-complete .review-confirm-step-num {
  background: var(--color-token-green, #00DF81);
  color: #FFFFFF;
}

.review-confirm-step-divider {
  flex: 1;
  height: 1px;
  background: #E5E7EB;
}

.review-confirm-step2-summary {
  padding: 18px 20px;
  background: #F2F4FF;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 8px;
  margin-bottom: 16px;
}

.review-confirm-preview-upsell {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  padding: 32px;
  overflow-y: auto;
}

.review-confirm-preview-upsell.hidden {
  display: none;
}

.review-confirm-preview-upsell-inner {
  max-width: 380px;
  text-align: center;
}

.review-confirm-preview-upsell-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--color-tertiary, #F2F4FF);
  color: var(--color-primary, #0029FF);
  margin: 0 auto 16px;
}

.review-confirm-preview-upsell-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0 0 8px;
}

.review-confirm-preview-upsell-body {
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  margin: 0 0 16px;
  line-height: 1.5;
}

.review-confirm-preview-upsell-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-confirm-preview-upsell-list li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  color: var(--color-mirage-80, #3D4157);
}

.review-confirm-preview-upsell-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-token-green, #00DF81);
  font-weight: 700;
}

.review-confirm-preview-upsell-cta {
  display: inline-block;
  padding: 8px 20px;
}

.review-confirm-step2-error {
  margin-top: 8px;
  padding: 8px 10px;
  background: #FEE2E2;
  border: 1px solid #FECACA;
  border-radius: 6px;
  font-size: 12px;
  color: #B91C1C;
}

.review-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.review-confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
}

.review-confirm-close {
  background: transparent;
  border: none;
  color: var(--color-mirage-70, #56596C);
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
}

.review-confirm-close:hover {
  background: var(--color-mirage-05, #F3F3F5);
}

.review-confirm-body {
  padding: 24px 28px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-confirm-lede {
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  margin: 0;
}

.review-confirm-preview-title {
  font-size: 12px;
  color: var(--color-mirage-70, #56596C);
  margin-bottom: 6px;
}

.review-confirm-node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 6px;
  padding: 6px 8px;
  background: #F7F9FB;
}

.review-confirm-node-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  background: #FFFFFF;
  border-radius: 4px;
  font-size: 13px;
}

.review-confirm-node-name {
  color: var(--color-mirage, #0D122D);
  font-weight: 500;
}

.review-confirm-node-type {
  font-size: 11px;
  color: var(--color-mirage-70, #56596C);
  background: var(--color-mirage-05, #F3F3F5);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.review-confirm-empty {
  font-size: 13px;
  color: var(--color-muted, #868896);
  margin: 0;
  padding: 8px 10px;
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 6px;
}

.review-confirm-warning {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid;
}

.review-confirm-warning-test {
  color: #3D4157;
  background: #F3F3F5;
  border-left-color: #868896;
}

.review-confirm-warning-live {
  color: #B3233D;
  background: #FFE0EB;
  border-left-color: #FA3A55;
}

.review-confirm-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-confirm-form.hidden { display: none; }
.review-confirm-preview.hidden { display: none; }

.review-confirm-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.review-confirm-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* Inputs snapshot card on execution detail */
.exec-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 20px;
}
.exec-inputs-grid dt {
  font-size: 11px;
  color: var(--color-mirage-70, #56596C);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  margin-bottom: 2px;
}
.exec-inputs-grid dd {
  font-size: 13px;
  color: var(--color-mirage-80, #3D4157);
  word-break: break-word;
  margin: 0;
  margin-inline-start: 0;
}

/* Human Review banner on execution detail */
.review-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #FFF4DB;
  border: 1px solid #FFBB38;
  border-radius: 10px;
}

.review-banner-icon {
  color: #B07A00;
  flex-shrink: 0;
  margin-top: 2px;
}

.review-banner-title {
  font-weight: 600;
  color: #6E4E00;
  font-size: 14px;
  margin-bottom: 2px;
}

.review-banner-sub {
  font-size: 13px;
  color: #7A5800;
}

.review-banner-rules {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-banner-rules code {
  font-size: 12px;
  color: #5A4200;
  background: rgba(255, 255, 255, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* Decision branch chip shown next to a Decision node in the timeline */
.decision-branch-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.decision-branch-chip-pass {
  background: #D9FAEC;
  color: #008A51;
}

.decision-branch-chip-human-review {
  background: #FFF4DB;
  color: #B07A00;
}

.decision-branch-chip-fail {
  background: #FFE0EB;
  color: #B3233D;
}

/* Human-readable Decision output summary */
.decision-summary {
  margin-top: 6px;
  padding: 8px 12px;
  background: #F7F9FB;
  border-left: 3px solid #DFEAF2;
  border-radius: 0 6px 6px 0;
}

.decision-summary-header {
  font-size: 12px;
  color: #56596C;
  margin-bottom: 4px;
  font-weight: 500;
}

.decision-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.decision-summary-list code {
  font-size: 12px;
  color: #3D4157;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* Error preview in timeline (allow wrapping) */
.execution-error-wrap {
  white-space: normal;
  max-width: none;
}

/* Execution row inline detail (error/wait messages) */
.execution-row-detail {
  padding-left: 15px;
  padding-bottom: 6px;
  width: 100%;
}

/* Flex min-width reset for truncation in flex containers */
.flex-truncate {
  min-width: 0;
}

.dashboard-recent-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0;
  line-height: 20px;
}

.dashboard-recent-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  font-size: 13px;
}

.dashboard-recent-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

/* ========================================
   Dashboard Templates Section
   ======================================== */

.dashboard-templates {
  background-color: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  padding: 24px;
  max-width: 1200px;
  margin: 24px auto;
  box-sizing: border-box;
}

.dashboard-templates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Dashboard Tabs */
.dashboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.dashboard-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mirage-70, #56596C);
  background: transparent;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dashboard-tab:hover {
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
}

.dashboard-tab-active {
  color: var(--color-white, #FFFFFF);
  background-color: var(--color-mirage, #0D122D);
  border-color: var(--color-mirage, #0D122D);
}

.dashboard-tab-active:hover {
  color: var(--color-white, #FFFFFF);
  background-color: var(--color-mirage, #0D122D);
}

/* Template Cards Scroll Container */
.dashboard-template-scroll {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1000px) {
  .dashboard-template-scroll {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-template-scroll {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .dashboard-template-scroll {
    grid-template-columns: 1fr;
  }
}


/* Template Card */
.dashboard-template-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background-color: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  scroll-snap-align: start;
}

.dashboard-template-card:hover {
  border-color: var(--color-blue-30, #B3BFFF);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Template Icon */
.dashboard-template-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.dashboard-template-icons {
  display: flex;
  gap: 6px;
}

/* Template Card Text */
.dashboard-template-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0;
  line-height: 20px;
}

.dashboard-template-description {
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
  margin: 0;
  line-height: 18px;
  flex: 1;
}

/* ========================================
   Templates Browse Page
   ======================================== */

.templates-page {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

.templates-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.templates-grid .dashboard-template-card {
  flex: unset;
  width: 100%;
}

@media (max-width: 768px) {
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .templates-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Landing Page (.lp-*)
   ======================================== */

/* --- Shell & Layout --- */
.lp-shell {
  display: flex;
  min-height: 100vh;
  background: #FFFFFF;
  font-family: 'Inter', sans-serif;
}


.lp-content {
  width: 848px;
  margin-left: max(220px, calc((100% - 848px) / 2));
  margin-right: auto;
  padding-top: 72px;
}

/* --- Sidebar --- */
.lp-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
  padding: 32px 16px 20px;
  box-sizing: border-box;
}

.lp-sidebar-top {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.lp-brand-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  cursor: default;
  user-select: none;
}

.lp-sidebar-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.lp-sidebar-logo img {
  height: 26px;
  width: auto;
  display: block;
}

.lp-brand-caret {
  color: #868896;
  transition: transform 0.2s;
  flex-shrink: 0;
  cursor: pointer;
}

.lp-brand-caret-open {
  transform: rotate(180deg);
}

.lp-brand-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 24px;
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  padding: 8px;
  min-width: 160px;
  z-index: 10;
}

.lp-brand-menu.hidden {
  display: none;
}

.lp-brand-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}

.lp-brand-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.lp-brand-crs-logo {
  display: block;
}

.lp-crs-logo {
  margin-left: -12px;
}

.lp-brand-menu-powered-text {
  font-size: 12px;
  font-weight: 500;
  color: #868896;
  white-space: nowrap;
}

.lp-brand-menu-label {
  font-size: 12px;
  font-weight: 500;
  color: #868896;
  white-space: nowrap;
}

.lp-brand-menu-name {
  font-size: 14px;
  font-weight: 700;
  color: #0D122D;
  white-space: nowrap;
}

.lp-mobile-bar .lp-brand-menu-item {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.lp-mobile-bar .lp-brand-menu {
  left: 0;
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
}

.lp-sidebar-divider {
  height: 1px;
  background: #DFEAF2;
  margin: 24px 24px 16px;
}

.lp-sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lp-sidebar-link {
  display: flex;
  align-items: center;
  padding: 10px 8px;
  color: #56596C;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.lp-sidebar-link:hover {
  color: #0D122D;
}

.lp-sidebar-link-active {
  color: #0D122D;
  font-weight: 600;
  border-left-color: #0029FF;
}

.lp-sidebar-subnav {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 4px;
}

.lp-sidebar-subnav.hidden {
  display: none;
}

.lp-sidebar-sublink {
  display: flex;
  align-items: center;
  padding: 7px 8px 7px 20px;
  color: #868896;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  margin-left: 3px;
  transition: color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.lp-sidebar-sublink:hover {
  color: #0D122D;
}

.lp-sidebar-sublink-active {
  color: #0029FF;
  font-weight: 600;
}

.lp-sidebar-bottom {
  padding: 0 8px 0;
  flex-shrink: 0;
}

.lp-sidebar-cta {
  display: block;
  text-align: center;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 9px;
  background: #0029FF;
  color: #FFFFFF;
  text-decoration: none;
  transition: background 0.2s;
  box-sizing: border-box;
}

.lp-sidebar-cta:hover {
  background: #0022D4;
}

.lp-sidebar-powered {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 16px;
}

.lp-sidebar-powered-text {
  font-size: 11px;
  font-weight: 500;
  color: #868896;
  letter-spacing: 0.02em;
  margin-right: 0;
}

.lp-sidebar-powered-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.lp-sidebar-powered-logo:hover {
  opacity: 0.8;
}

/* --- Mobile Bar --- */
.lp-mobile-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #FFFFFF;
  border-bottom: 1px solid #DFEAF2;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.lp-mobile-toggle {
  background: none;
  border: none;
  color: #0D122D;
  cursor: pointer;
  padding: 4px;
}

.lp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.lp-mobile-overlay.hidden {
  display: none;
}

/* --- Top Auth Bar --- */
.lp-topbar {
  position: fixed;
  top: 0;
  left: 220px;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 28px 64px 0;
  background: transparent;
  z-index: 99;
  pointer-events: none;
}

.lp-topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.lp-topbar-login {
  font-size: 14px;
  font-weight: 500;
  color: #3D4157;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 9px;
  transition: color 0.2s, background 0.2s;
}

.lp-topbar-login:hover {
  color: #0D122D;
  background: #F5F7FA;
}

.lp-topbar-signup {
  font-size: 14px;
  padding: 8px 20px;
}

/* --- Hero --- */
.lp-hero {
  background: #FFFFFF;
  padding: 24px 64px 80px;
}

.lp-hero-pills {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
}

.lp-hero-float {
  font-size: 13px;
  font-weight: 500;
  color: #3D4157;
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 100px;
  padding: 8px 16px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.lp-hero-inner {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.lp-hero-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: #0D122D;
  line-height: 1.1;
  margin: 0 0 20px;
  letter-spacing: -1px;
}

.lp-hero-sub {
  font-size: 18px;
  color: #56596C;
  line-height: 1.6;
  margin: 0;
  max-width: 520px;
}

.lp-hero-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 13px;
  color: #868896;
}

.lp-hero-powered-text {
  white-space: nowrap;
}

.lp-hero-powered-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lp-hero-powered-logo:hover {
  opacity: 1;
}

.lp-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}


.lp-btn-lg {
  padding: 14px 28px !important;
  font-size: 16px !important;
  border-radius: 9px;
}

.lp-btn-lg.btn-secondary {
  background: #FFFFFF;
  color: #0D122D;
  border-color: #DFEAF2;
}

.lp-btn-lg.btn-secondary:hover {
  background: #F5F7FA;
  border-color: #0029FF;
  color: #0029FF;
}

.lp-hero-visual {
  width: 100%;
}

/* --- Mockup Browser Chrome --- */
.lp-mockup-browser {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px #DFEAF2;
  overflow: hidden;
}

.lp-mockup-sm {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 0 0 1px #DFEAF2;
}

.lp-mockup-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #F5F7FA;
  border-bottom: 1px solid #DFEAF2;
}

.lp-mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.lp-mockup-dot-red { background: #FA3A55; }
.lp-mockup-dot-yellow { background: #FFBB38; }
.lp-mockup-dot-green { background: #00DF81; }

.lp-mockup-titlebar-text {
  font-size: 12px;
  color: #868896;
  margin-left: 8px;
}

/* --- Hero Interactive Demo --- */
.lp-demo-resetting .lp-demo-ghost,
.lp-demo-resetting .lp-demo-node-animated,
.lp-demo-resetting .lp-demo-line-yes,
.lp-demo-resetting .lp-demo-line-eviction,
.lp-demo-resetting .lp-demo-panel-item { transition: none !important; }

.lp-demo-workspace {
  display: flex;
  position: relative;
  overflow: hidden;
}

.lp-demo-panel {
  width: 140px;
  flex-shrink: 0;
  background: #F7F9FB;
  border-right: 1px solid #DFEAF2;
  padding: 10px 8px;
}

.lp-demo-panel-header {
  font-size: 9px;
  font-weight: 700;
  color: #868896;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.lp-demo-panel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #3D4157;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 2px;
  cursor: default;
  transition: background 0.15s, opacity 0.15s, color 0.15s;
  user-select: none;
}

.lp-demo-panel-item-used { opacity: 0.35; }

.lp-demo-panel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lp-dot-primary { background: var(--color-primary, #0029FF); }
.lp-dot-purple { background: var(--color-token-purple); }
.lp-dot-orange { background: #FF8C38; }
.lp-dot-info { background: #00C1FF; }
.lp-dot-green { background: var(--color-token-green); }
.lp-dot-red { background: var(--color-token-red, #FA3A55); }
.lp-dot-yellow { background: var(--color-token-yellow); }

.lp-demo-lib-highlight {
  background: #EEF1FF;
  color: #0029FF;
}

.lp-demo-lib-dragging { opacity: 0.15 !important; }

.lp-demo-canvas {
  flex: 1;
  position: relative;
  height: 390px;
  background: #FAFBFF;
}

.lp-demo-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lp-demo-line {
  stroke: #DFEAF2;
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 4 3;
}

.lp-demo-line-no {
  stroke: #FA3A55;
  stroke-dasharray: none;
  stroke-width: 1.5;
  fill: none;
}

.lp-demo-line-yes,
.lp-demo-line-eviction {
  fill: none;
  stroke: #00DF81;
  stroke-width: 1.5;
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  transition: stroke-dashoffset 0.7s ease;
}

.lp-demo-line-eviction { transition: stroke-dashoffset 0.4s ease; }

.lp-demo-connector-draw { stroke-dashoffset: 0 !important; }

.lp-demo-node-animated {
  opacity: 0;
  transform: scale(0.88) translateY(6px);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lp-demo-node-visible {
  opacity: 1 !important;
  transform: scale(1) translateY(0) !important;
}

.lp-demo-ghost {
  position: absolute;
  width: 120px;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  font-size: 11px;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.lp-demo-ghost-active {
  opacity: 1;
  transform: scale(1.05) rotate(-1.5deg);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.lp-demo-ghost-moving {
  transform: translate(var(--ghost-dx), var(--ghost-dy)) scale(1.02) rotate(0deg) !important;
  transition: opacity 0.2s ease,
              transform 1.5s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s ease !important;
}

.lp-demo-ghost-drop {
  opacity: 0 !important;
  transform: translate(var(--ghost-dx), var(--ghost-dy)) scale(0.96) !important;
  transition: opacity 0.25s ease, transform 0.25s ease !important;
}

.lp-demo-decision-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
}

.lp-demo-branch-yes {
  font-size: 9px;
  font-weight: 600;
  color: #00875A;
}

.lp-demo-branch-no {
  font-size: 9px;
  font-weight: 600;
  color: #FA3A55;
}

/* Demo node positions */
.lp-demo-node-credit    { top: 20px;  left: 230px; }
.lp-demo-node-decision  { top: 110px; left: 230px; }
.lp-demo-node-adverse   { top: 215px; left: 395px; }
.lp-demo-node-criminal  { top: 215px; left: 65px; }
.lp-demo-node-eviction  { top: 315px; left: 65px; }

/* Ghost start positions & travel distances */
.lp-demo-ghost-criminal  { top: 56px; left: 5px; --ghost-dx: 200px; --ghost-dy: 159px; }
.lp-demo-ghost-eviction  { top: 88px; left: 5px; --ghost-dx: 200px; --ghost-dy: 227px; }

/* --- Workflow Canvas Mockup --- */
.lp-mockup-canvas {
  position: relative;
  height: 340px;
  background: #F9FAFB;
  padding: 12px;
}

.lp-mockup-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lp-mockup-node {
  position: absolute;
  width: 120px;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  font-size: 11px;
}

.lp-mockup-node-header {
  padding: 5px 10px;
  font-weight: 600;
  color: #FFFFFF;
  font-size: 10px;
  text-align: center;
}

.lp-mockup-header-blue { background: #0029FF; }
.lp-mockup-header-purple { background: #9233FE; }
.lp-mockup-header-green { background: #00DF81; color: #0D122D; }
.lp-mockup-header-red { background: #FA3A55; }
.lp-mockup-header-teal { background: #00C1FF; color: #0D122D; }
.lp-mockup-header-orange { background: #FF8C38; }

.lp-mockup-node-body {
  padding: 6px 10px;
  color: #56596C;
  font-size: 10px;
  text-align: center;
}

/* --- Builder UI Mockup --- */
.lp-mockup-builder-ui {
  display: flex;
  min-height: 240px;
}

.lp-mockup-builder-sidebar {
  width: 130px;
  background: #F5F7FA;
  border-right: 1px solid #DFEAF2;
  padding: 12px 10px;
}

.lp-mockup-sidebar-label {
  font-size: 9px;
  font-weight: 700;
  color: #868896;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.lp-mockup-sidebar-label-spaced {
  margin-top: 8px;
}

.lp-mockup-sidebar-item {
  font-size: 11px;
  color: #3D4157;
  padding: 5px 8px;
  border-radius: 5px;
  margin-bottom: 3px;
  cursor: default;
}

.lp-mockup-sidebar-item:hover {
  background: #E6EAFF;
}

.lp-mockup-builder-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px;
  background: #FAFBFC;
}

.lp-mini-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  font-size: 11px;
  color: #3D4157;
  font-weight: 500;
}

.lp-mini-node-active {
  border-color: #0029FF;
  box-shadow: 0 0 0 2px rgba(0, 41, 255, 0.08);
}

.lp-mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.lp-mini-connector {
  width: 2px;
  height: 16px;
  background: #DFEAF2;
}

/* --- Content Sections --- */
.lp-section {
  padding: 96px 64px;
}

.lp-section-alt {
  background: #FFFFFF;
}

.lp-section-inner {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 64px;
}

.lp-section-reverse {
  flex-direction: row-reverse;
}

.lp-section-centered {
  flex-direction: column;
  text-align: center;
}

.lp-section-text {
  flex: 1;
  min-width: 0;
}

.lp-section-visual {
  flex: 1;
  min-width: 0;
}

.lp-section-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #0029FF;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.lp-section-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #0D122D;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}

.lp-section-body {
  font-size: 16px;
  color: #56596C;
  line-height: 1.65;
  margin: 0 0 24px;
  max-width: 480px;
}

.lp-section-body-centered {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.lp-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lp-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: #3D4157;
  line-height: 1.5;
}

.lp-check-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--color-primary, #0029FF);
}

/* --- Feature Tabs Showcase --- */
.lp-features-section {
  padding: 48px 0 64px;
}

.lp-features-card {
  background: #000000;
  border-radius: 16px;
  border: none;
  padding: 48px 40px 56px;
}

.lp-features-card-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  text-align: left;
  margin: 0 0 36px;
}

/* Dark card — tab overrides */
.lp-features-card .lp-features-tabs {
  border-bottom-color: rgba(255,255,255,0.1);
}
.lp-features-card .lp-features-tab {
  border-top-color: transparent;
}
.lp-features-card .lp-features-tab:hover {
  background: rgba(255,255,255,0.06);
}
.lp-features-card .lp-features-tab-active {
  background: rgba(255,255,255,0.08);
  border-top-color: #4D6FFF;
}
.lp-features-card .lp-features-tab-icon { color: rgba(255,255,255,0.35); }
.lp-features-card .lp-features-tab-active .lp-features-tab-icon { color: #4D6FFF; }
.lp-features-card .lp-features-tab-label { color: rgba(255,255,255,0.45); }
.lp-features-card .lp-features-tab-active .lp-features-tab-label { color: #FFFFFF; }
.lp-features-card .lp-features-tab-desc { color: rgba(255,255,255,0.3); }
.lp-features-card .lp-features-tab-active .lp-features-tab-desc { color: rgba(255,255,255,0.55); }

/* Dark card — panel text overrides */
.lp-features-card .lp-section-eyebrow { color: #4D6FFF; }
.lp-features-card .lp-section-headline { color: #FFFFFF; }
.lp-features-card .lp-section-body { color: rgba(255,255,255,0.75); }
.lp-features-card .lp-feature-list li { color: rgba(255,255,255,0.7); }
.lp-features-card .lp-check-icon path { fill: #4D6FFF; }

.lp-features-card .lp-vendor-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.lp-features-card .lp-vendor-card {
  padding: 14px;
  gap: 6px;
}
.lp-features-card .lp-vendor-card-icon {
  width: 36px;
  height: 36px;
  font-size: 12px;
}
.lp-features-card .lp-vendor-highlights { border-top-color: rgba(255,255,255,0.1); }
.lp-features-card .lp-vendor-tag {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.65);
}

.lp-features-card .lp-template-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 0;
}
.lp-features-card .lp-template-card {
  text-align: left;
}
.lp-features-card .lp-template-icon {
  margin-left: 0;
  margin-right: auto;
}


.lp-features-tabs-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #000000;
  margin-bottom: 40px;
}

.lp-features-tabs-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lp-features-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #DFEAF2;
}

.lp-features-tab {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 10px;
  background: none;
  border: none;
  border-top: 3px solid transparent;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  transition: all 0.2s ease;
}

.lp-features-tab:hover {
  background: #F7F9FB;
}

.lp-features-tab-active {
  border-top-color: #0029FF;
  background: #FFFFFF;
}

.lp-features-tab-icon {
  width: 20px;
  height: 20px;
  color: #868896;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.lp-features-tab-active .lp-features-tab-icon {
  color: #0029FF;
}

.lp-features-tab-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #56596C;
  line-height: 1.3;
}

.lp-features-tab-active .lp-features-tab-label {
  color: #0D122D;
}

.lp-features-tab-desc {
  font-size: 12px;
  color: #868896;
  line-height: 1.4;
  margin-top: 2px;
}

.lp-features-tab-active .lp-features-tab-desc {
  color: #56596C;
}

/* Panels */
.lp-features-panel {
  max-width: 1100px;
  margin: 0 auto;
  animation: lp-fade-in 0.3s ease;
}

.lp-features-panel-hidden {
  display: none;
}

.lp-features-panel-active {
  display: block;
}

@keyframes lp-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Accordion headers — hidden on desktop, shown on mobile via media query */
.lp-features-accordion-header {
  display: none;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 20px 0;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  color: #FFFFFF;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.2s;
}

.lp-features-accordion-header:hover {
  opacity: 0.85;
}

.lp-features-panel:last-of-type .lp-features-accordion-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.lp-features-panel.lp-features-panel-active .lp-features-accordion-header {
  border-bottom: none;
}

/* Colored dot */
.lp-accordion-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lp-accordion-dot-blue { background: var(--color-primary, #0029FF); }
.lp-accordion-dot-purple { background: var(--color-token-purple, #9233FE); }
.lp-accordion-dot-green { background: var(--color-token-green, #00DF81); }
.lp-accordion-dot-orange { background: var(--color-token-orange, #FF8C38); }

/* Header text block */
.lp-accordion-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.lp-accordion-title {
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.3;
}

.lp-accordion-desc {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

/* Chevron */
.lp-accordion-chevron {
  margin-left: auto;
  font-size: 14px;
  transition: transform 0.2s;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

/* Mobile hero compact workflow */
.lp-hero-mobile {
  display: none;
}

.lp-hero-mobile-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 28px 20px;
  background: #FAFBFF;
}

.lp-hero-mobile-node {
  animation: lp-node-pull-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lp-hero-mobile-node:nth-child(1) { animation-delay: 0.3s; }
.lp-hero-mobile-node:nth-child(3) { animation-delay: 1.0s; }
.lp-hero-mobile-node:nth-child(5) { animation-delay: 1.7s; }

.lp-hero-mobile-chain .lp-mini-connector {
  animation: lp-connector-draw 0.4s ease both;
}

.lp-hero-mobile-chain > .lp-mini-connector:nth-of-type(1) { animation-delay: 0.8s; }
.lp-hero-mobile-chain > .lp-mini-connector:nth-of-type(2) { animation-delay: 1.5s; }

.lp-mini-connector-branch {
  display: flex;
  gap: 24px;
  margin-top: 0;
  animation: lp-node-pull-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 2.4s;
}

.lp-mini-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.lp-mini-branch-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.lp-mini-branch-yes {
  color: #00875A;
  background: rgba(0, 223, 129, 0.1);
}

.lp-mini-branch-no {
  color: #FA3A55;
  background: rgba(250, 58, 85, 0.1);
}

@keyframes lp-node-pull-in {
  0% { opacity: 0; transform: translateY(24px) scale(0.92); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lp-connector-draw {
  from { opacity: 0; transform: scaleY(0); }
  to { opacity: 1; transform: scaleY(1); }
}

.lp-features-panel-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.lp-features-panel-visual {
  width: 100%;
  max-width: 620px;
}

.lp-features-panel-text {
  width: 100%;
  max-width: 620px;
  text-align: left;
}

.lp-features-panel-body {
  width: 100%;
  max-width: 620px;
  text-align: left;
}

.lp-features-panel-inner > .lp-section-eyebrow,
.lp-features-panel-inner > .lp-section-headline {
  width: 100%;
  max-width: 620px;
  text-align: left;
}

/* --- Vendor Highlights (tags) --- */
.lp-vendor-highlights {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.lp-vendor-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #E6EAFF;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #0029FF;
}

/* --- Vendor Card Grid --- */
.lp-vendor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.lp-vendor-card {
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.lp-vendor-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.lp-vendor-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.lp-vendor-icon-primary { background: var(--color-primary-light, #E6EAFF); color: var(--color-primary, #0029FF); }
.lp-vendor-icon-purple { background: var(--color-secondary-token-purple-light); color: var(--color-token-purple); }
.lp-vendor-icon-green { background: var(--color-secondary-token-green-light); color: #00875A; }

.lp-vendor-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #0D122D;
}

.lp-vendor-card-category {
  font-size: 12px;
  color: #868896;
}

/* --- Batch Processing Mockup --- */
.lp-batch-mockup {
  padding: 16px;
}

.lp-batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.lp-batch-title {
  font-size: 13px;
  font-weight: 600;
  color: #0D122D;
}

.lp-batch-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: #0029FF;
}

.lp-batch-progress-bar {
  height: 6px;
  background: #F3F3F5;
  border-radius: 999px;
  margin-bottom: 16px;
  overflow: hidden;
}

.lp-batch-progress-fill {
  height: 100%;
  background: #0029FF;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.lp-batch-progress-78 { width: 78%; }

.lp-batch-table {
  display: flex;
  flex-direction: column;
}

.lp-batch-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F3F3F5;
}

.lp-batch-row:last-child {
  border-bottom: none;
}

.lp-batch-row-header {
  border-bottom: 1px solid #DFEAF2;
}

.lp-batch-row-header .lp-batch-cell {
  font-size: 10px;
  font-weight: 700;
  color: #868896;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lp-batch-cell {
  flex: 1;
  font-size: 12px;
  color: #3D4157;
}

.lp-batch-cell-name {
  flex: 2;
  font-weight: 500;
}

.lp-mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.lp-mini-pill-green {
  background: #D9FAEC;
  color: #00875A;
}

.lp-mini-pill-blue {
  background: #E6EAFF;
  color: #0029FF;
}

.lp-mini-pill-gray {
  background: #F3F3F5;
  color: #868896;
}

/* --- Letter / Adverse Action Mockup --- */
.lp-letter-mockup {
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  max-width: 360px;
  margin: 0 auto;
}

.lp-letter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.lp-letter-logo {
  font-size: 13px;
  font-weight: 700;
  color: #0D122D;
}

.lp-letter-date {
  font-size: 11px;
  color: #868896;
}

.lp-letter-divider {
  height: 1px;
  background: #DFEAF2;
  margin-bottom: 16px;
}

.lp-letter-title {
  font-size: 16px;
  font-weight: 700;
  color: #0D122D;
  margin-bottom: 12px;
}

.lp-letter-line {
  height: 8px;
  background: #F3F3F5;
  border-radius: 4px;
  margin-bottom: 8px;
}

.lp-letter-line-long { width: 100%; }
.lp-letter-line-medium { width: 65%; }

.lp-letter-spacer {
  height: 12px;
}

.lp-letter-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: #3D4157;
  margin-bottom: 8px;
}

.lp-letter-reason {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #56596C;
  margin-bottom: 6px;
}

.lp-letter-x {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.lp-letter-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #E6EAFF;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #0029FF;
  margin-top: 8px;
}

/* --- Template Grid --- */
.lp-template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
  width: 100%;
}

.lp-template-card {
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

.lp-template-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-3px);
}

.lp-template-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.lp-template-icon-primary { background: var(--color-primary-light, #E6EAFF); }
.lp-template-icon-purple { background: var(--color-secondary-token-purple-light); }
.lp-template-icon-green { background: var(--color-secondary-token-green-light); }
.lp-template-icon-yellow { background: var(--color-secondary-token-yellow-light); }

.lp-template-icon svg {
  width: 24px;
  height: 24px;
}

.lp-template-name {
  font-size: 15px;
  font-weight: 600;
  color: #0D122D;
  margin: 0 0 8px;
}

.lp-template-desc {
  font-size: 13px;
  color: #56596C;
  line-height: 1.5;
  margin: 0;
}

/* --- CTA Section --- */
.lp-cta-section {
  padding: 80px 48px;
  background: #FFFFFF;
  text-align: center;
}

.lp-cta-inner {
  max-width: 600px;
  margin: 0 auto;
}

.lp-cta-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #0D122D;
  line-height: 1.2;
  margin: 0 0 16px;
}

.lp-cta-sub {
  font-size: 17px;
  color: #56596C;
  line-height: 1.6;
  margin: 0 0 32px;
}

.lp-btn-white {
  background: #FFFFFF !important;
  color: #0029FF !important;
  border: none !important;
}

.lp-btn-white:hover {
  background: #E6EAFF !important;
}

/* --- Cost Savings Funnel --- */
.lp-cost-funnel {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.lp-cost-step {
  margin-bottom: 12px;
}

.lp-cost-step-bar {
  background: #E6EAFF;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: width 0.3s;
}

.lp-cost-step-bar-mid {
  background: #FFF3E0;
}

.lp-cost-step-bar-narrow {
  background: #E8F5E9;
}

.lp-cost-step-bar-full { width: 100%; }
.lp-cost-step-bar-60   { width: 60%; }

.lp-cost-step-label {
  font-size: 14px;
  font-weight: 500;
  color: #0D122D;
}

.lp-cost-step-cost {
  font-size: 13px;
  font-weight: 600;
  color: #56596C;
}

.lp-cost-result {
  margin-top: 20px;
  border-top: 1px solid #DFEAF2;
  padding-top: 20px;
}

.lp-cost-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.lp-cost-result-label {
  font-size: 14px;
  color: #56596C;
}

.lp-cost-result-value {
  font-size: 16px;
  font-weight: 700;
}

.lp-cost-result-savings {
  color: #00DF81;
}

.lp-cost-result-waste {
  color: #FA3A55;
  text-decoration: line-through;
}

.lp-cost-result-highlight {
  background: #F0FFF4;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
}

.lp-cost-result-highlight .lp-cost-result-label {
  font-weight: 600;
  color: #0D122D;
}

.lp-cost-result-highlight .lp-cost-result-savings {
  font-size: 20px;
}

.lp-cta-secondary-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: #56596C;
  text-decoration: none;
  transition: color 0.2s;
}

.lp-cta-secondary-link:hover {
  color: #0029FF;
}

/* --- Footer --- */
.lp-footer {
  background: #FFFFFF;
  padding: 32px 48px;
  border-top: 1px solid #DFEAF2;
}

.lp-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lp-footer-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #0D122D;
}

.lp-footer-links {
  display: flex;
  gap: 24px;
}

.lp-footer-links a {
  font-size: 13px;
  color: #868896;
  text-decoration: none;
  transition: color 0.2s;
}

.lp-footer-links a:hover {
  color: #0D122D;
}

.lp-footer-copy {
  font-size: 12px;
  color: #868896;
}

/* --- Calendly Modal --- */

.calendly-modal-content {
  position: relative;
  background-color: white;
  border-radius: 12px;
  width: 1000px;
  max-width: 95vw;
  height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.calendly-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 10;
  background: white;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--color-mirage-70, #56596C);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendly-modal-close:hover {
  background: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

/* Loading animation */
.calendly-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: white;
  z-index: 5;
  transition: opacity 0.3s ease;
}

.calendly-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.calendly-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-link-water, #DFEAF2);
  border-top-color: var(--color-primary, #0029FF);
  border-radius: 50%;
  animation: calendly-spin 0.8s linear infinite;
}

.calendly-loader-text {
  font-size: 14px;
  color: var(--color-mirage-70, #56596C);
  margin: 0;
}

@keyframes calendly-spin {
  to { transform: rotate(360deg); }
}

.calendly-modal-content iframe {
  border: none;
  transition: opacity 0.3s ease;
}

/* --- Responsive --- */
@media (max-width: 1225px) {
  .lp-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid #DFEAF2;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 101;
    flex-direction: row;
    padding: 24px 32px;
  }

  .lp-sidebar.lp-sidebar-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .lp-mobile-bar {
    display: flex;
  }

  .lp-topbar {
    display: none;
  }

  .lp-mobile-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .lp-mobile-cta {
    font-size: 13px;
    padding: 8px 14px;
  }

  .lp-sidebar-bottom {
    display: none;
  }

  .lp-sidebar-top {
    padding: 0;
  }

  .lp-sidebar .lp-brand-dropdown {
    display: none;
  }

  .lp-sidebar .lp-sidebar-divider {
    display: none;
  }

  .lp-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .lp-sidebar-subnav {
    padding-left: 12px;
  }

  .lp-content {
    width: 100%;
    margin: 0 auto;
    padding-top: 56px;
  }

  .lp-hero {
    padding: 60px 24px;
  }

  .lp-hero-pills {
    flex-wrap: wrap;
  }

  .lp-hero-inner {
    flex-direction: column;
    gap: 40px;
  }

  .lp-hero-headline {
    font-size: 36px;
  }

  .lp-section {
    padding: 64px 24px;
  }

  .lp-section-inner {
    flex-direction: column;
    gap: 40px;
  }

  .lp-section-reverse {
    flex-direction: column;
  }

  .lp-section-body {
    max-width: 100%;
  }

  .lp-features-section {
    padding: 64px 24px 48px;
  }

  .lp-features-panel-inner {
    gap: 24px;
  }

  .lp-features-tab {
    min-width: 120px;
    padding: 12px 14px 10px;
  }

  .lp-features-tab-desc {
    display: none;
  }

  .lp-template-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lp-cta-section {
    padding: 60px 24px;
  }

  .lp-footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .lp-hero-headline {
    font-size: 28px;
  }

  .lp-hero-visual {
    display: none;
  }

  .lp-hero-mobile {
    display: flex;
    justify-content: center;
  }

  .lp-section-headline {
    font-size: 28px;
  }

  .lp-hero-actions {
    flex-direction: column;
  }

  .lp-template-grid {
    grid-template-columns: 1fr;
  }

  .lp-vendor-grid {
    grid-template-columns: 1fr;
  }

  .lp-cta-headline {
    font-size: 26px;
  }

  /* Feature tabs → accordion on mobile */
  .lp-features-tabs-sticky {
    display: none;
  }

  .lp-features-accordion-header {
    display: flex;
    scroll-margin-top: 64px;
  }

  .lp-features-panel {
    display: block !important;
  }

  .lp-features-panel-inner {
    display: none;
    padding-bottom: 16px;
  }

  .lp-features-panel-active .lp-features-panel-inner {
    display: flex;
  }

  .lp-features-panel-active .lp-accordion-chevron {
    transform: rotate(180deg);
  }
}

/* --- Platform section heading --- */

.lp-platform-section .lp-section-inner {
  flex-direction: column;
  align-items: flex-start;
}

.lp-platform-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  color: #0D122D;
  margin: 0 0 48px;
  letter-spacing: -1px;
}

@media (max-width: 1225px) {
  .lp-platform-headline {
    font-size: 42px;
  }
}

@media (max-width: 640px) {
  .lp-platform-headline {
    font-size: 32px;
  }

  .lp-platform-section {
    padding: 48px 16px 40px;
  }
}

/* --- Bento Grid (Platform section) --- */

.lp-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
}

.lp-bento-card {
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.lp-bento-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
}

.lp-bento-visual {
  padding: 32px 32px 0;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.lp-bento-visual .lp-cost-funnel,
.lp-bento-visual .lp-letter-mockup {
  transform: scale(0.85);
  transform-origin: top center;
}

.lp-bento-bottom {
  padding: 28px 32px 32px;
}

.lp-bento-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
}

.lp-bento-desc {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 16px;
  opacity: 0.8;
}

.lp-bento-link {
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.lp-bento-link:hover {
  text-decoration: underline;
}

/* Light card (white with border) */
.lp-bento-light {
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  color: #0D122D;
}

/* Muted card (light gray) */
.lp-bento-muted {
  background: #F7F9FB;
  color: #0D122D;
}

.lp-bento-light .lp-bento-link {
  color: #0029FF;
}

/* Green card */
.lp-bento-green {
  background: #00DF81;
  color: #0D122D;
}

.lp-bento-green .lp-bento-link {
  color: #0D122D;
}

/* Dark card */
.lp-bento-dark {
  background: #0D122D;
  color: #FFFFFF;
}

/* Blue card */
.lp-bento-blue {
  background: #0029FF;
  color: #FFFFFF;
}

.lp-bento-blue .lp-bento-link {
  color: #FFFFFF;
}

.lp-bento-blue .lp-cost-funnel {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 20px;
}

/* Full-width card */
.lp-bento-wide {
  grid-column: span 2;
}

/* Stacked column */
.lp-bento-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stat number */
.lp-bento-stat {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}

/* Compact visual (shorter mockup area) */
.lp-bento-visual-compact {
  padding: 24px 24px 0;
}

.lp-bento-visual-compact .lp-letter-mockup {
  transform: scale(0.78);
  transform-origin: top center;
}

/* Fill remaining stack height */
.lp-bento-fill {
  flex: 1;
}

/* Onboarding checklist mockup */
.lp-onboarding-mockup {
  background: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 280px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.lp-onboarding-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0D122D;
  margin-bottom: 12px;
}

.lp-onboarding-divider {
  height: 1px;
  background: #DFEAF2;
  margin-bottom: 14px;
}

.lp-onboarding-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: #56596C;
}

.lp-onboarding-done span {
  color: #0D122D;
}

.lp-onboarding-badge {
  margin-top: 14px;
  padding: 6px 12px;
  background: #D9FAEC;
  color: #00875A;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

/* Quote card */
.lp-bento-quote-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
}

.lp-bento-quote-mark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 0.8;
  color: #0029FF;
  opacity: 0.3;
  margin-bottom: 16px;
}

.lp-bento-quote-text {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.6;
  color: #0D122D;
  margin: 0 0 24px;
  font-style: normal;
}

.lp-bento-quote-footer {
  margin-top: auto;
}

.lp-bento-quote-name {
  font-size: 15px;
  font-weight: 700;
  color: #0D122D;
}

.lp-bento-quote-role {
  font-size: 13px;
  color: #56596C;
  margin-top: 2px;
}

@media (max-width: 1225px) {
  .lp-bento-headline {
    font-size: 22px;
  }

  .lp-bento-visual .lp-cost-funnel,
  .lp-bento-visual .lp-letter-mockup {
    transform: scale(0.75);
  }
}

@media (max-width: 640px) {
  .lp-bento-grid {
    grid-template-columns: 1fr;
  }

  .lp-bento-wide {
    grid-column: span 1;
  }

  .lp-bento-visual {
    padding: 24px 24px 0;
  }

  .lp-bento-bottom {
    padding: 20px 24px 28px;
  }

  .lp-bento-stat {
    font-size: 28px;
  }
}

/* ==========================================================================
   ADMIN DASHBOARD
   Scrollable table, sticky header/column, fixed panel
   ========================================================================== */

/* ---------- scrollable table wrapper ---------- */
.admin-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 8px;
}

/* ---------- real <table> ---------- */
.admin-table {
  width: 100%;
  min-width: 1030px;                 /* sum of column min-widths */
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--color-mirage-05, #F3F3F5);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-mirage-80, #3D4157);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.admin-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  white-space: nowrap;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- pinned (sticky) first column ---------- */
.admin-col-pin {
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: inherit;
  min-width: 240px;
  width: 240px;
  white-space: normal;
}

/* header corner cell: sticky both directions */
.admin-table thead th.admin-col-pin {
  z-index: 4 !important;
  background-color: var(--color-mirage-05, #F3F3F5);
}

/* pin shadow when scrolled horizontally */
.admin-col-pin::after {
  content: "";
  position: absolute;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 6px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(0,0,0,0.04), transparent);
}

/* ---------- column widths ---------- */
.admin-col-role     { min-width: 80px;  width: 80px; }
.admin-col-status   { min-width: 90px;  width: 90px; }
.admin-col-vertical { min-width: 100px; width: 100px; }
.admin-col-num      { min-width: 85px;  width: 85px; }
.admin-col-api      { min-width: 120px; width: 120px; }
.admin-col-date     { min-width: 120px; width: 120px; }
.admin-col-email    { min-width: 180px; width: 180px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Admin page container */
.admin-page-container { max-width: 1400px; margin: 0 auto; }

/* Inline edit input */
.inline-edit-input { padding: 4px 8px; height: 30px; }

/* Inline edit pencil icon */
.inline-edit-pencil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: none;
  background: none;
  color: var(--color-mirage-70, #56596C);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.inline-edit-pencil:hover {
  color: var(--color-primary, #0029FF);
}

tr:hover .inline-edit-pencil,
.admin-col-pin:hover .inline-edit-pencil,
div:hover > .inline-edit-pencil,
div:hover > div > .inline-edit-pencil,
div:hover > div > div > .inline-edit-pencil {
  opacity: 1;
}

/* Always show pencil in the detail panel */
.admin-panel .inline-edit-pencil {
  opacity: 0.6;
}

.admin-panel .inline-edit-pencil:hover {
  opacity: 1;
}

/* ---------- row styles ---------- */
.admin-table-row {
  cursor: pointer;
  background-color: white;
}

.admin-table-row:hover td {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.admin-table-row:hover .admin-col-pin {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.admin-row-alt {
  background-color: var(--color-gray-05, #FAFAFA);
}

.admin-row-alt .admin-col-pin {
  background-color: var(--color-gray-05, #FAFAFA);
}

/* active row */
.admin-row-active td {
  background-color: var(--color-blue-05, #F2F4FF) !important;
}

.admin-row-active .admin-col-pin {
  background-color: var(--color-blue-05, #F2F4FF) !important;
  box-shadow: inset 3px 0 0 var(--color-blue, #0029FF);
}

/* ---------- fixed full-height panel ---------- */
.admin-panel {
  position: fixed;
  top: 12px;
  right: -440px;
  bottom: 12px;
  width: 420px;
  background-color: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  overflow-y: auto;
  z-index: 70;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-panel-open {
  right: 12px;
}

.admin-panel-content {
  min-width: 420px;
}

/* push page content when panel opens */
.admin-panel-pushed {
  padding-right: 444px !important;   /* 420 + original 24 */
  transition: padding-right 0.3s ease;
}

/* Filter chips */
.admin-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--color-link-water, #DFEAF2);
  background-color: white;
  color: var(--color-mirage-70, #56596C);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.admin-chip:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.admin-chip-active {
  background-color: var(--color-blue, #0029FF);
  color: white;
  border-color: var(--color-blue, #0029FF);
}

.admin-chip-active:hover {
  background-color: var(--color-blue-90, #1A3EFF);
}

/* Vertical badge */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.admin-badge-vertical {
  background-color: var(--color-blue-05, #F2F4FF);
  color: var(--color-blue, #0029FF);
}

/* Stat boxes in detail panel */
.admin-stat-box {
  background-color: var(--color-mirage-05, #F3F3F5);
  border-radius: 9px;
  padding: 12px 16px;
}

/* Product chips */
.admin-product-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage-70, #56596C);
}

.admin-product-chip-active {
  background-color: var(--color-secondary-token-green-light, #D9FAEC);
  color: var(--color-token-green, #00DF81);
}

/* Sparkline container */
.admin-sparkline {
  width: 100%;
}

/* ==========================================================================
   INTAKE LINKS — Generate Link Modal
   ========================================================================== */

.generate-link-mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #56596C;
  background: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.generate-link-mode-btn:hover {
  border-color: #0029FF;
  color: #3D4157;
}

.generate-link-mode-btn.generate-link-mode-active {
  background: #F2F4FF;
  border-color: #0029FF;
  color: #0029FF;
}

/* ==========================================================================
   INTAKE LINKS — Public Intake Form
   ========================================================================== */

.intake-layout {
  min-height: 100vh;
  background: #F7F9FB;
  display: flex;
  flex-direction: column;
}

.intake-header {
  background: #ffffff;
  border-bottom: 1px solid #DFEAF2;
  padding: 20px 24px;
}

.intake-header-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.intake-company-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #F2F4FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.intake-company-logo svg {
  width: 22px;
  height: 22px;
  color: #0029FF;
}

.intake-company-name {
  font-size: 16px;
  font-weight: 600;
  color: #0D122D;
}

.intake-body {
  flex: 1;
  padding: 32px 24px;
}

.intake-card {
  max-width: 640px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 12px;
  padding: 32px;
}

.intake-section {
  margin-bottom: 28px;
}

.intake-section:last-child {
  margin-bottom: 0;
}

.intake-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #0D122D;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #DFEAF2;
}

.intake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.intake-grid-full {
  grid-column: 1 / -1;
}

.intake-upload-zone {
  border: 2px dashed #DFEAF2;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.intake-upload-zone:hover {
  border-color: #0029FF;
  background: #F2F4FF;
}

.intake-upload-zone.has-files {
  border-color: #00DF81;
  background: #F0FDF4;
}

.intake-upload-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  color: #868896;
}

.intake-upload-zone:hover .intake-upload-icon {
  color: #0029FF;
}

.intake-upload-label {
  font-size: 14px;
  font-weight: 500;
  color: #3D4157;
}

.intake-upload-hint {
  font-size: 12px;
  color: #868896;
  margin-top: 4px;
}

.intake-file-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intake-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3D4157;
}

.intake-file-item svg {
  width: 14px;
  height: 14px;
  color: #00DF81;
  flex-shrink: 0;
}

.intake-footer {
  padding: 20px 24px;
  text-align: center;
}

.intake-footer-text {
  font-size: 12px;
  color: #868896;
}

.intake-footer-text a {
  color: #0029FF;
  text-decoration: none;
}

.intake-disclaimer {
  font-size: 12px;
  color: #868896;
  line-height: 1.5;
  margin-top: 16px;
}

/* Success page */
.intake-success {
  max-width: 480px;
  margin: 80px auto 0;
  text-align: center;
  padding: 40px;
  background: #ffffff;
  border: 1px solid #DFEAF2;
  border-radius: 12px;
}

.intake-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: #E8F5E9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intake-success-icon svg {
  width: 32px;
  height: 32px;
  color: #2E7D32;
}

.intake-success-title {
  font-size: 20px;
  font-weight: 600;
  color: #0D122D;
  margin-bottom: 8px;
}

.intake-success-message {
  font-size: 14px;
  color: #56596C;
  line-height: 1.6;
}

/* ==========================================================================
   INTAKE LINKS — Management Page
   ========================================================================== */

.intake-link-recipient {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.intake-link-recipient-name {
  font-weight: 500;
  color: #3D4157;
  font-size: 14px;
}

.intake-link-recipient-email {
  font-size: 12px;
  color: #868896;
}

/* Column widths for intake links table */
.col-recipient {
  width: 200px;
  min-width: 200px;
  padding: 0 12px;
}

.col-workflow-name {
  width: 170px;
  min-width: 170px;
  padding: 0 12px;
}

.col-il-status {
  width: 110px;
  min-width: 110px;
  padding: 0 12px;
}

.col-il-created {
  width: 140px;
  min-width: 140px;
  padding: 0 12px;
}

.col-il-expires {
  width: 140px;
  min-width: 140px;
  padding: 0 12px;
}

@media (max-width: 768px) {
  .intake-grid {
    grid-template-columns: 1fr;
  }

  .intake-card {
    padding: 24px 20px;
  }
}

/* ==========================================================================
   INTAKE LINKS — Index page + Generate modal
   ========================================================================== */

/* Generate-link modal sizing (replaces inline max-width) */
.generate-link-modal {
  max-width: 520px;
}

/* Body padding (replaces inline style) */
.generate-link-body {
  padding: 20px 24px;
}

/* Success icon for the result panel (replaces inline hex) */
.generate-link-icon-success {
  background-color: #E6F9F0;
  color: #00A862;
}

/* Read-only URL display in result panel (replaces inline font/size styles) */
.intake-link-url-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* QR code container (replaces inline hex bg/border) */
.generate-link-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background-color: #F7F9FB;
  border: 1px solid #DFEAF2;
}

.generate-link-qr-image {
  width: 180px;
  height: 180px;
  border-radius: 4px;
}

/* Workflow picker rows on the Intake Links index */
.intake-workflow-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background-color: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.intake-workflow-pick:hover {
  background-color: #F2F4FF;
  border-color: #0029FF;
}

/* Lightweight toast for resend feedback */
.intake-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(13, 18, 45, 0.12);
  z-index: 9999;
}

.intake-toast-success {
  background-color: #E6F9F0;
  color: #00733F;
  border: 1px solid #B5EBD0;
}

.intake-toast-error {
  background-color: #FDECEE;
  color: #B11227;
  border: 1px solid #F8C6CC;
}

/* Public intake form helpers */
.intake-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.intake-submit-btn {
  padding: 14px 24px;
  font-size: 15px;
}

/* Input wrapper with a right-aligned action button (e.g. SSN visibility toggle) */
.form-field-input-wrapper {
  position: relative;
}

.form-field-input-with-action {
  padding-right: 40px;
}

.form-field-input-action {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  background: transparent;
  border: none;
  color: #56596C;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
}

.form-field-input-action:hover {
  color: #0029FF;
}

.form-field-eye {
  pointer-events: none;
}

/* Date input — match the height/padding of other text inputs. Browsers render
   date inputs with their own internal padding which makes them visually
   shorter than text inputs at the same nominal padding. Force consistency. */
.form-field-date {
  /* iOS/Safari shortens date inputs unless we set min-height to match */
  min-height: 40px;
  /* Chrome/Edge: line-height makes the value sit lower than text inputs */
  line-height: normal;
  /* Some browsers center the value text vertically only when display is set */
  display: block;
  -webkit-appearance: none;
  appearance: none;
}

.form-field-date::-webkit-datetime-edit {
  padding: 0;
}

.form-field-date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  margin-left: 4px;
}

/* Logo header on the public intake form */
.intake-company-logo-image {
  max-height: 40px;
  max-width: 200px;
  object-fit: contain;
}

/* Logo uploader inside the Generate Intake Link modal */
.intake-logo-uploader {
  border: 1px dashed #DFEAF2;
  border-radius: 8px;
  background-color: #F7F9FB;
  transition: border-color 0.15s, background-color 0.15s;
}

.intake-logo-uploader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 16px;
  cursor: pointer;
  text-align: center;
}

.intake-logo-uploader-empty:hover {
  background-color: #F2F4FF;
  border-color: #0029FF;
}

.intake-logo-uploader-icon {
  width: 28px;
  height: 28px;
  color: #56596C;
}

.intake-logo-uploader-label {
  font-size: 13px;
  font-weight: 500;
  color: #3D4157;
  margin: 0;
}

.intake-logo-uploader-hint {
  font-size: 12px;
  color: #868896;
  margin: 0;
}

.intake-logo-uploader-filled {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.intake-logo-uploader-preview {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  object-fit: contain;
  background-color: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 6px;
  padding: 4px;
}

.intake-logo-uploader-meta {
  flex: 1;
  min-width: 0;
}

.intake-logo-uploader-filename {
  font-size: 13px;
  color: #3D4157;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loosen vertical rhythm in the Generate Intake Link modal so labels and
   inputs aren't visually crammed against each other. */
.generate-link-body .form-field-group + .form-field-group {
  margin-top: 18px;
}

.generate-link-body .form-field-label {
  display: block;
  margin-bottom: 8px;
}

.generate-link-body .form-field-helper {
  margin-top: 8px;
}

/* Modal header: tighten title/subtitle stack and present the active cascade
   as an inline pill. */
.generate-link-title-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.generate-link-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #56596C;
  margin: 0;
}

.generate-link-using {
  font-weight: 500;
}

.generate-link-cascade-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background-color: #F2F4FF;
  color: #0029FF;
  border: 1px solid #DDE3FF;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Header layout when no branding is present — keep vertical rhythm but
   render nothing visible (no fake name fallback). */
.intake-header-empty {
  min-height: 0;
  padding: 8px 0;
  border-bottom: none;
}

/* "Awaiting" header on the Executions page — surfaces queued submissions
   and outstanding intake links above the executions table. */
.intake-awaiting-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.intake-awaiting-section {
  background-color: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 12px;
  overflow: hidden;
}

.intake-awaiting-section-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #F2F4FF;
}

.intake-awaiting-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0D122D;
  margin: 0;
}

.intake-awaiting-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.intake-awaiting-dot-yellow { background-color: #FFBB38; }
.intake-awaiting-dot-blue { background-color: #00C1FF; }

.intake-awaiting-count {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  background-color: #F2F4FF;
  color: #0029FF;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.intake-awaiting-hint {
  font-size: 12px;
  color: #56596C;
  margin: 4px 0 0;
}

.intake-awaiting-rows {
  display: flex;
  flex-direction: column;
}

.intake-awaiting-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid #F2F4FF;
}

.intake-awaiting-row:first-child {
  border-top: none;
}

.intake-awaiting-row-main,
.intake-awaiting-row-cascade {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.intake-awaiting-applicant {
  font-size: 14px;
  font-weight: 500;
  color: #0D122D;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-awaiting-meta {
  font-size: 12px;
  color: #56596C;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-awaiting-cascade-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background-color: #F2F4FF;
  color: #0029FF;
  border: 1px solid #DDE3FF;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-awaiting-row-actions {
  display: flex;
  gap: 8px;
}

.intake-awaiting-row-actions .btn-primary,
.intake-awaiting-row-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
}

.icon-16 {
  width: 16px;
  height: 16px;
}

/* Dashboard layout: recent cascades on the left, awaiting-review aside on
   the right. Both columns stretch to the same height. Stacks on narrow
   viewports. */
.dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: stretch;
  max-width: 1200px;
  margin: 24px auto 0;
}

/* When only one of the two cards has content, collapse the grid to a single
   column so we don't render an empty 1.6fr placeholder beside it. */
.dashboard-row-single {
  grid-template-columns: 1fr;
}

@media (max-width: 960px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

/* When the recent-cascades card lives inside the dashboard row, neutralise
   its standalone outer margins/max-width so the grid controls layout. */
.dashboard-row .dashboard-row-main {
  margin: 0;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-row-main .dashboard-recent-list {
  flex: 1;
}

.dashboard-row-aside {
  min-width: 0;
  display: block;
}

.awaiting-review-card {
  background-color: #FFFFFF;
  border: 1px solid #DFEAF2;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.awaiting-review-card .divider {
  margin: 16px 0;
}

.awaiting-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.awaiting-review-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0D122D;
}

.awaiting-review-count {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 999px;
  background-color: #FFF6E1;
  color: #B17A00;
  border: 1px solid #FFE6A8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

.awaiting-review-view-all {
  font-size: 13px;
  flex-shrink: 0;
}

.awaiting-review-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 32px 8px;
  flex: 1;
  justify-content: center;
}

.awaiting-review-empty-icon {
  width: 32px;
  height: 32px;
  color: #00A862;
  margin-bottom: 4px;
}

.awaiting-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.awaiting-review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #F2F4FF;
}

.awaiting-review-item:first-child {
  border-top: none;
  padding-top: 0;
}

.awaiting-review-item-main {
  flex: 1;
  min-width: 0;
}

.awaiting-review-applicant {
  font-size: 14px;
  font-weight: 500;
  color: #0D122D;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.awaiting-review-meta {
  font-size: 12px;
  color: #56596C;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.awaiting-review-action {
  flex-shrink: 0;
  padding: 6px 14px;
}

/* Rows/cards that navigate on double-click / double-tap (row_link_controller.js)
   signal their interactivity with a pointer cursor. */
[data-controller~="row-link"] { cursor: pointer; }

/* ==========================================================================
   Guided "define your decisions" overlay (cascade builder)
   Floating, collapsible corner panel listing the cascade's Decision nodes as a
   checklist. Motion design system (the builder chrome is Motion). Behaviour:
   app/javascript/controllers/decision_guide_controller.js
   ========================================================================== */
.decision-guide {
  position: fixed;
  left: 356px; /* just right of the 340px node palette */
  top: 72px;   /* just below the 56px toolbar */
  z-index: 900;
  width: 320px;
  transition: left 0.2s ease;
}
/* When the node palette collapses (width: 0), hug the left edge instead.
   Matches the sidebar's own width transition. */
.decision-guide.is-sidebar-collapsed { left: 16px; }
/* Hidden while a decision modal is open (it would overlap the modal). */
.decision-guide.is-suppressed { display: none; }

/* Collapsed pill — also the reopen affordance. */
.decision-guide-pill {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-mirage, #0D122D);
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(13, 18, 45, 0.28);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.decision-guide-pill:hover { background: #1b2347; }
.decision-guide-pill-icon { width: 16px; height: 16px; flex-shrink: 0; }
.decision-guide-pill-badge {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
}
.decision-guide.is-collapsed .decision-guide-pill { display: inline-flex; }
.decision-guide.is-collapsed .decision-guide-panel { display: none; }
.decision-guide.is-complete .decision-guide-pill-badge {
  background: var(--color-token-green, #00DF81);
  color: var(--color-mirage, #0D122D);
}

/* Expanded panel */
.decision-guide-panel {
  background: #fff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(13, 18, 45, 0.20);
  overflow: hidden;
}
.decision-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}
.decision-guide-title { flex: 1; padding-right: 8px; font-size: 14px; font-weight: 700; color: var(--color-mirage, #0D122D); }
.decision-guide-collapse {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 6px;
  color: var(--color-mirage-60, #6E7181); cursor: pointer;
}
.decision-guide-collapse:hover { background: var(--color-mirage-05, #F3F3F5); }
.decision-guide-collapse svg { width: 16px; height: 16px; }

.decision-guide-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.decision-guide-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.decision-guide-item:hover {
  background: var(--color-mirage-05, #F3F3F5);
  border-color: var(--color-link-water, #DFEAF2);
}

/* Status indicator: amber ring (to-do) → green check (done) */
.decision-guide-status {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-token-yellow, #FFBB38);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.decision-guide-status-check { width: 14px; height: 14px; opacity: 0; }
.decision-guide-item.is-done .decision-guide-status {
  background: var(--color-token-green, #00DF81);
  border-color: var(--color-token-green, #00DF81);
}
.decision-guide-item.is-done .decision-guide-status-check { opacity: 1; }

.decision-guide-item-name {
  flex: 1;
  min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--color-mirage, #0D122D);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.decision-guide-item-arrow { width: 16px; height: 16px; flex-shrink: 0; color: var(--color-mirage-30, #B6B8C0); }
.decision-guide-item:hover .decision-guide-item-arrow { color: var(--color-mirage-60, #6E7181); }

/* ==========================================================================
   AI cascade builder
   Bespoke chrome for the "AI builds a cascade" entry screen + the in-place
   build animation (app/views/cascade_ai/*). Operator/apex surface → Motion
   tokens only (var(--color-*)); no hardcoded brand colors. Structural-only
   utilities (flex/gap/etc.) come from application.css elsewhere.
   ========================================================================== */

/* ----- entry screen: header ----- */
.cascade-ai { padding-top: 8px; }

.cascade-ai-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}
.cascade-ai-back .icon-18 { width: 18px; height: 18px; }

.cascade-ai-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary, #0029FF);
  margin: 0 0 8px;
}
.cascade-ai-greeting {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 10px;
}
.cascade-ai-subtitle {
  font-size: 15px;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 0 20px;
}

/* ----- entry screen: mode cards ----- */
.cascade-ai-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .cascade-ai-modes { grid-template-columns: 1fr; }
}

.cascade-ai-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 18px;
  background: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.cascade-ai-mode:hover {
  border-color: var(--color-mirage-30, #B6B8C0);
  transform: translateY(-1px);
}
.cascade-ai-mode.is-selected {
  border-color: var(--color-primary, #0029FF);
  box-shadow: 0 0 0 3px var(--color-primary-light, #E6EAFF);
}

.cascade-ai-mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--color-app-bg, #F7F9FB);
  color: var(--color-mirage-70, #56596C);
}
.cascade-ai-mode-icon svg { width: 20px; height: 20px; }
.cascade-ai-mode-icon-accent {
  background: var(--color-primary-light, #E6EAFF);
  color: var(--color-primary, #0029FF);
}

.cascade-ai-mode-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
}
.cascade-ai-mode-desc {
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
}

/* ----- entry screen: panels ----- */
.cascade-ai-panel { margin-bottom: 24px; }

.cascade-ai-textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  margin-top: 8px;
}

.cascade-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.cascade-ai-chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage-80, #3D4157);
  background: var(--color-app-bg, #F7F9FB);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 9999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cascade-ai-chip:hover {
  background: var(--color-primary-light, #E6EAFF);
  border-color: var(--color-primary, #0029FF);
  color: var(--color-primary, #0029FF);
}

.cascade-ai-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.cascade-ai-helper { margin: 0; max-width: 460px; }
.cascade-ai-scratch-blurb { font-size: 15px; line-height: 1.6; margin: 0; }

/* "Generate cascade" CTA (sparkle) — the standard blue primary action. */
.btn-cascade-ai-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-white, #FFFFFF);
  background: var(--color-primary, #0029FF);
  border: none;
  border-radius: 9px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-cascade-ai-generate:hover { background: #001fcf; }
.btn-cascade-ai-generate:active { transform: translateY(1px); }
.btn-cascade-ai-generate .icon-18 { width: 18px; height: 18px; color: var(--color-white, #FFFFFF); }
.btn-cascade-ai-generate:disabled,
.btn-cascade-ai-generate.is-busy {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}
.btn-cascade-ai-generate:disabled:hover,
.btn-cascade-ai-generate.is-busy:hover { background: var(--color-primary, #0029FF); }

/* ----- entry screen: dropzone ----- */
.cascade-ai-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 40px 24px;
  border: 2px dashed var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  background: var(--color-app-bg, #F7F9FB);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cascade-ai-dropzone:hover { border-color: var(--color-primary, #0029FF); }
.cascade-ai-dropzone.is-dragover {
  border-color: var(--color-primary, #0029FF);
  background: var(--color-primary-light, #E6EAFF);
}
.cascade-ai-dropzone.has-file { border-color: var(--color-primary, #0029FF); border-style: solid; }
.cascade-ai-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cascade-ai-dropzone-icon { width: 32px; height: 32px; color: var(--color-mirage-70, #56596C); }
.cascade-ai-dropzone-title { font-size: 14px; font-weight: 600; color: var(--color-mirage, #0D122D); }
.cascade-ai-dropzone-hint { font-size: 13px; color: var(--color-muted, #868896); }

/* client-side PDF validation message */
.cascade-ai-file-error { margin-top: 10px; }

/* ----- designing screen (SCREEN 2) ----- */
.cascade-ai-designing {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  margin-top: 8px;
}
@media (max-width: 860px) {
  .cascade-ai-designing { grid-template-columns: 1fr; }
}

.cascade-ai-designing-left { min-width: 0; }

.cascade-ai-designing-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.cascade-ai-chip-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary, #0029FF);
  background: var(--color-primary-light, #E6EAFF);
  border-radius: 9999px;
  padding: 4px 12px;
}
.cascade-ai-chip-status svg { width: 14px; height: 14px; }

/* honest mock/live badge */
.cascade-ai-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 9999px;
  padding: 4px 10px;
}
.cascade-ai-badge-mock {
  color: var(--color-mirage-80, #3D4157);
  background: var(--color-secondary-token-yellow-light, #FFF5D9);
  border: 1px solid var(--color-token-yellow, #FFBB38);
}
.cascade-ai-badge-live {
  color: var(--color-mirage-70, #56596C);
  background: var(--color-mirage-05, #F3F3F5);
  border: 1px solid var(--color-link-water, #DFEAF2);
}

.cascade-ai-designing-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
}

.cascade-ai-progress {
  position: relative;
  height: 6px;
  border-radius: 9999px;
  background: var(--color-mirage-05, #F3F3F5);
  overflow: hidden;
  margin-bottom: 20px;
}
.cascade-ai-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 9999px;
  background: var(--color-primary, #0029FF);
  transition: width 0.5s ease;
}
/* indeterminate sweep during the real (unknown-length) generation wait */
.cascade-ai-progress.is-indeterminate .cascade-ai-progress-bar {
  width: 40%;
  transition: none;
  animation: cascade-ai-indeterminate 1.2s ease-in-out infinite;
}
@keyframes cascade-ai-indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

/* ----- checklist ----- */
.cascade-ai-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cascade-ai-check { display: flex; align-items: flex-start; gap: 10px; }

.cascade-ai-check-mark {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 1.5px solid var(--color-mirage-20, #CFD0D5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.cascade-ai-check-icon { width: 12px; height: 12px; color: var(--color-white, #FFFFFF); opacity: 0; }
.cascade-ai-check-spinner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  border: 1.5px solid var(--color-primary-light, #E6EAFF);
  border-top-color: var(--color-primary, #0029FF);
  opacity: 0;
}
.cascade-ai-check.is-loading .cascade-ai-check-mark { border-color: var(--color-primary, #0029FF); }
.cascade-ai-check.is-loading .cascade-ai-check-spinner { opacity: 1; animation: cascade-ai-spin 0.7s linear infinite; }
.cascade-ai-check.is-done .cascade-ai-check-mark {
  background: var(--color-token-green, #00DF81);
  border-color: var(--color-token-green, #00DF81);
}
.cascade-ai-check.is-done .cascade-ai-check-icon { opacity: 1; }

.cascade-ai-check-label { font-size: 14px; line-height: 1.4; color: var(--color-mirage-70, #56596C); }
.cascade-ai-check.is-done .cascade-ai-check-label { color: var(--color-mirage, #0D122D); }

@keyframes cascade-ai-spin { to { transform: rotate(360deg); } }

/* ----- warnings banner ----- */
.cascade-ai-warnings { margin-top: 20px; }
.cascade-ai-warning-list {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ----- error state -----
   When generation fails (a real error OR a guardrail rejection), the controller
   adds .is-error to .cascade-ai-designing: the in-progress chrome (status chip,
   badge, progress bar, checklist, warnings, and the canvas) is hidden and the
   centered error CARD takes over the full grid. */
.cascade-ai-designing.is-error {
  /* Collapse the two-column build layout to a single centered column. */
  grid-template-columns: 1fr;
}
.cascade-ai-designing.is-error .cascade-ai-designing-left,
.cascade-ai-designing.is-error .cascade-ai-canvas {
  display: none;
}

.cascade-ai-error {
  /* Span the full grid and center the card. */
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.cascade-ai-error:focus { outline: none; }

.cascade-ai-error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  max-width: 460px;
  width: 100%;
  padding: 36px 28px;
  background: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 14px;
}

.cascade-ai-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  background: var(--color-secondary-token-red-light, #FFE0EB);
  color: var(--color-token-red, #FA3A55);
}
.cascade-ai-error-icon svg { width: 26px; height: 26px; }

.cascade-ai-error-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.cascade-ai-error-msg {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  max-width: 40ch;
}

/* suggestion: "Try something like:" + a clickable example prompt */
.cascade-ai-error-suggest {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}
.cascade-ai-error-suggest-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-mirage-70, #56596C);
  margin: 0;
}
.cascade-ai-error-chip {
  width: 100%;
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-mirage-80, #3D4157);
  background: var(--color-app-bg, #F7F9FB);
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.cascade-ai-error-chip:hover {
  border-color: var(--color-primary, #0029FF);
  background: var(--color-primary-light, #E6EAFF);
  color: var(--color-primary, #0029FF);
}
.cascade-ai-error-chip:focus-visible {
  outline: 2px solid var(--color-primary, #0029FF);
  outline-offset: 2px;
}

.cascade-ai-error-action { margin-top: 6px; }

/* ----- right canvas: dotted grid + flow cards ----- */
.cascade-ai-canvas {
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 12px;
  background-color: var(--color-white, #FFFFFF);
  background-image: radial-gradient(var(--color-mirage-05, #F3F3F5) 1.4px, transparent 1.4px);
  background-size: 18px 18px;
  padding: 28px 24px;
  min-height: 420px;
  overflow: auto;
}
.cascade-ai-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cascade-ai-node, .cascade-ai-node-row {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.cascade-ai-node.is-in, .cascade-ai-node-row.is-in { opacity: 1; transform: translateY(0); }
/* the decision card is nested inside the row; reveal it with its row */
.cascade-ai-node-row.is-in .cascade-ai-node { opacity: 1; transform: translateY(0); }

.cascade-ai-node {
  width: 260px;
  border-radius: 10px;
  padding: 12px 14px;
}
.cascade-ai-node-title { display: block; font-size: 14px; font-weight: 600; }
.cascade-ai-node-sub { display: block; font-size: 12px; margin-top: 2px; }

.cascade-ai-node-applicant {
  display: flex;
  flex-direction: column;
  background: var(--color-mirage, #0D122D);
  color: var(--color-white, #FFFFFF);
}
.cascade-ai-node-applicant .cascade-ai-node-sub { color: var(--color-mirage-30, #B6B8C0); }

.cascade-ai-node-product, .cascade-ai-node-simple {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-white, #FFFFFF);
  border: 1px solid var(--color-link-water, #DFEAF2);
}
.cascade-ai-node-product .cascade-ai-node-title,
.cascade-ai-node-simple .cascade-ai-node-title { color: var(--color-mirage, #0D122D); }
.cascade-ai-node-product .cascade-ai-node-sub,
.cascade-ai-node-simple .cascade-ai-node-sub { color: var(--color-mirage-70, #56596C); }

.cascade-ai-node-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--color-secondary-token-green-light, #D9FAEC);
  color: var(--color-emerald, #16DBCC);
}
.cascade-ai-node-badge svg { width: 18px; height: 18px; }
.cascade-ai-node-body { display: flex; flex-direction: column; min-width: 0; }

/* decision card + fail chip laid out side by side */
.cascade-ai-node-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.cascade-ai-node-decision {
  display: flex;
  flex-direction: column;
  background: var(--color-white, #FFFFFF);
  border: 1.5px dashed var(--color-mirage-30, #B6B8C0);
}
.cascade-ai-node-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-mirage-70, #56596C);
}
.cascade-ai-node-decision .cascade-ai-node-title { color: var(--color-mirage, #0D122D); margin-top: 2px; }
.cascade-ai-node-cond {
  display: inline-block;
  align-self: flex-start;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
  background: var(--color-mirage-05, #F3F3F5);
  border-radius: 6px;
  padding: 2px 8px;
}
.cascade-ai-node-cond:empty { display: none; }

.cascade-ai-fail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-token-red, #FA3A55);
  background: var(--color-secondary-token-red-light, #FFE0EB);
  border-radius: 8px;
  padding: 6px 10px;
}
.cascade-ai-fail-chip svg { width: 12px; height: 12px; }

/* vertical connector between cards */
.cascade-ai-connector {
  width: 2px;
  height: 22px;
  background: var(--color-link-water, #DFEAF2);
}

/* invalid-input nudge */
.cascade-ai-shake { animation: cascade-ai-shake 0.4s ease; }
@keyframes cascade-ai-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* ----- reduced motion ----- */
/* Respect users who ask for less motion: drop entrance transitions, the
   spinner/indeterminate sweep, and the shake. The JS also skips its per-node
   await delays and renders the flowchart at once. */
@media (prefers-reduced-motion: reduce) {
  .cascade-ai-mode,
  .cascade-ai-mode:hover { transform: none; transition: none; }
  .cascade-ai-node,
  .cascade-ai-node-row {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cascade-ai-progress-bar { transition: none; }
  .cascade-ai-progress.is-indeterminate .cascade-ai-progress-bar { animation: none; }
  .cascade-ai-check.is-loading .cascade-ai-check-spinner { animation: none; }
  .cascade-ai-shake { animation: none; }
  .btn-cascade-ai-generate:active { transform: none; }
}
