/* Cherry Disco (D-091). Dark only. Text colours checked for 4.5:1 on the surfaces:
   --text and --text-2 on --surface are above 9:1; --cherry-text (a lighter cherry) is used for
   small red text; --tertiary is not used for small text (about 4:1). */
:root{
--bg:#0B0A10;--surface:#15121D;--raised:#1D1928;--raised-2:#27213a;
--border:rgba(255,255,255,0.07);--border-strong:rgba(255,255,255,0.16);
--text:#F5F3FA;--text-2:#B3ACC4;--tertiary:#7A7290;
--cherry:#E52F55;--cherry-text:#FF6A85;--bubblegum:#F17EB7;--sunshine:#FFD84A;
--purple:#713DB2;--purple-light:#A47BE6;--pool:#39A9D6;--pistachio:#A9CF6B;
--ease:cubic-bezier(0.22,1,0.36,1);
color-scheme:dark}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;color:var(--text);font:100%/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
background:radial-gradient(60rem 30rem at 85% -10%,rgba(113,61,178,.22),transparent 60%),
radial-gradient(40rem 25rem at -10% 0,rgba(229,47,85,.10),transparent 60%),var(--bg);
background-attachment:fixed;min-height:100vh;display:flex;flex-direction:column}
main{flex:1}
main,.top-in,.foot{width:100%;max-width:1100px;margin:0 auto;padding:1rem}
a{color:var(--pool)}
h1,h2,h3{margin:0;letter-spacing:-0.02em}
h1{font-size:clamp(1.5rem,3.4vw,2.1rem);font-weight:700;line-height:1.15}
h2{font-size:1.15rem;font-weight:650}
h3{font-size:1rem;font-weight:650}
p{margin:.4rem 0}
.k{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--text-2);font-weight:600}

/* header */
.top{position:sticky;top:0;z-index:20;background:rgba(11,10,16,0.72);
-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%)}
.top::after{content:"";position:absolute;left:0;right:0;top:100%;height:1.5rem;pointer-events:none;
background:linear-gradient(rgba(11,10,16,.72),rgba(11,10,16,0))}
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more){
.top{background:#0B0A10;-webkit-backdrop-filter:none;backdrop-filter:none}
.top::after{background:none}}
.top-in{display:flex;flex-wrap:wrap;gap:.6rem 1rem;align-items:center;justify-content:space-between;padding-top:.7rem;padding-bottom:.7rem}
.brand{display:flex;align-items:center;gap:.6rem}
.brand strong{font-weight:700;letter-spacing:-0.01em}
.disco{display:inline-block;width:1.5rem;height:1.5rem;border-radius:50%;flex:none;
background:conic-gradient(from 30deg,var(--cherry),var(--bubblegum),var(--sunshine),var(--pistachio),var(--pool),var(--purple),var(--cherry));
box-shadow:inset 0 0 0 .1rem rgba(255,255,255,.18),0 0 1rem rgba(241,126,183,.25)}
.big-disco{width:3rem;height:3rem;margin-bottom:.5rem}
.pill{font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--sunshine);
background:rgba(255,216,74,.12);border:1px solid rgba(255,216,74,.28);border-radius:999px;padding:.15rem .6rem}
.seg{display:inline-flex;flex-wrap:wrap;gap:.2rem;padding:.2rem;background:var(--surface);border:1px solid var(--border);border-radius:999px}
.seg a{color:var(--text-2);text-decoration:none;padding:.4rem .95rem;border-radius:999px;font-weight:600;font-size:.92rem;
min-height:2.25rem;display:inline-flex;align-items:center;transition:background 150ms,color 150ms,transform 100ms ease-out}
.seg a:hover{background:var(--raised);color:var(--text)}
.seg a:active{transform:scale(.97)}
.seg a.active{background:var(--cherry);color:#fff}
form.inline{display:inline;margin:0}

/* buttons */
.button{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:40px;padding:.6rem 1.1rem;
border-radius:999px;background:var(--raised);border:1px solid var(--border-strong);color:var(--text);
font:inherit;font-weight:600;line-height:1.2;text-decoration:none;cursor:pointer;
transition:background 150ms,filter 150ms,transform 100ms ease-out}
.button:hover{background:var(--raised-2)}
.button.primary{background:var(--cherry);border-color:transparent;color:#fff}
.button.primary:hover{background:var(--cherry);filter:brightness(1.12)}
.button.active{cursor:default}
.button.small{min-height:36px;padding:.4rem .9rem;font-size:.9rem}
.button.wide{width:100%}
.button:active{transform:scale(.97);transition:transform 100ms ease-out}
.button:focus-visible,.seg a:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible{outline:2px solid var(--bubblegum);outline-offset:2px}
.actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin:.8rem 0}
.sep{width:1px;height:1.6rem;background:var(--border-strong);margin:0 .3rem}

/* cards and layout */
.card{background:var(--surface);border:1px solid var(--border);border-radius:1.1rem;padding:1.1rem 1.25rem;margin:1rem 0;
box-shadow:0 .1rem .4rem rgba(0,0,0,.25);min-width:0}
.card.narrow{max-width:32rem}
.panels{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1.25rem}
.panel{--g1:var(--pool);position:relative;margin:0;padding-top:1.4rem;
background:linear-gradient(90deg,var(--g1),var(--bubblegum)) top left/100% 3px no-repeat border-box,var(--surface);transition:transform 200ms ease-out,box-shadow 200ms ease-out}
.panel.track-b{--g1:var(--purple)}
.panel:hover{transform:translateY(-2px);box-shadow:0 .9rem 2rem rgba(0,0,0,.45)}
.card-head,.titlebar{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.card-head{justify-content:space-between;flex-wrap:nowrap;align-items:flex-start}
.titlebar{margin:.4rem 0 .2rem}
.titlebar h3{margin-top:.6rem}
.big{font-size:clamp(1.75rem,4vw,2.5rem);font-weight:700;letter-spacing:-0.02em;line-height:1.05;
font-variant-numeric:tabular-nums;margin:.5rem 0}
.pair{display:flex;flex-wrap:wrap;gap:.2rem 1.2rem;font-variant-numeric:tabular-nums}
.pair .k{margin-right:.3rem}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));gap:.8rem 1.2rem;margin-top:.8rem}
.stat{display:flex;flex-direction:column;font-variant-numeric:tabular-nums}
.meta{color:var(--text-2);font-size:.85rem;margin:.2rem 0 .6rem}
.gain{color:var(--pistachio)}.loss,.alert{color:var(--cherry-text)}
.alert{font-weight:600}
.muted{color:var(--text-2)}

