/* /tools/pharmacode-generator: How it works (cartons with a Pharmacode ride under a line camera; 1234 passes, a wrong code is rejected). */
.hub-anim.ha-pharmacode-generator .ha-stage { min-height: 0; border: 1px solid #a7e8cf; background: linear-gradient(180deg, #f2fcf8 0%, #e1f7ee 65%, #ccf0e1 100%); }
.hub-anim.ha-pharmacode-generator .sc { display: flex; align-items: center; justify-content: center; min-height: 270px; }
.hub-anim.ha-pharmacode-generator .ph-line { position: relative; width: 560px; max-width: 100%; height: 250px; overflow: hidden; }
.hub-anim.ha-pharmacode-generator .ph-cam { position: absolute; z-index: 3; left: 50%; top: 0; width: 150px; margin-left: -75px; padding: 10px 12px; background: #134e4a; border-radius: 12px; box-sizing: border-box; box-shadow: 0 12px 22px -14px rgba(19, 78, 74, .8); }
.hub-anim.ha-pharmacode-generator .ph-lens { position: absolute; left: 50%; bottom: -9px; width: 26px; height: 12px; margin-left: -13px; background: #0f766e; border-radius: 0 0 10px 10px; }
.hub-anim.ha-pharmacode-generator .ph-read { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; margin: 0; padding: 6px 8px; background: #042f2e; border-radius: 6px; font: 700 .74rem/1 ui-monospace, Menlo, Consolas, monospace; color: #99f6e4; }
.hub-anim.ha-pharmacode-generator .ph-read span { font: 800 .62rem/1 Manrope, Inter, sans-serif; padding: 3px 6px; border-radius: 999px; }
.hub-anim.ha-pharmacode-generator .ph-read b, .hub-anim.ha-pharmacode-generator .ph-read span { grid-row: 1; } .hub-anim.ha-pharmacode-generator .ph-read b { grid-column: 1; } .hub-anim.ha-pharmacode-generator .ph-read span { grid-column: 2; justify-self: end; } .hub-anim.ha-pharmacode-generator .ph-n2, .hub-anim.ha-pharmacode-generator .ph-bad { visibility: hidden; } .hub-anim.ha-pharmacode-generator .ph-ok { background: #14b8a6; color: #042f2e; } .hub-anim.ha-pharmacode-generator .ph-bad { background: #ef4444; color: #fff; }
.hub-anim.ha-pharmacode-generator .ph-ray { position: absolute; left: 50%; top: 100%; width: 90px; height: 92px; margin: 6px 0 0 -45px; background: linear-gradient(180deg, rgba(20, 184, 166, .35), rgba(20, 184, 166, 0)); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.hub-anim.ha-pharmacode-generator .ph-belt { position: absolute; left: 0; right: 0; bottom: 26px; height: 92px; }
.hub-anim.ha-pharmacode-generator .ph-box { position: absolute; bottom: 0; left: calc(50% - 60px); width: 120px; height: 88px; padding: 12px 18px 0; background: linear-gradient(180deg, #ffffff 0 62%, #e7f6ef 62% 100%); border: 2px solid #134e4a; border-radius: 6px; box-sizing: border-box; }
.hub-anim.ha-pharmacode-generator .ph-box::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 10px; height: 4px; border-radius: 2px; background: #99d8c2; }
.hub-anim.ha-pharmacode-generator .ph-bars { display: block; width: 100%; height: 40px; fill: #042f2e; }
.hub-anim.ha-pharmacode-generator .ph-x1 { transform: translateX(-190px); } .hub-anim.ha-pharmacode-generator .ph-x3 { transform: translateX(190px); }
.hub-anim.ha-pharmacode-generator .ph-rail { position: absolute; left: 0; right: 0; bottom: 8px; height: 18px; background: repeating-linear-gradient(90deg, #134e4a 0 4px, #2dd4bf 4px 26px); border-radius: 9px; opacity: .9; }
@media (max-width: 640px) {
 .hub-anim.ha-pharmacode-generator .ph-line { height: 236px; } .hub-anim.ha-pharmacode-generator .ph-box { width: 100px; height: 80px; left: calc(50% - 50px); padding: 10px 14px 0; } .hub-anim.ha-pharmacode-generator .ph-x1 { transform: translateX(-130px); } .hub-anim.ha-pharmacode-generator .ph-x3 { transform: translateX(130px); }
}
/* Reduced motion: one carton under the camera, read as 1234, right leaflet. */
@media (prefers-reduced-motion: no-preference) {
 .hub-anim.ha-pharmacode-generator .ph-box { animation: ph-move 10s linear infinite both; } .hub-anim.ha-pharmacode-generator .ph-x1 { animation-delay: -6.6667s; } .hub-anim.ha-pharmacode-generator .ph-x3 { animation-delay: -3.3333s; }
 .hub-anim.ha-pharmacode-generator .ph-x3 { animation-name: ph-move-reject; }
 .hub-anim.ha-pharmacode-generator .ph-ok { animation: ph-ok 10s steps(1, end) infinite both; } .hub-anim.ha-pharmacode-generator .ph-bad { animation: ph-bad 10s steps(1, end) infinite both; }
 .hub-anim.ha-pharmacode-generator .ph-n1 { animation: ph-ok 10s steps(1, end) infinite both; } .hub-anim.ha-pharmacode-generator .ph-n2 { animation: ph-bad 10s steps(1, end) infinite both; }
 .hub-anim.ha-pharmacode-generator .ph-rail { animation: ph-rail 1s linear infinite; }
 @keyframes ph-move { 0% { transform: translateX(-330px); } 100% { transform: translateX(330px); } }
 @keyframes ph-move-reject { 0% { transform: translateX(-330px); opacity: 1; } 50% { transform: translateX(0); opacity: 1; } 58% { transform: translateX(30px) translateY(110px) rotate(16deg); opacity: 0; } 100% { transform: translateX(330px); opacity: 0; } }
 @keyframes ph-rail { to { background-position: 26px 0; } }
 @keyframes ph-ok { 0%, 11% { visibility: visible; } 12%, 24% { visibility: hidden; } 25%, 100% { visibility: visible; } }
 @keyframes ph-bad { 0%, 11% { visibility: hidden; } 12%, 24% { visibility: visible; } 25%, 100% { visibility: hidden; } }
}
