/* Product walkthrough in the hero panel. The app is drawn at 1120 x 620 and scaled to fit. */
.panel.demo { display: none; }
.has-demo .panel.demo { display: block; }
.has-demo .panel.panel-static { display: none; }
.demo-view { position: relative; overflow: hidden; }
.demo-stage { position: absolute; left: 0; top: 0; width: 1120px; height: 620px; transform-origin: 0 0; overflow: hidden; }
.demo-cam { position: absolute; left: 0; top: 0; width: 1120px; height: 620px; transform-origin: 0 0; will-change: transform; }
.app { position: absolute; inset: 0; font-size: 12px; color: var(--text); }
.app .lbl { font-size: 9.5px; }
.app .m { color: var(--muted); }
.app .r { text-align: right; }

.app-top { position: absolute; left: 0; top: 0; width: 1120px; height: 52px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 36px; }
.app-logo { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.app-tabs { display: flex; gap: 4px; flex: 1; }
.app-tabs i { font-style: normal; padding: 5px 11px; border-radius: 999px; color: var(--muted); }
.app-tabs i.on { background: var(--surface-3); color: var(--text); }
.app-acct { font-size: 11px; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 10px; }

.app-add { position: absolute; left: 20px; top: 64px; width: 696px; height: 44px; }
.app-input { position: absolute; left: 0; top: 0; width: 500px; height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg); display: flex; align-items: center; padding: 0 14px; font-size: 13px; transition: border-color .2s, box-shadow .2s; }
.app-input.focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(43,224,143,0.18); }
.app-input .caret { display: inline-block; width: 1px; height: 16px; background: var(--emerald); margin-left: 1px; opacity: 0; }
.app-input .ph { color: var(--faint); position: absolute; left: 14px; }
.app-btn { position: absolute; left: 510px; top: 0; width: 70px; height: 44px; border-radius: 10px; background: var(--gradient-brand); color: var(--on-accent); font-weight: 500; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: transform .12s; }
.app-btn.press { transform: scale(0.94); }
.app-btn.sm { position: static; width: 64px; height: 28px; font-size: 12px; border-radius: 8px; }
.app-found { position: absolute; left: 594px; top: 14px; font-size: 11px; color: var(--emerald); opacity: 0; }