/* status chips: a dot and a word, never colour alone */
.chip{display:inline-flex;align-items:center;gap:.4rem;font-size:.8rem;font-weight:700;padding:.2rem .7rem;border-radius:999px;
background:var(--raised);border:1px solid var(--border)}
.chip .dot{width:.55rem;height:.55rem;border-radius:50%;background:var(--text-2)}
.chip.good{color:var(--pistachio)}.chip.good .dot{background:var(--pistachio)}
.chip.bad{color:var(--cherry-text)}.chip.bad .dot{background:var(--cherry)}
.chip.warn{color:var(--sunshine)}.chip.warn .dot{background:var(--sunshine)}
.chip.idle{color:var(--text-2)}

/* banners: always visible */
.banner{display:flex;align-items:center;gap:.7rem;background:rgba(255,216,74,.10);border:1px solid rgba(255,216,74,.35);
border-radius:1rem;padding:.7rem 1rem;margin:.8rem 0;color:var(--text)}
.banner-ico{flex:none;width:1.5rem;height:1.5rem;border-radius:50%;background:var(--sunshine);color:#0B0A10;font-weight:800;
display:inline-flex;align-items:center;justify-content:center}
.banner-text{flex:1}

/* (i) popovers: no JavaScript needed */
.info{position:relative;display:inline-block;flex:none}
.info summary{list-style:none;cursor:pointer;width:1.25rem;height:1.25rem;border:1.5px solid var(--text-2);border-radius:50%;
color:var(--text-2);display:inline-flex;align-items:center;justify-content:center;font:italic 700 .75rem/1 Georgia,serif;
user-select:none;transition:color 150ms,border-color 150ms,transform 100ms ease-out}
.info summary::-webkit-details-marker{display:none}
.info summary:hover,.info[open] summary{color:var(--text);border-color:var(--text)}
.info summary:active{transform:scale(.93)}
.popover{position:absolute;z-index:30;top:1.9rem;right:0;width:max-content;max-width:min(22rem,calc(100vw - 2rem));
background:var(--raised);border:1px solid var(--border-strong);border-radius:.9rem;padding:.8rem 1rem;color:var(--text);
font-size:.9rem;font-weight:400;line-height:1.45;box-shadow:0 1rem 2.5rem rgba(0,0,0,.55);transform-origin:top right;text-align:left;
text-transform:none;letter-spacing:0;max-height:60vh;overflow-y:auto;overscroll-behavior:contain}
.popover p{margin:.3rem 0}
.popover{white-space:normal}
.tablewrap .popover{position:fixed;top:auto;right:auto;left:auto;bottom:auto}
.popover.left{right:auto;left:0;transform-origin:top left}
.popover.up{top:auto;bottom:1.9rem;transform-origin:bottom left}
.info[open] .popover{animation:pop 180ms ease-out}
@keyframes pop{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}

