/* Codinger interactive labs (labs.js) — light card UI on Codinger DS tokens. */
.lab { --lab-bg: #fff; background: var(--lab-bg); border: 1px solid var(--line, #E6E1F2); border-radius: 16px; padding: 20px; box-shadow: 0 10px 30px rgba(23, 37, 90, .08); color: var(--navy, #17255A); position: relative; transition: box-shadow .3s; }
.lab.is-won { box-shadow: 0 0 0 3px rgba(111, 203, 74, .55), 0 10px 30px rgba(23, 37, 90, .08); }
.lab-p { color: #5B6490; margin: 0 0 12px; font-size: .95rem; }
.lab-split { display: grid; gap: 18px; }
@media (min-width: 860px) { .lab-split { grid-template-columns: 1fr 1fr; align-items: start; } .lab-split--apps { grid-template-columns: 1.4fr 1fr; } }
@media (min-width: 860px) { .lab-split--py { grid-template-columns: 1fr; } }
.lab-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.lab-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; border: 0; border-radius: 10px; padding: 10px 18px; font: 800 .95rem var(--font-head, system-ui); background: #8E3FC0; color: #fff; cursor: pointer; box-shadow: 0 6px 16px rgba(94, 36, 130, .25); }
.lab-btn:hover { filter: brightness(1.08); }
.lab-btn--sm { padding: 7px 12px; font-size: .85rem; margin-top: 4px; }
.lab-btn--ghost { background: transparent; color: #17255A; box-shadow: inset 0 0 0 2px #17255A; }
.lab-in { font: 600 .92rem var(--font-body, system-ui); color: #17255A; border: 1.5px solid #E6E1F2; border-radius: 8px; padding: 6px 8px; background: #FBF9FF; }
.lab-in:focus { outline: none; border-color: #8E3FC0; box-shadow: 0 0 0 3px rgba(142, 63, 192, .15); }
.lab-status { margin-top: 14px; min-height: 1.4em; font-weight: 700; font-size: .95rem; border-radius: 10px; }
.lab-status.is-win, .lab-status.is-try, .lab-status.is-ok { padding: 10px 14px; }
.lab-status.is-win { background: #E6F6DE; color: #2F6B25; }
.lab-status.is-win i { color: #D1A92B; }
.lab-status.is-try { background: #FFF6DA; color: #7A5B00; }
.lab-status.is-ok { background: #E7F7FB; color: #0B6E80; }

/* code */
.lab-code { margin: 0; background: #0D1638; color: #E6E9FA; font: 500 .88rem/1.9 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 14px 16px; border-radius: 12px; overflow-x: auto; white-space: pre; text-align: left; }
.lab-code .c { color: #7F8BBE; }
.lab-code .lab-in { background: #1B275A; color: #FFD95A; border-color: #33458C; font-family: inherit; padding: 1px 6px; width: auto; }
.lab-code input.lab-in { width: 64px; }
.lab-chart { width: 100%; height: auto; background: #F7F5FD; border-radius: 12px; display: block; }
.lab-console { margin-top: 8px; height: 92px; overflow: auto; background: #0D1638; color: #9AF0B0; font: 500 .8rem/1.5 ui-monospace, Consolas, monospace; border-radius: 10px; padding: 8px 12px; text-align: left; }
.lab-console .bad { color: #FF9EA1; }

/* chatbot */
.lab-intent { display: grid; gap: 4px; margin-bottom: 10px; font-size: .9rem; }
.lab-intent small { color: #5B6490; }
.lab-chat { border: 1px solid #E6E1F2; border-radius: 14px; overflow: hidden; background: #F7F5FD; }
.lab-chat__head { background: #17255A; color: #fff; padding: 10px 14px; font-weight: 800; }
.lab-chat__head i { color: #13C1DE; }
.lab-chat__body { height: 300px; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.lab-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: .88rem; }
.lab-msg--u { align-self: flex-end; background: #8E3FC0; color: #fff; }
.lab-msg--b { align-self: flex-start; background: #fff; border: 1px solid #E6E1F2; }
.lab-msg--b.ok span { color: #46963A; } .lab-msg--b.no span { color: #E5484D; }
[dir="rtl"] .lab-msg--u { align-self: flex-start; } [dir="rtl"] .lab-msg--b { align-self: flex-end; }

/* ctf */
.lab-flags { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.lab-flag { border: 1.5px dashed #E6E1F2; border-radius: 12px; padding: 14px; transition: .2s; }
.lab-flag.is-got { border-style: solid; border-color: #6FCB4A; background: #F3FBEF; }
.lab-flag h4 { font: 800 1rem var(--font-head, system-ui); margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.lab-flag h4 span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #17255A; color: #FFD95A; font-size: .8rem; }
.lab-flag.is-got h4 span { background: #6FCB4A; color: #17255A; }
.lab-cipher { display: block; font: 700 .95rem ui-monospace, Consolas, monospace; background: #0D1638; color: #13C1DE; padding: 8px 10px; border-radius: 8px; letter-spacing: .08em; margin: 6px 0; text-align: left; }
.lab-plain { color: #FFD95A; }
.lab-range { width: 100%; accent-color: #8E3FC0; }
.lab-src { margin-top: 8px; font-size: .76rem; line-height: 1.6; }
.lab-pw { width: 100%; }
.lab-meter { height: 8px; border-radius: 99px; background: #EEE; margin: 8px 0 4px; overflow: hidden; }
.lab-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #E5484D, #FFD95A, #6FCB4A); transition: width .2s; }
.lab-crack code { font-size: .78rem; background: #F1E8FB; padding: 1px 6px; border-radius: 5px; }
.lab-submit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.lab-submit .lab-in { flex: 1 1 220px; }
.lab-submit .lab-btn { margin: 0; }
.lab-score { font: 800 1rem var(--font-head, system-ui); }

/* blocks (apps / forklift) */
.lab-palette, .lab-cmds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lab-block { border: 0; border-radius: 8px; padding: 8px 12px; font: 700 .82rem var(--font-body, system-ui); cursor: pointer; color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); text-align: left; }
.lab-block--purple { background: #8E3FC0; } .lab-block--yellow { background: #FFD95A; color: #17255A; } .lab-block--cyan { background: #13C1DE; color: #17255A; }
.lab-block:active { transform: translateY(2px); box-shadow: none; }
.lab-events { display: grid; gap: 10px; }
.lab-event { border: 2px solid #E6E1F2; border-radius: 12px; padding: 10px; cursor: pointer; background: #FBF9FF; }
.lab-event.is-on { border-color: #D1A92B; background: #FFFBEB; }
.lab-event > b { display: inline-block; background: #D1A92B; color: #fff; padding: 4px 10px; border-radius: 6px; font-size: .82rem; }
.lab-slot { display: flex; flex-direction: column; gap: 4px; padding: 8px 0 0 16px; min-height: 34px; }
.lab-slot em { color: #9AA3C7; font-size: .82rem; }
.lab-phone { justify-self: center; width: 230px; border-radius: 30px; background: #17255A; padding: 14px 10px; box-shadow: 0 20px 40px rgba(23, 37, 90, .25); }
.lab-phone__screen { background: #fff; border-radius: 20px; padding: 18px 14px; text-align: center; min-height: 330px; position: relative; display: flex; flex-direction: column; gap: 8px; }
.lab-phone__screen small { font-weight: 800; color: #8E3FC0; }
.lab-phone__n { font: 800 3.4rem/1 var(--font-head, system-ui); }
.lab-phone__screen > span { color: #5B6490; margin-bottom: 12px; }
.lab-phone__screen button { border: 0; border-radius: 10px; padding: 10px; font-weight: 800; background: #13C1DE; color: #17255A; cursor: pointer; }
.lab-phone__screen button.alt { background: #E6E1F2; }
.lab-toast { position: absolute; left: 12px; right: 12px; bottom: 16px; background: #17255A; color: #FFD95A; border-radius: 10px; padding: 10px; font-weight: 800; }
.lab-grid { display: grid; gap: 3px; background: #E6E1F2; padding: 3px; border-radius: 12px; max-width: 420px; }
.lab-grid i { aspect-ratio: 1; background: #fff; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: 1.2rem; }
.lab-grid i.rack { background: repeating-linear-gradient(45deg, #5B6490 0 6px, #46507E 6px 12px); }
.lab-grid i.pallet { background: #FFF6DA; }
.lab-grid b { color: #8E3FC0; font-size: 1.3rem; transition: transform .2s; display: inline-block; }
.lab-prog { display: flex; flex-wrap: wrap; gap: 4px; min-height: 42px; background: #FBF9FF; border: 1.5px dashed #E6E1F2; border-radius: 10px; padding: 6px; }
.lab-prog button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: #8E3FC0; color: #fff; cursor: pointer; font-size: 1rem; }
.lab-prog em { color: #9AA3C7; font-size: .85rem; align-self: center; }
.lab-lv { font-weight: 800; color: #5B6490; margin-inline-start: auto; }

/* web */
.lab-tasks { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.lab-tasks li { font-weight: 700; font-size: .85rem; padding: 6px 12px; border-radius: 99px; background: #F1E8FB; color: #5E2482; }
.lab-tasks li::before { content: "○ "; }
.lab-tasks li.is-done { background: #E6F6DE; color: #2F6B25; }
.lab-tasks li.is-done::before { content: "✔ "; }
.lab-editor { width: 100%; min-height: 300px; resize: vertical; background: #0D1638; color: #E6E9FA; border: 0; border-radius: 12px; padding: 12px 14px; font: 500 .84rem/1.6 ui-monospace, Consolas, monospace; text-align: left; }
.lab-editor--sm { min-height: 210px; }
.lab-browser { border: 1px solid #E6E1F2; border-radius: 12px; overflow: hidden; background: #fff; }
.lab-browser__bar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; background: #F1F0F7; font-size: .75rem; color: #5B6490; }
.lab-browser__bar i { width: 9px; height: 9px; border-radius: 50%; background: #D9D5E8; }
.lab-browser__bar span { margin-inline-start: 8px; }
.lab-browser iframe { width: 100%; height: 280px; border: 0; display: block; }

/* plc */
.lab-ladder { display: flex; align-items: stretch; background: #0D1638; border-radius: 14px; padding: 18px 10px; overflow-x: auto; }
.lab-rail { width: 4px; background: #13C1DE; border-radius: 2px; flex: none; }
.lab-rung { display: flex; align-items: center; flex: 1; min-width: 440px; }
.lab-par { display: flex; flex-direction: column; gap: 10px; border-inline: 2px solid #33458C; padding: 0 4px; }
.lab-wire { flex: 1; height: 2px; background: #33458C; min-width: 8px; }
.lab-rung [data-s] { border: 2px solid #33458C; background: #16214D; color: #9AA3C7; border-radius: 8px; padding: 6px 8px; cursor: pointer; font: 700 .78rem ui-monospace, Consolas, monospace; display: grid; gap: 2px; min-width: 92px; }
.lab-rung [data-s] span { font-size: 1rem; color: #fff; }
.lab-rung [data-s].is-live { border-color: #6FCB4A; color: #C8F2B5; box-shadow: 0 0 12px rgba(111, 203, 74, .5); }
.lab-coil { font: 800 1rem ui-monospace, Consolas, monospace; color: #9AA3C7; padding: 6px 10px; border: 2px solid #33458C; border-radius: 20px; }
.lab-coil.is-on { color: #17255A; background: #FFD95A; border-color: #FFD95A; }
.lab-panel { background: #F7F5FD; border-radius: 14px; padding: 16px; text-align: center; }
.lab-motor { display: inline-grid; gap: 4px; place-items: center; width: 110px; height: 110px; border-radius: 50%; background: #E6E1F2; color: #9AA3C7; font-size: 2.6rem; }
.lab-motor small { font: 800 .7rem var(--font-head, system-ui); letter-spacing: .1em; }
.lab-motor.is-on { background: #E6F6DE; color: #46963A; }
.lab-motor.is-on i { animation: lab-spin .6s linear infinite; }
@keyframes lab-spin { to { transform: rotate(360deg); } }
.lab-pb { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; font: 800 .8rem var(--font-head, system-ui); color: #fff; cursor: pointer; box-shadow: 0 6px 0 rgba(0, 0, 0, .25); touch-action: none; user-select: none; }
.lab-pb:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.lab-pb--g { background: #46963A; } .lab-pb--r { background: #E5484D; }
.lab-tog { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.lab-panel .lab-row { justify-content: center; }

/* irrigation */
.lab-lab { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.lab-lab input { width: 100%; accent-color: #8E3FC0; display: block; }
.lab-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.lab-kpis div { background: #F7F5FD; border-radius: 10px; padding: 10px 6px; text-align: center; }
.lab-kpis b { display: block; font: 800 1.3rem var(--font-head, system-ui); color: #8E3FC0; }
.lab-kpis small { font-size: .72rem; color: #5B6490; }

/* osh */
.lab-osh-hud span { background: #F7F5FD; border-radius: 8px; padding: 5px 12px; font-weight: 700; }
.lab-scene { width: 100%; height: auto; border-radius: 12px; cursor: crosshair; display: block; margin-top: 10px; border: 1px solid #E6E1F2; }

/* cnc */
.lab-cnc { width: 100%; max-width: 360px; background: #fff; border: 1px solid #E6E1F2; border-radius: 12px; justify-self: center; }
