/* Earn block (js/earn.js): five steps by hand, mid design system (stages 4-7). Tokens and components come from the page:
   .card .ch .res .bk .pm .md .axl .ax .plab .lg .sw-pm .sw-md .kv .bkb .seg .btn .num .ui .sm .mut .plus .no-t .yes-t.
   This file loads before the page <style>, so rules that override page rules are scoped with .e5. */

/* step rows and market rows become buttons; the page keeps .on (tint + 1 px frame) and the first-row rule */
button.st,button.mt,button.mrow{-webkit-appearance:none;appearance:none;margin:0;border:0;border-top:1px solid var(--ln);background:transparent;font:inherit;color:inherit;text-align:left;width:100%;cursor:pointer}
button.mrow{display:block}
button.st:focus-visible,button.mt:focus-visible,button.mrow:focus-visible{outline-offset:-2px}
.e5-b{display:block}

/* the page's layout class .g2 shares its name with the bin entrance keyframes g2; keep the Earn grid still */
.e5>.g2{animation:none}

/* panes: switch with a 200 ms cross-fade */
@keyframes e5in{from{opacity:0}to{opacity:1}}
.e5 .e5-in{animation:e5in 200ms cubic-bezier(0.2,0,0,1)}
.e5 .e5-stage{display:grid;align-items:start;position:relative}
.e5 .e5-pane{grid-area:1/1;min-width:0}
.e5 .e5-off{visibility:hidden;pointer-events:none;position:absolute;top:0;left:0;right:0}
.ph .e5-off{display:none}
.ph .e5-pane+.e5-pane{margin-top:28px}

/* card parts */
.e5 .e5-ch{padding:28px 32px;gap:16px}
.e5 .e5-t{font-size:22px}
.e5 .e5-body{padding:32px}
.e5 .e5-card .res{padding:16px 32px}
.ph .e5-card .e5-ch{padding:14px 16px;flex-direction:column;align-items:flex-start;gap:10px}
.ph .e5-t{font-size:19px}
.ph .e5-body{padding:16px 16px 20px}
.ph .e5-card .res{padding:12px 16px}
.e5 .e5-rp{height:44px;font-size:15px;flex:none}

/* step 2: volume by price (hatched, Polymarket trades) and your bins (lime) on one 1¢ axis */
.e5 .e5-s2{display:grid;grid-template-columns:auto 1fr;gap:48px;align-items:end;margin-top:24px}
.ph .e5-s2{grid-template-columns:minmax(0,1fr);gap:20px;margin-top:16px}
.e5 .e5-sc{overflow-x:auto;max-width:100%}
/* step 2 with the shared add-liquidity panel (js/addliq.js): the panel takes the width, the numbers sit beside it */
.e5 .e5-s2.e5-s2al{grid-template-columns:minmax(0,1fr);gap:20px;align-items:start}
.ph .e5-s2.e5-s2al{grid-template-columns:minmax(0,1fr);gap:20px}
.e5 .e5-s2al .e5-sc{overflow:visible}
.e5 .e5-al{display:block;width:100%}
.e5 .e5-drag{position:relative;display:block;width:max-content;padding:4px 14px 0;cursor:ew-resize;touch-action:pan-y;-webkit-user-select:none;user-select:none}
.e5 .e5-drag:focus-visible{outline:2px solid var(--fg);outline-offset:-2px}
.e5 .e5-ul{background:var(--sub);opacity:0;transition:opacity 200ms cubic-bezier(0.4,0,1,1)}
.e5 .e5-dragging .e5-ul{opacity:1;transition:none}
.e5 .e5-tip{position:absolute;top:4px;z-index:3;display:flex;flex-direction:column;gap:2px;min-width:140px;padding:8px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--fg);pointer-events:none;opacity:0;transition:opacity 120ms cubic-bezier(0.2,0,0,1);font-variant-numeric:tabular-nums}
.e5 .e5-tip.on{opacity:1}
.e5 .e5-tr{display:flex;justify-content:space-between;gap:14px}
.e5 .e5-kvs .kv span:last-child{text-align:right;font-variant-numeric:tabular-nums}