/* tables */
.tablewrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;font-size:.92rem}
th,td{padding:.6rem .7rem;text-align:left;white-space:nowrap;border-bottom:1px solid var(--border)}
th{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--text-2)}
tbody tr:last-child td{border-bottom:0}
.num{text-align:right;font-variant-numeric:tabular-nums}
tr.buy td:nth-child(3){color:var(--pistachio)}tr.sell td:nth-child(3){color:var(--cherry-text)}
tr.deposit td:nth-child(3){color:var(--sunshine)}

/* charts */
.chartbox{margin:.5rem 0}
svg.chart{width:100%;height:auto;display:block;overflow:visible;touch-action:pan-y}
.chart .grid{stroke:rgba(255,255,255,0.06);stroke-width:1}
.chart .frame{fill:none;stroke:rgba(255,255,255,0.06)}
.chart .tick{fill:var(--text-2);font-size:9px}
.chart .line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.chart polyline.line.s0,.chart line.line.s0{stroke-width:2.5}
.s0{stroke:var(--cherry)}.s1{stroke:var(--pool)}.s2{stroke:var(--purple-light)}.s3{stroke:var(--pistachio)}.s4{stroke:var(--bubblegum)}
.paid{stroke:var(--sunshine);stroke-dasharray:6 4}
.chart .dot{stroke:none}
.dot.s0{fill:var(--cherry)}.dot.s1{fill:var(--pool)}.dot.s2{fill:var(--purple-light)}.dot.s3{fill:var(--pistachio)}.dot.s4{fill:var(--bubblegum)}.dot.paid{fill:var(--sunshine)}
.price .line.s0{stroke:var(--pool)}.price .dot.s0{fill:var(--pool)}
.chart .hit{fill:transparent;stroke:none}
.chart .band{fill:var(--pool);fill-opacity:.18;stroke:var(--pool);stroke-opacity:.6;pointer-events:none}
svg.chart{user-select:none;-webkit-user-select:none}
.zoom-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:0 0 .4rem}
.zoom-chips[hidden]{display:none}
.chip-btn{font:inherit;font-size:.8rem;font-weight:600;color:var(--text-2);background:var(--raised);border:1px solid var(--border-strong);border-radius:999px;min-height:2rem;padding:.2rem .8rem;cursor:pointer;transition:background 150ms,transform 100ms ease-out}
.chip-btn:hover{background:var(--raised-2);color:var(--text)}
.chip-btn:active{transform:scale(.97)}
.chip-btn:focus-visible{outline:2px solid var(--bubblegum);outline-offset:2px}
.chip-btn.on{background:var(--cherry);border-color:transparent;color:#fff}
@media (prefers-reduced-motion:no-preference){.chart g.zoomed>*{animation:fade 250ms ease-out}}
@media (prefers-reduced-motion:reduce){.chip-btn{transition:none}.chip-btn:active{transform:none}}
.chart .guide{stroke:var(--text-2);stroke-width:1;stroke-dasharray:3 3}
.chart .hdot{stroke:var(--bg);stroke-width:2}
.hdot.s0{fill:var(--cherry)}.hdot.s1{fill:var(--pool)}.hdot.s2{fill:var(--purple-light)}.hdot.s3{fill:var(--pistachio)}.hdot.s4{fill:var(--bubblegum)}.hdot.paid{fill:var(--sunshine)}
.price .hdot.s0{fill:var(--pool)}
@media (max-width:600px){.chart .hdot{r:9px}.chart .mark{stroke:var(--bg);stroke-width:1}}
[hidden]{display:none!important}
.chart-wrap{position:relative}
.legend-chips{list-style:none;margin:0 0 .4rem;padding:0;display:flex;flex-wrap:wrap;gap:.3rem .9rem;font-size:.85rem;color:var(--text-2)}
.legend-chips li{display:inline-flex;align-items:center}
.swatch{display:inline-block;width:1.3rem;height:0;border-top:3px solid;margin-right:.45rem}
.swatch.s0{border-color:var(--cherry)}.swatch.s1{border-color:var(--pool)}.swatch.s2{border-color:var(--purple-light)}.swatch.s3{border-color:var(--pistachio)}.swatch.s4{border-color:var(--bubblegum)}
.swatch.paid{border-color:var(--sunshine);border-top-style:dashed}
.price .swatch.s0{border-color:var(--pool)}
.swatch.tri{width:0;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-top:0;margin-right:.35rem}
.swatch.tri.buy{border-bottom:.7rem solid var(--pistachio)}
.swatch.tri.sell{border-bottom:0;border-top:.7rem solid var(--cherry)}
.chart-tip{position:absolute;z-index:6;pointer-events:none;background:var(--raised);border:1px solid var(--border-strong);border-radius:.8rem;
padding:.5rem .7rem;font-size:.82rem;line-height:1.4;box-shadow:0 .8rem 2rem rgba(0,0,0,.55);min-width:9rem;max-width:min(18rem,90%)}
.tip-date{font-weight:700;margin-bottom:.2rem}
.tip-row{display:flex;align-items:center;gap:.4rem;white-space:nowrap}
.tip-val{margin-left:auto;padding-left:.8rem;font-variant-numeric:tabular-nums;font-weight:600}
.tip-dot{width:.6rem;height:.6rem;border-radius:50%;flex:none}
.tip-dot.s0{background:var(--cherry)}.tip-dot.s1{background:var(--pool)}.tip-dot.s2{background:var(--purple-light)}.tip-dot.s3{background:var(--pistachio)}.tip-dot.s4{background:var(--bubblegum)}.tip-dot.paid{background:var(--sunshine)}
.price .tip-dot.s0{background:var(--pool)}
.tip-mark{margin-top:.25rem;font-weight:600}
.tip-mark.buy{color:var(--pistachio)}.tip-mark.sell{color:var(--cherry-text)}

/* coin charts fold away */
.fold{margin:.8rem 0}
.fold>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:.6rem;min-height:40px;padding:.5rem 1rem;
border-radius:999px;background:var(--raised);border:1px solid var(--border-strong);font-weight:600}
.fold>summary::-webkit-details-marker{display:none}
.fold>summary::after{content:"";width:.5rem;height:.5rem;border-right:2px solid var(--text-2);border-bottom:2px solid var(--text-2);transform:rotate(45deg);margin-top:-.2rem;transition:transform 150ms ease-out}
.fold[open]>summary::after{transform:rotate(-135deg);margin-top:.2rem}
.fold>summary:hover{background:var(--raised-2)}
.fold>summary:focus-visible{outline:2px solid var(--bubblegum);outline-offset:2px}
.fold-body{padding-top:.4rem}
.jump{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin:.4rem 0 .8rem}
section[id^="period-"]{scroll-margin-top:5.5rem}
@media (prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}
.chart .mark.buy{fill:var(--pistachio)}.chart .mark.sell{fill:var(--cherry)}