.app-metrics { position: absolute; left: 20px; top: 120px; width: 696px; height: 76px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.app-metrics > div, .app-greeks > div { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.app-metrics b, .app-greeks b { font-weight: 400; font-size: 18px; }

.app-table { position: absolute; left: 20px; top: 208px; width: 696px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg); }
.app-tr { display: grid; grid-template-columns: 170px 140px 84px 80px 104px 1fr; column-gap: 10px; align-items: center; height: 36px; padding: 0 12px; border-top: 1px solid var(--border); font-size: 12px; transition: background .4s; }
.app-tr.head { height: 30px; border-top: 0; background: var(--surface-2); }
.app-tr.flash { background: rgba(43,224,143,0.14); }
.app-tr.hot { background: rgba(255,94,94,0.08); }
.app-tr .act { text-align: right; color: var(--muted); }
.app-tr .btn-act { justify-self: end; border: 1px solid var(--border-strong); border-radius: 7px; padding: 3px 8px; color: var(--text); font-size: 11px; transition: transform .12s, background .2s; }
.app-tr .btn-act.press { transform: scale(0.92); background: var(--surface-3); }
.app .risk.low { color: var(--risk-low); } .app .risk.watch { color: var(--risk-watch); } .app .risk.crit { color: var(--risk-critical); }

.app-greeks { position: absolute; left: 20px; top: 432px; width: 696px; height: 64px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.app-greeks > div { padding: 10px 14px; gap: 6px; }
.app-greeks b { font-size: 16px; }
.app-expo { position: absolute; left: 20px; top: 506px; width: 696px; height: 100px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 10px 14px; }
.expo-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; }
.expo-row { display: grid; grid-template-columns: 40px 1fr 1fr 110px; align-items: center; height: 22px; font-size: 11px; }
.expo-row .half { height: 10px; display: flex; }
.expo-row .half.neg { justify-content: flex-end; border-right: 1px solid var(--border-strong); }
.expo-row .half i { display: block; height: 10px; width: 0; }
.expo-row .half.neg i { background: var(--negative); border-radius: 3px 0 0 3px; }
.expo-row .half.pos i { background: var(--emerald); border-radius: 0 3px 3px 0; }

.app-card { position: absolute; left: 736px; width: 364px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.card-head { position: absolute; left: 20px; right: 20px; top: 12px; display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.app-stress { top: 64px; height: 266px; }
.slider { position: absolute; left: 24px; width: 316px; }
.slider.s1 { top: 36px; } .slider.s2 { top: 86px; }
.sl-l { font-size: 11px; color: var(--muted); }
.sl-v { position: absolute; right: 0; top: 0; font-size: 11px; }
.track { position: absolute; left: 0; top: 24px; width: 316px; height: 4px; border-radius: 4px; background: var(--surface-3); }
.track .fill { position: absolute; top: 0; height: 4px; border-radius: 4px; background: var(--emerald); left: 158px; width: 0; }
.track .knob { position: absolute; top: -6px; left: 152px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 4px rgba(43,224,143,0.18); }
.pl { position: absolute; left: 24px; width: 316px; display: grid; grid-template-columns: 100px 1fr 70px; align-items: center; font-size: 11px; }
.pl.p1 { top: 140px; } .pl.p2 { top: 168px; } .pl.p3 { top: 214px; padding-top: 6px; border-top: 1px solid var(--border); }
.pl-mark { position: absolute; left: 24px; width: 316px; top: 188px; display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.pl-mark .mono { color: var(--text); font-size: 11px; }
.pl-mark .mono.up { color: var(--warning); }
.pl.tot { font-weight: 500; }
.plbar { position: relative; height: 10px; margin: 0 8px; }
.plbar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.plbar i { position: absolute; top: 0; height: 10px; left: 50%; width: 0; border-radius: 2px; }
.plbar i.neg { background: var(--negative); } .plbar i.pos { background: var(--emerald); }
.foot-note { position: absolute; left: 24px; bottom: 8px; font-size: 10px; color: var(--muted); }

.app-liq { top: 344px; height: 262px; }
.liq-chart { position: absolute; left: 24px; top: 42px; width: 316px; height: 170px; overflow: visible; }
.liq-foot { position: absolute; left: 24px; right: 24px; bottom: 10px; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; white-space: nowrap; }
.liq-foot > div { display: flex; gap: 10px; }
.liq-foot .m { font-size: 10.5px; }
.card-head .sent { color: var(--on-accent); background: var(--emerald); border-radius: 999px; padding: 3px 9px; font-size: 10.5px; opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.card-head .sent.on { opacity: 1; transform: none; }
.app-liq.alarm { box-shadow: 0 0 0 1px rgba(255,94,94,0.6), 0 0 32px rgba(255,94,94,0.18); }

.app-pop { position: absolute; left: 380px; top: 192px; width: 320px; height: 150px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 40px -12px rgba(0,0,0,0.7); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(8px) scale(0.97); transform-origin: 300px 140px; pointer-events: none; }
.pop-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.pop-size { display: flex; justify-content: space-between; font-size: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--bg); }
.pop-btns { display: flex; gap: 8px; }
.pop-btns span { flex: 1; text-align: center; border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 0; font-size: 11px; transition: background .2s, border-color .2s, transform .12s; }
.pop-btns span.on { background: var(--surface-3); border-color: var(--emerald); }
.pop-btns span.press, .app-btn.sm.press { transform: scale(0.93); }
.pop-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
#dPopPrev { opacity: 0; color: var(--emerald); transition: opacity .3s; }

.demo-phone { position: absolute; left: 70px; top: 86px; width: 230px; height: 448px; border-radius: 34px; border: 1px solid var(--border-strong); background: #0B1612; padding: 10px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.8); opacity: 0; transform-origin: 115px 120px; }
.ph-screen { height: 100%; border-radius: 26px; background: linear-gradient(180deg, #13241D, #0A1511); padding: 28px 12px; text-align: center; }
.ph-time { font-size: 44px; font-weight: 400; letter-spacing: -0.02em; }
.ph-date { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.ph-note { margin-top: 26px; text-align: left; background: rgba(238,250,244,0.1); border: 1px solid rgba(238,250,244,0.08); border-radius: 16px; padding: 10px 12px; opacity: 0; transform: translateY(-14px); transition: transform .15s; }
.ph-note.press { transform: scale(0.97); }
.ph-app { display: flex; align-items: center; gap: 6px; font-size: 9.5px; letter-spacing: 0.06em; color: var(--text-2); }
.ph-app .m { margin-left: auto; letter-spacing: 0; }
.ph-icon { width: 18px; height: 18px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; }
.ph-from { font-size: 12.5px; font-weight: 500; margin-top: 6px; }
.ph-msg { font-size: 11.5px; line-height: 1.45; color: var(--text-2); margin-top: 2px; }

.demo-cursor { position: absolute; left: 0; top: 0; z-index: 5; opacity: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); transform-origin: 2px 2px; }
.demo-ripple { position: absolute; left: 0; top: 0; z-index: 4; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid var(--emerald); opacity: 0; }
.demo-cap { font-size: 12.5px; color: var(--text-2); white-space: nowrap; min-width: 250px; }
@media (max-width: 1000px) { .demo-cap { display: none; } }
.demo-fade { position: absolute; inset: 0; z-index: 7; background: var(--surface); opacity: 0; pointer-events: none; }

.demo-foot { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--border); }
.demo-chips { display: flex; gap: 6px; flex: 1; }
.demo-chips button { all: unset; cursor: pointer; flex: 1; max-width: 84px; display: flex; flex-direction: column; gap: 6px; padding: 4px 6px; border-radius: 8px; font-size: 12px; color: var(--muted); }
.demo-chips button.on { color: var(--text); }
.demo-chips button i { display: block; height: 2px; border-radius: 2px; background: var(--surface-3); position: relative; overflow: hidden; }
.demo-chips button i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--gradient-brand); }
.demo-chips button:focus-visible, .demo-pause:focus-visible { box-shadow: var(--shadow-focus); }
.demo-pause { all: unset; cursor: pointer; font-size: 12px; color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 14px; }
.demo-pause[hidden] { display: none; }
.demo-pause:hover, .demo-chips button:hover { color: var(--text); }

/* phones: portrait frame, centred phone overlay, footer on two rows */
.demo.compact .demo-foot { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
.demo.compact .demo-chips { flex: 1 1 100%; gap: 4px; }
.demo.compact .demo-chips button { font-size: 11px; padding: 6px 2px; min-height: 40px; justify-content: flex-end; }
.demo.compact .sample { margin-right: auto; }
.demo.compact .demo-pause { padding: 0 18px; min-height: 40px; display: inline-flex; align-items: center; }

/* ---------- phone dashboard: a real mobile layout, 360 x 640, scrolled rather than zoomed ---------- */
.phone-stage { display: none; width: 360px; height: 640px; background: var(--surface); }
.demo.compact .phone-stage { display: block; }
.demo.compact .desk-stage { display: none; }
.phone-stage { font-size: 12px; color: var(--text); }
.phone-stage .lbl { font-size: 9.5px; }
.phone-stage .m { color: var(--muted); }
.phone-stage .r { text-align: right; }
.phone-stage .risk.low { color: var(--risk-low); } .phone-stage .risk.watch { color: var(--risk-watch); } .phone-stage .risk.crit { color: var(--risk-critical); }
.p-cam { position: absolute; left: 0; top: 48px; width: 360px; height: 1400px; will-change: transform; }
.p-top { position: absolute; left: 0; top: 0; width: 360px; height: 48px; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.p-card { position: absolute; left: 10px; width: 340px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.p-add { top: 12px; height: 90px; }
.p-add .app-input { left: 12px; top: 12px; width: 226px; font-size: 12px; }
.p-add .app-btn { left: 250px; top: 12px; width: 76px; }
.p-add .app-found { left: 12px; top: 64px; }
.p-tiles { position: absolute; left: 10px; width: 340px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.p-tiles > div { height: 62px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.p-tiles b { font-weight: 400; font-size: 17px; }
.p-sum { top: 118px; } .p-greeks { top: 594px; }
.p-list { top: 268px; height: 310px; overflow: hidden; }
.p-list-head { height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font-size: 12.5px; background: var(--surface-2); }
.p-row { height: 56px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; border-top: 1px solid var(--border); transition: background .4s; }
.p-row > div { display: flex; flex-direction: column; gap: 3px; }
.p-row > div:last-child { align-items: flex-end; }
.p-row b { font-weight: 500; font-size: 12.5px; }
.p-row .m { font-size: 11px; }
.p-row .r span { font-size: 11px; }
.p-row.hot { background: rgba(255,94,94,0.08); }
.p-row.flash { background: rgba(43,224,143,0.14); }
.p-expo { top: 744px; height: 108px; padding: 10px 12px; }
.p-expo .expo-row { grid-template-columns: 34px 1fr 1fr 78px; }
.p-stress { top: 868px; height: 250px; }
.p-liq { top: 1134px; height: 250px; }
.p-head { position: absolute; left: 16px; right: 16px; top: 12px; display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.p-head .sent { color: var(--on-accent); background: var(--emerald); border-radius: 999px; padding: 3px 9px; font-size: 10.5px; opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.p-head .sent.on { opacity: 1; transform: none; }
.phone-stage .slider { left: 20px; width: 300px; }
.phone-stage .slider.s1 { top: 30px; } .phone-stage .slider.s2 { top: 80px; }
.phone-stage .track { top: 20px; width: 300px; }
.phone-stage .track .fill { left: 150px; }
.phone-stage .track .knob { left: 144px; }
.phone-stage .pl, .phone-stage .pl-mark { left: 20px; width: 300px; }
.phone-stage .pl { grid-template-columns: 104px 1fr 66px; }
.phone-stage .pl.p1 { top: 128px; } .phone-stage .pl.p2 { top: 154px; } .phone-stage .pl-mark { top: 176px; } .phone-stage .pl.p3 { top: 196px; }
.phone-stage .foot-note { left: 20px; }
.p-liq .liq-chart { left: 14px; top: 36px; width: 312px; height: 168px; }
.p-liq .liq-foot { left: 16px; right: 16px; bottom: 10px; }
.p-liq.alarm { box-shadow: 0 0 0 1px rgba(255,94,94,0.6), 0 0 28px rgba(255,94,94,0.18); }
.p-banner { position: absolute; left: 10px; top: 8px; width: 340px; z-index: 6; background: #1C332A; border: 1px solid rgba(238,250,244,0.12); border-radius: 16px; padding: 10px 12px; box-shadow: 0 16px 30px -12px rgba(0,0,0,0.7); transform: translateY(-120px); }
.p-sheet { position: absolute; left: 0; bottom: 0; width: 360px; height: 250px; z-index: 5; background: var(--surface); border-top: 1px solid var(--border-strong); border-radius: 18px 18px 0 0; padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -18px 40px -16px rgba(0,0,0,0.7); transform: translateY(270px); }
.p-grab { display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 0 auto; }
.p-sheet .pop-head { height: 16px; } .p-sheet .pop-size { height: 32px; align-items: center; } .p-sheet .pop-btns span { padding: 8px 0; }
.p-prev { height: 16px; font-size: 11px; color: var(--emerald); opacity: 0; transition: opacity .3s; }
.p-apply { position: static !important; width: 100% !important; height: 40px !important; }
.p-touch { position: absolute; left: 0; top: 0; z-index: 8; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid rgba(238,250,244,0.85); background: rgba(238,250,244,0.18); opacity: 0; transition: background .15s; }
.p-touch.down { background: rgba(238,250,244,0.45); }
.phone-stage .demo-ripple { z-index: 7; }

/* end card: the loop closes on the mark and the positioning line */
.demo-end { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; pointer-events: none; }
.demo-end > * { opacity: 0; }
.end-mark { width: 120px; height: auto; }
.end-name { font-size: 48px; line-height: 1; color: var(--text); }
.end-line { font-size: 17px; color: var(--muted); letter-spacing: 0.01em; }
.phone-stage .end-mark { width: 92px; }
.phone-stage .end-name { font-size: 38px; }
.phone-stage .end-line { font-size: 14px; }