/* steps 3 and 5: price over two hours, your bins as a band, trades through them as lime dots */
.e5 .e5-tc{display:grid;grid-template-columns:40px minmax(0,1fr);margin-top:28px}
.ph .e5-tc{grid-template-columns:34px minmax(0,1fr)}
.e5 .e5-ya{position:relative}
.e5 .e5-yl{position:absolute;right:10px;transform:translateY(-50%);font-size:11px;line-height:14px;color:var(--mut);white-space:nowrap}
.e5 .e5-plot{position:relative}
.e5 .e5-plot>i,.e5 .e5-plot .e5-dots i{position:absolute;display:block}
.e5 .e5-plot svg{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}
.e5 .e5-band{left:0;right:0;background:var(--sub);border-top:1px solid var(--ln);border-bottom:1px solid var(--ln)}
.e5 .e5-p0{left:0;right:0;height:0;border-top:1px dashed var(--mut)}
.e5 .e5-ex{top:-22px;bottom:0;width:0;border-left:1px dashed var(--mut)}
.e5 .e5-ex span{position:absolute;top:0;right:6px;white-space:nowrap;font-style:normal}
.e5 .e5-gh{fill:none;stroke:var(--ln);stroke-width:1.25}
.e5 .e5-pl{fill:none;stroke:var(--fg);stroke-width:1.25;stroke-linejoin:round}
.e5 .e5-dot{transform:translate(-50%,-50%);border-radius:50%;background:#C8F23A;border:1px solid #000000}
@keyframes e5pop{from{transform:translate(-50%,-50%) scale(0)}to{transform:translate(-50%,-50%) scale(1)}}
.e5 .e5-pop{animation:e5pop 400ms cubic-bezier(0.2,0,0,1)}
.e5 .e5-say{margin:18px 0 0;min-height:40px}
.ph .e5-say{min-height:80px}
.e5 .e5-r3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;align-items:end}
.e5 .e5-r3 .e5-rr{text-align:right}
.ph .e5-r3{grid-template-columns:minmax(0,1fr);gap:4px}
.ph .e5-r3>div{display:flex;justify-content:space-between;align-items:baseline;gap:12px;text-align:left}

/* step 4: what your bins hold, withdraw or hold */
.e5 .e5-s4{display:grid;grid-template-columns:1fr 1fr;gap:40px;align-items:start}
.ph .e5-s4{grid-template-columns:minmax(0,1fr);gap:24px}
.e5 .e5-tok{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:12px;align-items:center;margin-top:14px}
.e5 .e5-trk{display:block;position:relative;height:8px}
.e5 .e5-w{display:block;height:8px;max-width:100%;transition:width 400ms cubic-bezier(0.2,0,0,1)}
.e5 .e5-tv{min-width:6ch;text-align:right;font-variant-numeric:tabular-nums}
.e5 .e5-opt{-webkit-appearance:none;appearance:none;display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:100%;margin:0 0 12px;padding:14px 16px;border:1px solid var(--fg);border-radius:0;background:var(--bg);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background-color 200ms cubic-bezier(0.2,0,0,1),box-shadow 200ms cubic-bezier(0.2,0,0,1)}
.e5 .e5-opt:last-child{margin-bottom:0}
/* step 4, Hold to resolve: one row per outcome, signed */
.e5 .e5-out{display:flex;justify-content:space-between;align-items:baseline;gap:16px;width:100%}
.e5 .e5-ov{font-size:24px;line-height:30px;font-variant-numeric:tabular-nums}
.e5 .e5-opt.on{background:var(--sub);box-shadow:inset 0 0 0 1px var(--fg)}
.e5 .e5-opt:focus-visible{outline:2px solid var(--fg);outline-offset:2px}

/* step 5: two markets that ran away, two ranges */
.e5 .e5-ctl{display:flex;flex-wrap:wrap;gap:12px}
.ph .e5-segm{display:flex;flex-direction:column;align-items:stretch;width:100%;border-radius:22px}
.ph .e5-segm>button{justify-content:center}
.e5 .e5-clk{white-space:nowrap}
.e5 .e5-duo{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;padding:10px 0;border-top:1px solid var(--ln)}
.e5 .e5-tc5+.e5-duo{margin-top:24px}
.e5 .e5-dl{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.e5 .e5-duo .bd{font-variant-numeric:tabular-nums;white-space:nowrap}
.e5 .e5-fb{background:#C8F23A;border:1px solid #000000}
.e5 .e5-r5{align-items:baseline}

@media (prefers-reduced-motion: reduce){.e5 *{animation:none !important;transition:none !important}}
