/* Bot Manager: design v4 + v2 header. True black, orange only where it means something. */
:root{
  --bg:#000; --grp:#121212; --sep:#262626; --fill:#1f1f21; --sheet:#0e0e0f;
  --text:#fff; --sec:#8e8e93; --ter:#5a5a5f; --chev:#48484c;
  --or:#ff8a1f; --gain:#3ccb8f; --loss:#ff6259;
  --st:env(safe-area-inset-top,0px); --sb:env(safe-area-inset-bottom,0px);
  --sl:env(safe-area-inset-left,0px); --sr:env(safe-area-inset-right,0px);
  color-scheme:dark;
}
*{box-sizing:border-box;margin:0;padding:0}
html{background:var(--bg);touch-action:manipulation;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{background:var(--bg);color:var(--text);min-height:100vh;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI Variable Text","Segoe UI",system-ui,sans-serif;
  font-size:17px;line-height:1.3;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;
  overscroll-behavior-y:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;text-align:inherit;-webkit-appearance:none;appearance:none}
button:disabled{cursor:default}
input{font:inherit;color:inherit}
:focus{outline:none}
:focus-visible{outline:2px solid var(--or);outline-offset:2px;border-radius:8px}
[tabindex="-1"]:focus-visible{outline:none}
.num{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}
.gain{color:var(--gain)} .loss{color:var(--loss)} .muted{color:var(--sec)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.noscript{padding:40px 20px;color:var(--sec)}
[hidden]{display:none!important}

/* layout */
.view{display:block;padding:calc(var(--st) + 6px) calc(16px + var(--sr)) calc(100px + var(--sb)) calc(16px + var(--sl));
  max-width:560px;margin:0 auto;min-height:100vh}
.view.bare{padding-bottom:calc(32px + var(--sb))}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:10;display:flex;justify-content:space-around;
  padding:7px var(--sr) calc(var(--sb) + 4px) var(--sl);min-height:calc(54px + var(--sb));
  background:rgba(18,18,18,.94);border-top:.5px solid var(--sep);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}
.tab{width:90px;min-height:46px;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10px;font-weight:500;color:var(--ter)}
.tab svg{width:26px;height:26px}
.tab[aria-current="page"]{color:var(--or)}

/* header (v2) */
.hd{display:flex;align-items:center;gap:11px;min-height:52px;margin:4px 0 2px}
.hd .ico{width:44px;height:44px;display:flex;align-items:center;justify-content:flex-start;border-radius:12px;flex:none}
.hd .ico img{width:40px;height:40px;border-radius:10px;display:block}
.hd h1{font-size:22px;font-weight:700;letter-spacing:-.3px}
.hd h1 b{color:var(--or);font-weight:700}
.pill{margin-left:auto;min-height:44px;display:flex;align-items:center}
.pill span{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;padding:6px 11px;border-radius:20px;
  background:#1f1f21;color:var(--sec);white-space:nowrap}
.pill i{width:7px;height:7px;border-radius:50%;background:currentColor;flex:none}
.pill.running span{background:rgba(60,203,143,.14);color:var(--gain)}
.pill.running i{box-shadow:0 0 0 3px rgba(60,203,143,.22)}
.pill.needs span{background:rgba(255,138,31,.15);color:var(--or)}
.pill.needs i{box-shadow:0 0 0 3px rgba(255,138,31,.25)}
.quiet{font-size:14px;color:var(--sec);margin:0 2px 18px}

/* nav + large titles */
.nav{display:flex;align-items:center;justify-content:space-between;min-height:44px;gap:8px}
.nav .grow{flex:1}
.navbtn{color:var(--or);font-size:17px;min-height:44px;min-width:44px;display:flex;align-items:center;justify-content:center;padding:0 4px}
.navbtn:disabled{color:var(--ter)}
.navbtn.plain{color:var(--text)}
.navbtn svg{width:22px;height:22px}
.back{color:var(--or);font-size:17px;min-height:44px;display:flex;align-items:center;gap:2px;padding-right:8px;margin-left:-6px}
.back svg{width:22px;height:22px}
.lt{font-size:34px;font-weight:700;letter-spacing:.2px;margin:2px 2px 12px;line-height:1.15}
.lead{font-size:15px;color:var(--sec);margin:-4px 4px 18px;line-height:1.4}

/* grouped lists */
.sh{font-size:13px;font-weight:400;color:var(--sec);margin:0 16px 7px}
.grp{background:var(--grp);border-radius:12px;margin-bottom:22px;overflow:hidden}
.it{display:flex;align-items:center;width:100%;min-height:46px;padding:0 16px;position:relative;gap:10px}
.it+.it::before{content:"";position:absolute;top:0;left:16px;right:0;border-top:.5px solid var(--sep)}
button.it:active{background:#1c1c1e}
.it .l{flex:1;min-width:0;font-size:17px;padding:11px 0}
.it .l small{display:block;font-size:14px;font-weight:400;color:var(--sec);margin-top:2px}
button.it:disabled .l{opacity:.45}
.it .l.bold{font-weight:600}
.it .v{font-size:17px;font-weight:500;white-space:nowrap}
.it .r{font-size:17px;color:var(--sec);white-space:nowrap}
.it .v small{display:block;font-size:13px;color:var(--sec);font-weight:400;text-align:right}
.chev{color:var(--chev);width:9px;height:15px;flex:none}
.danger{color:var(--loss)}
.orange,.it .r.orange{color:var(--or)}
.todayline{font-size:15px;color:var(--sec);margin:-8px 16px 22px;line-height:1.4}
.todayline b{color:var(--text);font-weight:600}
.todayline b.gain,.shead .ttl span.gain{color:var(--gain)} .todayline b.loss,.shead .ttl span.loss{color:var(--loss)}
.foot{font-size:13px;color:var(--sec);margin:-14px 16px 22px;line-height:1.4}
.empty{font-size:15px;color:var(--sec);text-align:center;padding:26px 20px;line-height:1.45}
.grp .empty{padding:22px 16px}

/* switch */
.tg{width:51px;height:31px;border-radius:16px;background:#39393d;position:relative;flex:none;transition:background .2s}
.tg::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:#fff;
  box-shadow:0 2px 4px rgba(0,0,0,.3);transition:left .2s}
.tg[aria-checked="true"]{background:var(--or)}
.tg[aria-checked="true"]::after{left:22px}
.tg:disabled{opacity:.55}
.swrow{min-height:50px}
.swrow .tgwrap{min-width:51px;min-height:44px;display:flex;align-items:center}

/* need rows */
.needrow .tx{flex:1;font-size:15px;line-height:1.35;padding:11px 0}
.needrow .tx small{display:block;color:var(--sec);font-size:13px;margin-top:2px}
.odot{width:8px;height:8px;border-radius:4px;background:var(--or);box-shadow:0 0 8px rgba(255,138,31,.8);flex:none;margin-right:2px}
.txtbtn{color:var(--or);font-size:15px;font-weight:600;min-height:44px;min-width:44px;display:flex;align-items:center;justify-content:flex-end;white-space:nowrap}
.txtbtn:disabled{color:var(--ter)}

/* segmented */
.seg{display:flex;background:var(--fill);border-radius:9px;padding:2px;width:100%;margin-bottom:16px}
.seg button{flex:1;text-align:center;font-size:13px;font-weight:600;min-height:32px;border-radius:7px;color:var(--text)}
.seg button[aria-pressed="true"]{background:#5a5a5e}
.seg button:disabled{color:var(--ter)}
.segwrap{margin-bottom:22px}
.segwrap .seg{margin:0}

/* stepper */
.stepper{display:flex;align-items:center;gap:12px}
.stepper .n{font-size:17px;font-weight:500;min-width:56px;text-align:right}
.was{display:block;font-size:12px;color:var(--sec);text-align:right;font-weight:400}
.stp{display:flex;background:var(--fill);border-radius:8px;height:32px;margin:6px 0}
.stp button{width:47px;display:flex;align-items:center;justify-content:center;font-size:20px;position:relative}
.stp button::after{content:"";position:absolute;inset:-6px 0}
.stp button+button{border-left:.5px solid #3a3a3d}
.stp button:disabled{color:var(--ter)}

/* primary */
.primary{width:100%;background:var(--or);color:#1a0a00;border-radius:14px;min-height:50px;display:flex;align-items:center;justify-content:center;
  font-size:17px;font-weight:600;text-align:center}
.primary:disabled{background:#3a2610;color:#8a6a48}
.note{text-align:center;font-size:13px;color:var(--sec);margin-top:8px;line-height:1.4}
.note.err{color:var(--loss)}

/* sheets */
.scrim{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:20;animation:fade .2s ease-out}
.sheet{position:fixed;left:0;right:0;bottom:0;top:calc(var(--st) + 12px);z-index:21;background:var(--sheet);border-radius:16px 16px 0 0;
  display:flex;flex-direction:column;max-width:560px;margin:0 auto;animation:rise .28s cubic-bezier(.2,.8,.2,1)}
.sheet .sbody{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
  padding:0 calc(16px + var(--sr)) calc(28px + var(--sb)) calc(16px + var(--sl))}
.grab{width:36px;height:5px;border-radius:3px;background:var(--chev);margin:6px auto 0;flex:none}
.shead{display:grid;grid-template-columns:80px 1fr 80px;align-items:center;min-height:52px;padding:0 16px}
.shead .ttl{text-align:center;min-width:0}
.shead .ttl h2{font-size:17px;font-weight:600}
.shead .ttl span{font-size:13px;color:var(--sec)}
.shead .cancel{color:var(--sec);font-size:17px;min-height:44px;text-align:left}
.shead .act{color:var(--or);font-size:17px;font-weight:600;min-height:44px;text-align:right}
.shead .act:disabled{color:var(--ter)}
.under{transition:transform .28s,opacity .28s}
body.sheeted .view{opacity:.5;transform:scale(.94);transform-origin:top center}

/* text field */
.field{display:flex;align-items:center;min-height:46px;padding:0 16px}
.field input{flex:1;min-width:0;background:none;border:0;font-size:17px;padding:11px 0;outline:none}
.field input::placeholder{color:var(--ter)}
.fielderr{font-size:13px;color:var(--loss);margin:-14px 16px 22px}

/* alert */
.alert{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:31;width:270px;background:rgba(40,40,42,.97);
  border-radius:14px;text-align:center;overflow:hidden;animation:pop .2s ease-out;
  -webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}
.alert .b{padding:19px 16px 16px}
.alert h2{font-size:17px;font-weight:600;margin-bottom:4px;line-height:1.3}
.alert p{font-size:13px;line-height:1.38;color:#e0e0e4}
.alert p+p{margin-top:6px}
.alert .row2{display:grid;grid-template-columns:1fr 1fr;border-top:.5px solid var(--chev)}
.alert .row2 button{font-size:17px;color:var(--or);min-height:44px;padding:11px 6px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.alert .row2 button+button{border-left:.5px solid var(--chev);font-weight:600}
.alert .row2 button:focus-visible{outline-offset:-3px;border-radius:0}
.scrim.dark{z-index:30}
/* already on screen: a re-render never replays the open animation */
.scrim.still,.sheet.still,.alert.still{animation:none}

/* toast */
.toast{position:fixed;left:0;right:0;margin:0 auto;width:max-content;top:calc(var(--st) + 10px);transform:translateY(-140%);z-index:40;background:#2c2c2e;border-radius:22px;
  padding:11px 18px;font-size:15px;font-weight:500;display:flex;align-items:center;gap:9px;max-width:calc(100vw - 32px);
  box-shadow:0 8px 24px rgba(0,0,0,.5);opacity:0;pointer-events:none;transition:transform .3s,opacity .3s}
.toast.show{transform:translateY(0);opacity:1}
.toast svg{width:18px;height:18px;flex:none}
.toast.bad svg{color:var(--loss)}
.toast span{overflow:hidden;text-overflow:ellipsis}

/* rounds */
.rd{padding:13px 16px 14px;position:relative}
.rd+.rd::before{content:"";position:absolute;top:0;left:16px;right:0;border-top:.5px solid var(--sep)}
.rd .a{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.rd .nm{font-size:17px;font-weight:600;min-width:0}
.rd .nm span{color:var(--sec);font-weight:400}
.rd .tl{font-size:14px;color:var(--sec);white-space:nowrap}
.rd .who{font-size:14px;color:var(--sec);margin-top:2px}
.range{display:flex;align-items:center;gap:10px;margin-top:11px}
.range .lim{font-size:13px;color:var(--sec);width:44px}
.range .lim.r{text-align:right}
.line{flex:1;height:2px;background:#333336;position:relative;border-radius:1px}
.line .z{position:absolute;top:-4px;width:1px;height:10px;background:#55555a}
.line .dot{position:absolute;top:-5px;width:12px;height:12px;border-radius:50%;background:#fff;margin-left:-6px;box-shadow:0 0 0 3px var(--grp)}
.range .pct{font-size:15px;font-weight:600;width:62px;text-align:right}
.jrow{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:44px;margin-bottom:-8px}
.jrow .who{margin:0}

/* history */
.week{display:grid;grid-template-columns:repeat(7,1fr);margin:0 0 22px;text-align:center;touch-action:pan-y}
.week button{display:flex;flex-direction:column;align-items:center;min-height:44px;padding-bottom:2px}
.week .d{font-size:12px;color:var(--sec);font-weight:500}
.week .n{width:36px;height:36px;margin:6px auto 7px;border-radius:18px;display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:500}
.week button[aria-pressed="true"] .n{background:#fff;color:#000;font-weight:600}
.week .n.today{box-shadow:inset 0 0 0 1.5px #fff}
.week button:disabled .n{color:var(--ter)}
.week .bar{height:14px;display:flex;align-items:flex-start;justify-content:center}
.week .bar i{width:16px;border-radius:2px;display:block}
.week .bar i.g{background:var(--gain)} .week .bar i.l{background:var(--loss)}
.week .bar i.open{background:none;border:1.5px solid var(--gain)}
.week .bar i.open.l{border-color:var(--loss)}
.week .bar i.h1{height:6px} .week .bar i.h2{height:9px} .week .bar i.h3{height:14px}
.rangeline{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:-4px 4px 16px;font-size:15px;color:var(--sec)}

/* calendar */
.cal{background:var(--grp);border-radius:12px;padding:8px 8px 12px;margin-bottom:22px}
.cal .mh{display:flex;align-items:center;justify-content:space-between;padding:0 4px 0 10px}
.cal .mh h3{font-size:17px;font-weight:600}
.cal .mh div{display:flex}
.cal .grid{display:grid;grid-template-columns:repeat(7,1fr);text-align:center}
.cal .dw{font-size:12px;color:var(--sec);font-weight:500;padding:8px 0 4px}
.cal .grid button{min-height:44px;display:flex;align-items:center;justify-content:center}
.cal .grid button span{width:38px;height:38px;border-radius:19px;display:flex;align-items:center;justify-content:center;font-size:17px;color:var(--sec)}
.cal .grid button:disabled span{color:var(--ter)}
.cal .grid button.has span{color:var(--text);font-weight:600}
.cal .grid button.today span{box-shadow:inset 0 0 0 1.5px #fff}
.cal .grid button[aria-pressed="true"] span{background:var(--or);color:#1a0a00}

/* person */
.fr .l small{display:block}
.tag{font-size:12px;color:var(--sec);border:1px solid var(--sep);border-radius:6px;padding:1px 5px;margin-left:6px;vertical-align:1px;font-weight:500}

/* top creators edit */
.del{width:44px;height:44px;display:flex;align-items:center;justify-content:center;margin-left:-12px;flex:none}
.del i{width:22px;height:22px;border-radius:50%;background:var(--loss);position:relative;display:block}
.del i::after{content:"";position:absolute;left:5px;right:5px;top:10px;height:2px;background:#fff;border-radius:1px}
.del:disabled i{background:#5c2a28}

/* alerts screen */
.legend .it{min-height:44px}
.legend .pill{margin:0;min-height:0;width:104px;flex:none}
.legend .l{font-size:15px;color:var(--sec)}
.al .l b{display:block;font-size:15px;font-weight:600}
.al .l span{display:block;font-size:14px;color:var(--sec);margin-top:2px;line-height:1.35;white-space:pre-line;
  display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.al .tm{font-size:14px;color:var(--sec);align-self:flex-start;padding-top:12px;white-space:nowrap}

/* sign in */
.signin{min-height:calc(100vh - var(--st) - 40px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:0 12px}
.signin img{width:96px;height:96px;border-radius:22px;margin-bottom:20px}
.signin h1{font-size:28px;font-weight:700;letter-spacing:-.3px}
.signin h1 b{color:var(--or)}
.signin p{font-size:15px;color:var(--sec);margin:10px 0 28px;line-height:1.45;max-width:300px}
.signin .primary{max-width:320px}
.signin .note{min-height:20px}

/* offline / stale: numbers dim, nothing looks live */
.stale .v,.stale .pct,.stale .todayline b,.stale .gain,.stale .loss{color:var(--sec)!important}
.stale .line .dot{background:var(--sec)}
.off .v,.off .v.gain,.off .v.loss{color:var(--sec)}

@keyframes fade{from{opacity:0}}
@keyframes rise{from{transform:translateY(100%)}}
@keyframes pop{from{opacity:0;transform:translate(-50%,-50%) scale(1.1)}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
}
@media (min-width:600px){ .sheet{border-radius:16px;bottom:12px} }