/* login */
.login{min-height:60vh;display:grid;place-items:center}
.login-card{width:100%;max-width:22rem;display:flex;flex-direction:column;align-items:stretch;text-align:left}
.login-card .big-disco{align-self:center}
.login-card h1{text-align:center;margin-bottom:.6rem}
.login-card input{width:100%;margin:.3rem 0 1rem}
input{background:var(--bg);color:var(--text);border:1px solid var(--border-strong);border-radius:.8rem;padding:.7rem .9rem;font:inherit;min-height:44px}
input:focus-visible{border-color:var(--bubblegum)}

.foot{display:flex;align-items:center;gap:.5rem;color:var(--text-2);font-size:.85rem;padding-bottom:1.5rem}
@media (max-width:520px){.top-in{padding-left:1rem;padding-right:1rem}.card{padding:1rem}}

/* motion: only opacity and transform (the line draw is the one named exception) */
@keyframes rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes draw{to{stroke-dashoffset:0}}
@media (prefers-reduced-motion:no-preference){
main>*,.panels>*{animation:rise 400ms var(--ease) backwards}
main>*:nth-child(2),.panels>*:nth-child(2){animation-delay:40ms}
main>*:nth-child(3),.panels>*:nth-child(3){animation-delay:80ms}
main>*:nth-child(4),.panels>*:nth-child(4){animation-delay:120ms}
main>*:nth-child(5),.panels>*:nth-child(5){animation-delay:160ms}
main>*:nth-child(n+6),.panels>*:nth-child(n+6){animation-delay:200ms}
.chart polyline.line[pathLength]{stroke-dasharray:1;stroke-dashoffset:1;animation:draw 700ms var(--ease) 100ms forwards}
.chart polyline.line.paid,.chart .dot{animation:fade 400ms ease-out 300ms backwards}
.chart .mark{animation:fade 300ms ease-out 700ms backwards}}
@media (prefers-reduced-motion:reduce){
main>*,.panels>*{animation:fade 200ms ease-out backwards}
.panel,.panel:hover{transition:none;transform:none}
.button:active,.seg a:active,.info summary:active{transform:none}
.fold>summary::after{transition:none}
.info[open] .popover{animation:fade 120ms ease-out}}
/* phones: the SVG is scaled down to about half size, so its text and lines are drawn larger */
@media (max-width:600px){.chart .tick{font-size:19px}.chart .line{stroke-width:3.5}.chart polyline.line.s0{stroke-width:4}}
