  :root{
    --bg:#0d0d0f;
    --panel:#16161a;
    --panel2:#1d1d22;
    --line:#2a2a30;
    --ink:#e8e8ea;
    --dim:#8a8a92;
    --red:#d02a2a;
    --redglow:rgba(208,42,42,.22);
    --done:#3a6a3a;
    /* The heading and number font, in one place so trying another
       is a one-line change. Tried and dropped in Nov 2026: Saira (too
       blocky), Sofia Sans, and Apple's SF. Barlow stayed. */
    --display:'Barlow Semi Condensed',system-ui,sans-serif;
  }
  *{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;}
  body{
    padding-top:env(safe-area-inset-top) !important;
    background:var(--bg);
    color:var(--ink);
    font-family:'Inter',system-ui,sans-serif;
    line-height:1.5;
    padding:0 0 48px;
    max-width:560px;
    margin:0 auto;
    min-height:100vh;
  }
  .head{
    padding:32px 20px 20px;
    border-bottom:1px solid var(--line);
    position:relative;
    overflow:hidden;
  }
  .head::before{
    content:"";
    position:absolute;
    top:-40px;right:-30px;
    width:160px;height:160px;
    background:radial-gradient(circle,var(--redglow),transparent 68%);
    pointer-events:none;
  }
  .kicker{
    font-family:var(--display);
    font-weight:600;
    letter-spacing:.14em;
    color:var(--red);
    font-size:12px;
    margin-bottom:6px;
  }
  h1{
    font-family:var(--display);
    font-weight:700;
    font-size:38px;
    line-height:.98;
    letter-spacing:.01em;
  }
  h1 span{color:var(--dim);font-weight:500;}
  .sub{color:var(--dim);font-size:14px;margin-top:10px;max-width:44ch;}

  .morning{
    display:flex;gap:10px;overflow-x:auto;
    padding:16px 20px;border-bottom:1px solid var(--line);
    scrollbar-width:none;
  }
  .morning::-webkit-scrollbar{display:none;}
  .mstep{
    flex:0 0 auto;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:9px;
    padding:9px 13px;
    font-size:13px;
    white-space:nowrap;
    color:var(--dim);
  }
  .mstep b{color:var(--ink);font-weight:600;}

  .tabs{
    display:flex;gap:6px;overflow-x:auto;
    padding:16px 20px 4px;
    scrollbar-width:none;position:sticky;top:0;
    background:var(--bg);z-index:5;
  }
  .tabs::-webkit-scrollbar{display:none;}
  .tab{
    flex:0 0 auto;
    font-family:var(--display);
    font-weight:600;font-size:15px;
    letter-spacing:.04em;
    padding:8px 14px;border-radius:8px;
    background:var(--panel);
    border:1px solid var(--line);
    color:var(--dim);cursor:pointer;
    transition:.15s;
  }
  .tab.active{background:var(--red);border-color:var(--red);color:#fff;}
  .tab.rest{opacity:.6;}

  .wrap{padding:18px 20px 0;}
  .daytitle{
    font-family:var(--display);
    font-weight:700;font-size:24px;
    margin-bottom:2px;
  }
  .dayfocus{color:var(--red);font-size:13px;font-weight:600;margin-bottom:16px;
    font-family:var(--display);letter-spacing:.05em;}

  /* Top-aligned, not centred: rows with the set/weight buttons are
     taller, and centring dropped the checkbox and "3×10" below the
     exercise name. Name, box and sets share one 22px line height so
     they sit level on that first line. */
  .ex{
    display:flex;align-items:flex-start;gap:14px;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:10px;
    padding:13px 15px;margin-bottom:9px;
    cursor:pointer;transition:.15s;
  }
  .ex:active{transform:scale(.99);}
  .ex.done{background:var(--panel2);border-color:var(--done);}
  .box{
    flex:0 0 auto;width:22px;height:22px;border-radius:6px;
    border:2px solid var(--line);display:grid;place-items:center;
    transition:.15s;
  }
  .ex.done .box{background:var(--done);border-color:var(--done);}
  .box svg{opacity:0;transition:.15s;}
  .ex.done .box svg{opacity:1;}
  .exname{flex:1;font-size:15px;font-weight:500;line-height:22px;min-width:0;}
  .ex.done .exname{color:var(--dim);}
  /* Only the name gets crossed out; the set and weight buttons under it
     stay readable on a finished exercise. */
  .ex.done .exname .nm{text-decoration:line-through;text-decoration-color:var(--dim);}
  .exmeta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;align-items:center;}
  .setbtn,.liftbtn{
    background:var(--panel2);border:1px solid var(--line);color:var(--ink);
    border-radius:7px;padding:5px 10px;font-family:inherit;font-size:12px;
    cursor:pointer;line-height:1.2;
  }
  /* Same font as the word "sets" beside it; tabular figures keep the
     button from changing width as the count goes up. */
  .setbtn b{font-weight:700;color:var(--red);font-variant-numeric:tabular-nums;}
  .setbtn.full{border-color:var(--done);}
  .setbtn.full b{color:inherit;}
  .liftbtn.empty{color:var(--dim);border-style:dashed;}
  .setbtn:active,.liftbtn:active{border-color:var(--red);}
  .liftedit{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:8px;}
  /* Box and buttons share one 34px height so the row reads as one
     control. 16px text stops iPhones zooming in on tap. */
  .liftedit input{width:76px;height:34px;box-sizing:border-box;background:#121212;border:1px solid #2a2a2a;color:#fff;
    border-radius:7px;padding:0 10px;font-family:inherit;font-size:16px;}
  .liftedit .u{color:var(--dim);font-size:13px;}
  .liftedit button{height:34px;box-sizing:border-box;background:var(--red);border:1px solid var(--red);color:#fff;border-radius:7px;
    padding:0 14px;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;}
  .liftedit button.ghost{background:none;border:1px solid var(--line);color:var(--dim);font-weight:500;
    width:34px;padding:0;font-size:14px;}
  .liftedit .was{flex-basis:100%;color:var(--dim);font-size:11.5px;}
  .liftrow{padding:12px 0;border-top:1px solid var(--line);}
  .liftrow:first-child{border-top:none;padding-top:0;}
  .lifthead{display:flex;justify-content:space-between;align-items:baseline;gap:10px;}
  .lifthead b{font-weight:500;font-size:14.5px;}
  .lifthead span{font-family:var(--display);font-weight:700;font-size:20px;white-space:nowrap;}
  .lifthead span small{color:var(--dim);font-size:12px;font-weight:500;margin-left:3px;}
  .liftsub{color:var(--dim);font-size:12px;margin-top:3px;}
  .liftsub .up{color:#4ea35a;}
  /* A row with enough history is a button that opens its own chart.
     Plain reset so it looks exactly like the rows that can't open. */
  .lifttoggle{display:block;width:100%;background:none;border:none;padding:0;margin:0;
    color:inherit;font:inherit;text-align:left;cursor:pointer;}
  .lifttoggle > .liftsub{display:block;}
  .lifthead .right{display:flex;align-items:center;gap:8px;}
  .chev{width:16px;height:16px;color:var(--dim);transition:transform .2s ease;flex-shrink:0;}
  .lifttoggle[aria-expanded="true"] .chev{transform:rotate(180deg);color:var(--ink);}
  .lifttoggle:focus-visible{outline:1px solid var(--red);outline-offset:4px;border-radius:6px;}
  .liftchart{padding-top:2px;}
  .liftchart[hidden]{display:none;}
  @media (prefers-reduced-motion: reduce){ .chev{transition:none;} }
  .sets{
    font-family:var(--display);font-weight:600;
    color:var(--red);font-size:15px;white-space:nowrap;line-height:22px;
  }
  .ex.done .sets{color:var(--dim);}

  .restday{
    background:var(--panel);border:1px solid var(--line);
    border-radius:12px;padding:26px 20px;text-align:center;color:var(--dim);
  }
  .restday b{color:var(--ink);display:block;font-size:18px;margin-bottom:6px;
    font-family:var(--display);font-weight:700;letter-spacing:.03em;}

  .note{color:var(--dim);font-size:13px;margin:16px 2px 4px;line-height:1.55;}
  /* The tip under the exercise list sits outside the padded .wrap, so
     it hugged the screen edge on a phone. Same 20px inset as the cards. */
  #daynote{margin:14px 20px 4px;}

  .section{padding:26px 20px 0;}
  .sechead{
    font-family:var(--display);font-weight:700;
    font-size:20px;letter-spacing:.03em;margin-bottom:14px;
    display:flex;align-items:center;gap:10px;
  }
  .sechead::before{content:"";width:6px;height:20px;background:var(--red);border-radius:2px;}
  .calc{
    background:var(--panel);border:1px solid var(--line);
    border-radius:12px;padding:16px;margin-bottom:14px;
  }
  .calc label{font-size:13px;color:var(--dim);display:block;margin-bottom:8px;}
  .calcrow{display:flex;gap:10px;align-items:center;}
  .calc input{
    flex:1;background:var(--bg);border:1px solid var(--line);
    border-radius:8px;color:var(--ink);font-size:16px;
    padding:11px 13px;font-family:inherit;width:100%;
  }
  .calc input:focus{outline:none;border-color:var(--red);}
  .unit{color:var(--dim);font-size:14px;}

  .targets{margin-top:16px;padding-top:4px;border-top:1px solid var(--line);}
  .trow{
    display:flex;justify-content:space-between;align-items:baseline;
    padding:11px 0;border-bottom:1px solid var(--line);
  }
  .trow:last-child{border-bottom:none;}
  .tlab{font-size:14px;}
  .tlab small{display:block;color:var(--dim);font-size:11.5px;margin-top:1px;}
  .tval{
    font-family:var(--display);font-weight:700;
    font-size:21px;white-space:nowrap;
  }
  .tval.key{color:var(--red);}
  .tval small{color:var(--dim);font-size:13px;font-weight:600;}

  .food{
    background:var(--panel);border:1px solid var(--line);
    border-radius:10px;padding:13px 15px;margin-bottom:9px;
    font-size:14px;
  }
  .food b{font-family:var(--display);font-weight:600;
    font-size:15px;display:block;margin-bottom:2px;letter-spacing:.02em;}
  .food span{color:var(--dim);}

  .reset{
    display:block;width:calc(100% - 40px);margin:28px 20px 0;
    background:transparent;border:1px solid var(--line);
    color:var(--dim);border-radius:10px;padding:13px;
    font-family:inherit;font-size:14px;cursor:pointer;transition:.15s;
  }
  .reset:active{border-color:var(--red);color:var(--red);}
  .foot{text-align:center;color:var(--dim);font-size:12px;padding:24px 20px 0;line-height:1.6;}

    .daybtns{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;}
    .daybtns .editbtn{margin-bottom:0;}
    .movepick{
      background:var(--panel);border:1px solid var(--line);border-radius:12px;
      padding:13px 14px;margin-bottom:14px;
    }
    .movepick > span{display:block;color:var(--dim);font-size:12.5px;margin-bottom:10px;line-height:1.5;}
    .moveday{
      background:var(--panel2);border:1px solid #3a3a44;color:var(--ink);
      font-family:var(--display);font-weight:600;font-size:14px;
      padding:9px 0;border-radius:9px;cursor:pointer;min-width:52px;
    }
    .moveday:active{background:var(--red);border-color:var(--red);}
    .movegrid{display:flex;gap:6px;flex-wrap:wrap;}
    .editbtn{background:none;border:1px solid #333;color:#aaa;font-size:12px;padding:6px 12px;border-radius:8px;margin-bottom:12px;cursor:pointer;font-family:inherit;}
    .editbtn:active{background:#1a1a1a;}
    .exedit{display:flex;gap:8px;margin-bottom:8px;align-items:center;}
    /* 16px, like every other input in the app: below that, iPhones zoom
       the whole page in when you tap the box. */
    .exedit input{background:#121212;border:1px solid #2a2a2a;color:#fff;border-radius:8px;padding:10px;font-family:inherit;font-size:16px;}
    /* min-width:0 lets the name box shrink on a narrow phone; without
       it, inputs refuse to get smaller and push ✕ off the screen. */
    .exedit .ename{flex:1;min-width:0;}
    .exedit .esets{width:92px;padding-left:4px;padding-right:4px;color:#e23;text-align:center;}
    .exedit .erem{background:none;border:none;color:#666;font-size:16px;cursor:pointer;padding:6px;}
    /* The grip you drag a row by. touch-action:none stops the phone
       scrolling the page instead of moving the row. */
    .exedit .egrip{background:none;border:none;color:#666;cursor:grab;padding:8px 4px;
      display:flex;align-items:center;touch-action:none;flex-shrink:0;}
    .exedit .egrip:focus-visible{outline:1px solid var(--red);border-radius:6px;}
    .exedit.dragging{background:#1b1b1b;outline:1px solid var(--red);border-radius:8px;}
    .exedit.dragging .egrip{cursor:grabbing;color:var(--red);}
    body.dragging-ex{user-select:none;-webkit-user-select:none;}
    .addbtn{background:none;border:1px dashed #333;color:#888;width:100%;padding:12px;border-radius:8px;font-family:inherit;font-size:13px;cursor:pointer;margin-top:4px;}
    .addbtn:active{background:#141414;}

  .calc input[type=number],.calc select{
    width:100%;background:var(--panel);border:1px solid var(--line);
    border-radius:10px;color:var(--ink);font-size:16px;
    padding:13px;font-family:inherit;
  }
  .calc input:focus,.calc select:focus{outline:none;border-color:var(--red);}
  .calc label{display:block;color:var(--dim);font-size:12px;margin:12px 0 5px;}
  .calcnote{color:#6a6a72;font-size:11px;line-height:1.5;margin:14px 0 4px;}

  .welcome{padding:24px 20px 4px;}
  .welcome h2{font-family:var(--display);font-weight:700;font-size:30px;line-height:1.1;margin:4px 0 8px;}
  .welcome p{color:var(--dim);font-size:14px;line-height:1.6;}

  .restorebtn{
    width:100%;margin-top:16px;background:transparent;
    border:1px dashed var(--line);color:var(--dim);
    border-radius:10px;padding:13px;font-family:inherit;
    font-size:14px;cursor:pointer;
  }
  .restorebtn:active{border-color:var(--red);color:var(--red);}

  .modeswitch{display:flex;gap:8px;padding:14px 20px 0;}
  .modebtn{
    flex:1;background:var(--panel);border:1px solid var(--line);
    color:var(--dim);border-radius:10px;padding:11px;
    font-family:var(--display);font-weight:600;letter-spacing:.06em;
    font-size:14px;cursor:pointer;
  }
  .modebtn.on{background:var(--red);border-color:var(--red);color:#fff;}
  .howto{
    display:inline-block;margin-left:8px;color:var(--dim);
    font-size:11px;text-decoration:none;border:1px solid var(--line);
    border-radius:6px;padding:2px 7px;vertical-align:middle;
  }
  .howto:active{border-color:var(--red);color:var(--red);}
  .ex.done .howto{opacity:.45;}

  .upgradebtn{
    display:block;width:calc(100% - 40px);margin:14px 20px 0;
    background:transparent;border:1px dashed var(--line);
    color:var(--dim);border-radius:10px;padding:12px;
    font-family:inherit;font-size:13px;cursor:pointer;
  }
  .upgradebtn:active{border-color:var(--red);color:var(--red);}

  /* ===== Bottom tab bar =====
     Floats clear of the screen edge so it reads as a control, not a
     footer. The active tab sits on a solid red block — at a glance,
     from arm's length, mid-set. */
  .bottomnav{
    position:fixed;z-index:50;
    left:14px;right:14px;
    bottom:calc(14px + env(safe-area-inset-bottom));
    max-width:532px;margin:0 auto;
    display:flex;gap:4px;
    padding:5px;
    background:rgba(22,22,26,.92);
    backdrop-filter:blur(16px) saturate(140%);
    -webkit-backdrop-filter:blur(16px) saturate(140%);
    border:1px solid #32323a;
    border-radius:16px;
    box-shadow:0 10px 30px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.4);
  }
  .navbtn{
    flex:1;background:transparent;border:none;cursor:pointer;
    display:flex;flex-direction:column;align-items:center;gap:5px;
    padding:11px 4px 10px;border-radius:12px;
    font-family:var(--display);font-weight:600;
    font-size:13px;letter-spacing:.01em;
    color:#9a9aa4;
    transition:background .18s ease, color .18s ease;
    -webkit-tap-highlight-color:transparent;
  }
  .navbtn svg{display:block;width:21px;height:21px;}
  .navbtn.on{
    background:var(--red);
    color:#fff;
    box-shadow:0 2px 10px rgba(208,42,42,.4);
  }
  .navbtn:not(.on):active,.navbtn.pressed:not(.on){background:#232329;color:var(--ink);}
  .navbtn:focus-visible{outline:2px solid #fff;outline-offset:2px;}
  @media (prefers-reduced-motion: reduce){
    .navbtn{transition:none;}
  }
  .pane{padding-bottom:4px;}
  /* The nav floats 14px off the bottom and stands 75px tall, so it eats
     89px. Padding has to clear that AND leave a visible gap, or the last
     card on a tab looks jammed under the bar. 89 + 40 = 129. */
  body{padding-bottom:calc(132px + env(safe-area-inset-bottom)) !important;}

  /* ===== Photo upload ===== */
  .opt{color:#5a5a62;font-size:11px;text-transform:none;letter-spacing:0;}
  .filein{
    width:100%;background:var(--panel);border:1px dashed var(--line);
    border-radius:10px;color:var(--dim);font-size:13px;
    padding:12px;font-family:inherit;
  }
  .filein::file-selector-button{
    background:var(--panel2);border:1px solid var(--line);color:var(--ink);
    border-radius:7px;padding:7px 12px;font-family:inherit;font-size:13px;
    margin-right:10px;cursor:pointer;
  }
  .photoprev{
    width:100%;max-height:220px;object-fit:cover;
    border-radius:10px;margin-top:10px;display:block;
    border:1px solid var(--line);
  }
  .permission{
    display:flex;gap:9px;align-items:flex-start;
    margin-top:11px;color:var(--dim);font-size:12px;line-height:1.5;
  }
  .permission input{width:17px;height:17px;flex:0 0 auto;margin-top:1px;accent-color:var(--red);}
  .clearphoto{
    width:100%;margin-top:9px;background:none;border:1px solid var(--line);
    color:var(--dim);border-radius:9px;padding:9px;
    font-family:inherit;font-size:12px;cursor:pointer;
  }
  .snaphint{
    width:100%;margin-top:10px;background:var(--panel2);
    border:1px solid var(--line);color:var(--ink);
    border-radius:10px;padding:11px 12px;
    font-family:inherit;font-size:13px;
  }
  .snaphint::placeholder{color:#6a6a72;}
  .snaphint:focus{outline:none;border-color:#4a4a56;}
  .snapportion{
    display:flex;align-items:center;gap:7px;flex-wrap:wrap;
    color:var(--dim);font-size:12.5px;margin-bottom:9px;
  }
  .conf{
    font-size:10.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
    padding:3px 7px;border-radius:5px;border:1px solid;
  }
  .conf.high{color:#7fd4a0;border-color:#2f5c43;}
  .conf.medium{color:#d9c07a;border-color:#5c5030;}
  .conf.low{color:#e08f7a;border-color:#6b3f34;}
  .refine{
    width:100%;margin-top:4px;margin-bottom:12px;background:none;
    border:1px dashed var(--line);color:var(--dim);border-radius:9px;padding:10px;
    font-family:inherit;font-size:12px;cursor:pointer;
  }
  .logrow{display:flex;gap:8px;margin-top:6px;align-items:stretch;}
  .snapmain{
    flex:1.4;display:flex;align-items:center;justify-content:center;gap:8px;
    background:var(--panel2);border:1px solid #3a3a44;color:var(--ink);
    border-radius:10px;padding:13px;
    font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;
  }
  .snapmain svg{width:18px;height:18px;flex:0 0 auto;}
  .snapmain:active{border-color:var(--red);color:var(--red);}
  .snapmain:disabled{opacity:.55;}
  .logrow .addfood{flex:1;}
  .logrow .addfood{margin-top:0;}
  .snapcard{
    margin-top:12px;background:var(--panel);
    border:1px solid var(--line);border-radius:12px;padding:16px;
  }
  .snapcard h4{
    font-family:var(--display);font-weight:600;font-size:13px;
    letter-spacing:.1em;color:var(--red);margin-bottom:9px;
  }
  .snapname{font-family:var(--display);font-weight:600;font-size:19px;margin-bottom:6px;}
  .snapnote{color:var(--dim);font-size:12px;line-height:1.55;margin-bottom:12px;}
  .snapgrid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px;}
  .snapgrid label{display:block;color:var(--dim);font-size:11px;margin-bottom:4px;}
  .snapgrid input{
    width:100%;background:var(--panel2);border:1px solid var(--line);
    border-radius:8px;color:var(--ink);font-size:15px;
    padding:10px;font-family:inherit;
  }
  .snapgrid input:focus{outline:none;border-color:var(--red);}

  /* ===== Meals ===== */
  .meals{padding:0 20px;}
  .meal{
    background:var(--panel);border:1px solid var(--line);
    border-radius:12px;padding:14px;margin-bottom:9px;
  }
  .mealtop{display:flex;align-items:baseline;gap:8px;margin-bottom:4px;}
  .mealname{
    font-family:var(--display);font-weight:600;
    font-size:16px;flex:1;letter-spacing:.01em;
  }
  .mealwhen{
    color:var(--red);font-size:10px;letter-spacing:.12em;
    font-family:var(--display);font-weight:600;
    text-transform:uppercase;white-space:nowrap;
  }
  .mealhow{color:var(--dim);font-size:13px;line-height:1.55;margin-bottom:10px;}
  .mealmacros{color:var(--dim);font-size:12px;margin-bottom:11px;}
  .mealmacros b{color:var(--ink);font-weight:600;}
  .logmeal{
    width:100%;background:var(--panel2);border:1px solid var(--line);
    color:var(--ink);border-radius:9px;padding:10px;
    font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;
  }
  .logmeal:active{background:var(--red);border-color:var(--red);color:#fff;}
  .logmeal.added{background:var(--done);border-color:var(--done);color:#fff;}
  .mealsempty{color:var(--dim);font-size:13px;line-height:1.6;padding:0 0 4px;}

  /* ===== Plan identity card ===== */
  .idcard{margin:20px 20px 4px;}
  .idcard.empty{display:none;}
  .idinner{
    position:relative;overflow:hidden;
    background:var(--panel);border:1px solid var(--line);
    border-radius:14px;padding:20px;
  }
  .idinner::before{
    content:"";position:absolute;top:-50px;right:-40px;
    width:170px;height:170px;
    background:radial-gradient(circle,var(--redglow),transparent 70%);
    pointer-events:none;
  }
  .idcode{
    font-family:var(--display);font-weight:600;
    letter-spacing:.16em;color:var(--red);font-size:11.5px;margin-bottom:7px;
  }
  .idtitle{
    font-family:var(--display);font-weight:700;
    font-size:30px;line-height:1;margin-bottom:4px;
  }
  .idtag{color:var(--dim);font-size:15px;margin-bottom:14px;}
  .idmeta{
    display:flex;gap:18px;padding-top:13px;
    border-top:1px solid var(--line);
  }
  .idmeta div{min-width:0;}
  .idmeta b{
    display:block;font-family:var(--display);font-weight:600;
    font-size:17px;line-height:1.1;margin-bottom:2px;
  }
  .idmeta span{color:var(--dim);font-size:11px;letter-spacing:.04em;}

  /* ===== Tasks ===== */
  .tasks{padding:0 20px;}
  .taskempty,.routineintro{color:var(--dim);font-size:13px;line-height:1.6;margin-bottom:12px;}
  .traintask{
    width:100%;display:flex;align-items:center;gap:12px;
    background:var(--panel);border:1px solid var(--line);
    border-left:3px solid var(--red);
    border-radius:11px;padding:13px 14px;margin-bottom:14px;
    font-family:inherit;text-align:left;cursor:pointer;color:var(--ink);
  }
  .tt-l{flex:1;}
  .tt-l b{
    display:block;font-family:var(--display);font-weight:600;
    font-size:16px;margin-bottom:2px;
  }
  .tt-l small{color:var(--dim);font-size:12px;}
  .tt-go{color:var(--red);font-size:12.5px;font-weight:600;white-space:nowrap;}

  .taskrow{cursor:pointer;-webkit-tap-highlight-color:transparent;
    display:flex;align-items:center;gap:11px;
    background:var(--panel);border:1px solid var(--line);
    border-radius:10px;padding:12px 13px;margin-bottom:7px;
  }
  .taskrow.done{opacity:.5;}
  .taskrow.done .taskname{text-decoration:line-through;}
  .taskbox{
    width:22px;height:22px;flex:0 0 auto;border-radius:6px;
    border:1.5px solid #3c3c46;background:transparent;
    display:grid;place-items:center;cursor:pointer;padding:0;
  }
  .taskbox svg{opacity:0;}
  .taskrow.done .taskbox{background:var(--done);border-color:var(--done);}
  .taskrow.done .taskbox svg{opacity:1;}
  .taskname{flex:1;font-size:14.5px;line-height:1.35;}
  .tag{
    display:inline-block;margin-left:7px;font-style:normal;
    font-size:10px;letter-spacing:.08em;text-transform:uppercase;
    color:#6a6a72;border:1px solid var(--line);border-radius:4px;padding:1px 5px;
    vertical-align:middle;
  }
  .taskdel{
    background:none;border:none;color:#55555e;font-size:15px;
    cursor:pointer;padding:3px 2px 3px 8px;flex:0 0 auto;
  }

  .addtask{display:flex;gap:8px;margin-top:12px;}
  .addtask input{
    flex:1;background:var(--panel);border:1px solid var(--line);
    border-radius:10px;color:var(--ink);font-size:16px;
    padding:13px;font-family:inherit;min-width:0;
  }
  .addtask input:focus{outline:none;border-color:var(--red);}
  .addtask button{
    flex:0 0 auto;background:var(--red);border:1px solid var(--red);
    color:#fff;border-radius:10px;padding:13px 20px;
    font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;
  }
  .taskhint{color:#6a6a72;font-size:11.5px;margin-top:10px;line-height:1.5;}

  .routine{
    background:var(--panel);border:1px solid var(--line);
    border-radius:11px;padding:13px;margin-bottom:8px;
  }
  .rtop{display:flex;align-items:center;gap:8px;margin-bottom:10px;}
  .rname{flex:1;font-size:14.5px;}
  .rdays{display:flex;gap:5px;}
  .rday{
    flex:1;aspect-ratio:1;max-height:34px;
    background:#1f1f25;border:1px solid transparent;
    color:#6a6a72;border-radius:7px;padding:0;
    font-family:var(--display);font-weight:600;font-size:13px;
    cursor:pointer;
  }
  .rday.on{background:var(--red);color:#fff;}

  .presets{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px;}
  .chip{
    background:transparent;border:1px dashed var(--line);
    color:var(--dim);border-radius:99px;padding:8px 13px;
    font-family:inherit;font-size:12.5px;cursor:pointer;
  }
  .chip:active{border-color:var(--red);color:var(--red);}

  .ttime{
    display:inline-block;margin-left:7px;font-style:normal;
    font-size:11.5px;color:var(--red);font-weight:600;vertical-align:middle;
  }
  .taskcal{
    background:none;border:none;color:#55555e;cursor:pointer;
    padding:3px 2px;flex:0 0 auto;display:grid;place-items:center;
  }
  .taskcal:active{color:var(--red);}
  .addtime{display:flex;align-items:center;gap:10px;margin-top:8px;}
  .addtime input{
    background:var(--panel);border:1px solid var(--line);
    border-radius:9px;color:var(--ink);font-size:14px;
    padding:9px 11px;font-family:inherit;
  }
  .addtime input:focus{outline:none;border-color:var(--red);}
  .addtime span{color:#6a6a72;font-size:11.5px;line-height:1.4;}
  .rtime{
    background:#1f1f25;border:1px solid var(--line);
    border-radius:8px;color:var(--ink);font-size:13px;
    padding:6px 9px;font-family:inherit;flex:0 0 auto;
  }
  .rtime:focus{outline:none;border-color:var(--red);}

  /* ===== Calendar ===== */
  .calwrap{margin-bottom:16px;}
  .calhead{display:flex;align-items:center;gap:4px;margin-bottom:9px;}
  .calmonth{
    flex:1;text-align:center;
    font-family:var(--display);font-weight:600;
    font-size:15px;letter-spacing:.04em;color:var(--ink);
  }
  .weeknav{
    flex:0 0 auto;width:32px;height:32px;background:none;border:none;
    color:#6a6a72;font-size:20px;cursor:pointer;padding:0;line-height:1;
    border-radius:8px;
  }
  .weeknav:active{color:var(--red);background:#1f1f25;}
  .weekstrip{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;}
  .monthwrap{display:block;}
  .monthhead{
    display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:5px;
  }
  .monthhead span{
    text-align:center;font-size:10px;color:#5a5a62;
    font-family:var(--display);font-weight:600;letter-spacing:.06em;
  }
  .monthgrid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;}
  .wday{
    display:flex;flex-direction:column;align-items:center;gap:1px;
    background:#17171b;border:1px solid transparent;border-radius:10px;
    padding:7px 2px 6px;cursor:pointer;
    -webkit-tap-highlight-color:transparent;
    transition:background .16s ease, border-color .16s ease, transform .1s ease;
  }
  .wday:active{transform:scale(.94);}
  .wday.dim{opacity:.32;}
  .wl{font-size:10px;color:#6a6a72;font-family:var(--display);font-weight:600;}
  .wn{font-family:var(--display);font-weight:700;font-size:16px;line-height:1.1;color:var(--ink);}
  .wdot{font-size:8px;color:#4a4a54;line-height:1;height:8px;letter-spacing:.5px;}
  .wday.today .wn{color:var(--red);}
  .wday.on{background:var(--panel2);border-color:#3c3c46;}
  .wday.on .wdot{color:var(--red);}
  .calexpand{
    width:100%;margin-top:9px;background:none;border:none;
    color:#6a6a72;font-family:inherit;font-size:12px;cursor:pointer;
    display:flex;align-items:center;justify-content:center;gap:6px;padding:7px;
  }
  .calexpand svg{width:14px;height:14px;transition:transform .2s ease;}
  .calexpand.open svg{transform:rotate(180deg);}
  .calexpand:active{color:var(--red);}

  .exportbtn{
    width:100%;margin-top:16px;display:flex;align-items:center;
    justify-content:center;gap:9px;
    background:var(--panel2);border:1px solid #3a3a44;color:var(--ink);
    border-radius:10px;padding:13px;
    font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;
  }
  .exportbtn svg{width:17px;height:17px;flex:0 0 auto;}
  .exportbtn:active{border-color:var(--red);color:var(--red);}
  .exportnote{color:#6a6a72;font-size:11.5px;line-height:1.55;margin-top:9px;}

  /* ===== Progress ===== */
  .prog{padding:0 20px;}
  .progempty{color:var(--dim);font-size:13px;line-height:1.65;}
  .hero{display:flex;align-items:baseline;gap:7px;}
  .hero b{font-family:var(--display);font-weight:700;font-size:52px;line-height:1;}
  .hero span{color:var(--dim);font-size:15px;}
  .herosub{color:var(--dim);font-size:13px;margin-top:5px;line-height:1.5;}
  .spark{width:100%;height:auto;margin-top:14px;display:block;overflow:visible;}
  .sparklab{fill:#6a6a72;font-family:'Inter',sans-serif;font-size:11px;}

  .strip{
    display:grid;grid-template-columns:repeat(14,1fr);
    gap:5px;margin-bottom:12px;
  }
  .cell{
    aspect-ratio:1;border:none;border-radius:4px;padding:0;
    cursor:pointer;background:#1f1f25;
    -webkit-tap-highlight-color:transparent;
  }
  .cell.hit{background:#4ea35a;}
  .cell.miss{background:#55555e;}
  .cell.none{background:#1f1f25;}
  .cell.logged{background:#55555e;}
  .cell:focus-visible{outline:2px solid #fff;outline-offset:2px;}
  .striplegend{
    display:flex;flex-wrap:wrap;gap:12px;
    color:var(--dim);font-size:11.5px;margin-bottom:10px;
  }
  .striplegend span{display:flex;align-items:center;gap:5px;}
  .sw{width:10px;height:10px;border-radius:3px;display:inline-block;}
  .sw.hit{background:#4ea35a;}
  .sw.miss{background:#55555e;}
  .sw.none{background:#1f1f25;}
  .sw.logged{background:#55555e;}
  .legnote{color:#6a6a72;flex-basis:100%;line-height:1.5;}
  .daydetail{
    color:var(--ink);font-size:13px;line-height:1.5;
    padding:10px 0 2px;border-top:1px solid var(--line);min-height:20px;
  }
  .statrow{display:flex;gap:9px;margin-top:12px;}
  .stat{
    flex:1;background:var(--panel);border:1px solid var(--line);
    border-radius:11px;padding:13px;
  }
  .stat b{
    display:block;font-family:var(--display);font-weight:700;
    font-size:28px;line-height:1;margin-bottom:3px;
  }
  .stat span{color:var(--dim);font-size:11.5px;line-height:1.35;display:block;}

  /* ===== Intake tracker ===== */
  .intake{padding:0 20px;}
  .ilist{margin-bottom:4px;}
  .ientry{
    display:flex;align-items:center;gap:10px;
    background:var(--panel);border:1px solid var(--line);
    border-radius:10px;padding:11px 13px;margin-bottom:7px;
  }
  .iname{flex:1;font-size:14px;}
  .iname small{display:block;color:var(--dim);font-size:11px;margin-top:2px;}
  .ical{color:var(--red);font-weight:600;font-size:14px;white-space:nowrap;}
  .idel{background:none;border:none;color:#5a5a62;font-size:15px;cursor:pointer;padding:2px 2px 2px 6px;}
  .iempty{color:var(--dim);font-size:13px;line-height:1.6;padding:4px 0 10px;}

  .itotals{margin:12px 0 4px;}
  /* Calories from runs (run.js). Information only, so quieter than the bars. */
  .iburn{color:var(--dim);font-size:12.5px;margin-top:10px;}
  .iburn b{color:var(--ink);font-weight:600;}
  .trk{margin-bottom:12px;}
  /* the gap keeps a long right-hand line ("1,100mg of 2,300mg · …")
     from running into the label on a narrow phone */
  .trkhead{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:13px;margin-bottom:5px;}
  .trkhead b{font-family:var(--display);font-weight:600;letter-spacing:.03em;font-size:14px;}
  .trkhead span{color:var(--dim);font-size:12px;}
  .trkhead span.over{color:var(--red);}
  .bar{height:6px;background:var(--panel2);border-radius:99px;overflow:hidden;}
  .bar i{display:block;height:100%;background:var(--red);border-radius:99px;transition:width .25s;}
  .bar i.good{background:var(--done);}
  .bar i.over{background:#b8862a;}

  .addfood{
    display:block;width:100%;margin-top:6px;
    background:transparent;border:1px dashed var(--line);
    color:var(--dim);border-radius:10px;padding:13px;
    font-family:inherit;font-size:14px;cursor:pointer;
  }
  .addfood:active{border-color:var(--red);color:var(--red);}
  .foodform{
    margin-top:12px;background:var(--panel);
    border:1px solid var(--line);border-radius:12px;padding:16px;
  }
  .foodform label{display:block;color:var(--dim);font-size:12px;margin:10px 0 5px;}
  .foodform label:first-child{margin-top:0;}
  .foodform input{
    width:100%;background:var(--panel2);border:1px solid var(--line);
    border-radius:10px;color:var(--ink);font-size:16px;
    padding:12px;font-family:inherit;
  }
  .foodform input:focus{outline:none;border-color:var(--red);}
  .morefields{
    width:100%;margin-top:12px;background:none;border:none;
    color:var(--dim);font-family:inherit;font-size:12px;
    cursor:pointer;padding:8px;text-align:left;
  }
  .formrow{display:flex;gap:8px;margin-top:14px;}
  .formrow button{
    flex:1;padding:13px;border-radius:10px;font-family:inherit;
    font-size:14px;font-weight:600;cursor:pointer;
  }
  .savefood{background:var(--red);border:1px solid var(--red);color:#fff;}
  .cancelfood{background:var(--panel2);border:1px solid var(--line);color:var(--ink);}

  /* ===== Plan generator ===== */
  .gen{padding:20px;border-bottom:1px solid var(--line);}
  .genhead{
    font-family:var(--display);font-weight:600;
    letter-spacing:.14em;color:var(--red);font-size:12px;margin-bottom:4px;
  }
  .gentitle{font-family:var(--display);font-weight:700;font-size:26px;line-height:1.1;margin-bottom:4px;}
  .gensub{color:var(--dim);font-size:13px;margin-bottom:16px;line-height:1.5;}
  .genform label{display:block;color:var(--dim);font-size:12px;margin:12px 0 5px;}
  .genform label .opt{color:#5e5e66;}

  /* ---- Greeting ---- */
  .greet{padding:22px 20px 0;}
  .greetline{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;}
  .greetline .hi{font-family:var(--display);font-weight:700;font-size:22px;line-height:1.15;color:var(--dim);}
  .greetline .hi b{color:var(--ink);font-weight:700;}
  .greetedit{background:none;border:none;color:#5e5e66;font-family:inherit;font-size:12px;
    padding:4px 2px;cursor:pointer;text-decoration:underline;text-underline-offset:3px;}
  .namecard{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px;}
  .namecard .nq{font-family:var(--display);font-weight:700;font-size:20px;line-height:1.15;}
  .namecard p{color:var(--dim);font-size:13px;margin:4px 0 12px;line-height:1.5;}
  .namerow{display:flex;gap:8px;}
  .namerow input{flex:1;min-width:0;height:44px;box-sizing:border-box;background:#121212;border:1px solid #2a2a2a;
    color:#fff;border-radius:9px;padding:0 12px;font-family:inherit;font-size:16px;}
  .namerow input:focus{outline:none;border-color:var(--red);}
  .namerow button{height:44px;box-sizing:border-box;background:var(--red);border:1px solid var(--red);color:#fff;
    border-radius:9px;padding:0 18px;font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;}
  .nameskip{background:none;border:none;color:var(--dim);font-family:inherit;font-size:13px;
    margin-top:10px;padding:4px 0;cursor:pointer;}
  .genform input,.genform select{
    width:100%;background:var(--panel);border:1px solid var(--line);
    border-radius:10px;color:var(--ink);font-size:16px;
    padding:13px;font-family:inherit;
  }
  .genform input:focus,.genform select:focus{outline:none;border-color:var(--red);}
  .genrow{display:flex;gap:8px;}
  .genrow>div{flex:1;}
  .genbtn{
    width:100%;padding:15px;border-radius:10px;font-family:inherit;
    font-size:15px;font-weight:600;cursor:pointer;margin-top:18px;
    background:var(--red);border:1px solid var(--red);color:#fff;
  }
  .genbtn:active{opacity:.85;}
  .genbtn:disabled{opacity:.5;}
  .genmsg{margin-top:12px;font-size:13px;color:var(--dim);line-height:1.5;min-height:18px;}
  .genmsg.err{color:var(--red);}
  .gendisc{color:#6a6a72;font-size:11px;line-height:1.5;margin-top:14px;}
  .result{
    margin-top:18px;background:var(--panel);border:1px solid var(--line);
    border-radius:12px;padding:16px;
  }
  .result h4{
    font-family:var(--display);font-weight:600;font-size:13px;
    letter-spacing:.1em;color:var(--red);margin-bottom:8px;
  }
  .result p{font-size:14px;line-height:1.6;margin-bottom:12px;}
  .result .prev{color:var(--dim);font-size:13px;line-height:1.7;margin-bottom:14px;}
  .result .prev b{color:var(--ink);font-weight:600;}
  .pday{border:1px solid var(--line);border-radius:10px;margin-bottom:8px;overflow:hidden;}
  .pday.rest{opacity:.6;}
  .phead{display:flex;align-items:center;gap:8px;padding:12px 14px;cursor:pointer;}
  .phead b{font-family:var(--display);font-weight:600;min-width:38px;}
  .phead span{color:var(--dim);font-size:13px;flex:1;}
  .phead i{color:var(--dim);font-style:normal;font-size:12px;}
  .pday.rest .phead{cursor:default;}
  .pbody{padding:0 14px 12px;}
  .prow{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-top:1px solid var(--line);font-size:14px;}
  .prow span{color:var(--ink);}
  .prow em{color:var(--red);font-style:normal;font-weight:600;white-space:nowrap;}
  .genactions{display:flex;gap:8px;}
  .genactions button{
    flex:1;padding:13px;border-radius:10px;font-family:inherit;
    font-size:14px;font-weight:600;cursor:pointer;
    background:var(--panel2);border:1px solid var(--line);color:var(--ink);
  }
  .genactions button.use{background:var(--red);border-color:var(--red);color:#fff;}
  .gentoggle{
    display:block;width:calc(100% - 40px);margin:16px 20px 0;
    background:transparent;border:1px dashed var(--line);
    color:var(--dim);border-radius:10px;padding:13px;
    font-family:inherit;font-size:14px;cursor:pointer;
  }
  .gentoggle:active{border-color:var(--red);color:var(--red);}

  /* ===== Auth screen ===== */
  .authgate{
    position:fixed;inset:0;background:var(--bg);z-index:100;
    display:grid;place-items:center;padding:24px;
    padding-top:calc(24px + env(safe-area-inset-top));
  }
  .authcard{width:100%;max-width:360px;}
  /* Until the session check answers, show neither the form nor the
     app — just the name, breathing slowly so it reads as "working". */
  .authwait{display:none;text-align:center;}
  .authgate.checking .authwait{display:block;}
  .authgate.checking .authcard{display:none;}
  /* Arriving from a reset link swaps the login form for the
     new-password form. */
  .authreset{display:none;width:100%;max-width:360px;}
  .authgate.recovering .authcard{display:none;}
  .authgate.recovering .authreset{display:block;}
  .authwait .authtitle{animation:authpulse 1.6s ease-in-out infinite;}
  .authwait .authsub{margin-bottom:0;}
  @keyframes authpulse{0%,100%{opacity:.55;}50%{opacity:1;}}
  @media (prefers-reduced-motion: reduce){ .authwait .authtitle{animation:none;} }
  .authkicker{
    font-family:var(--display);font-weight:600;
    letter-spacing:.18em;color:var(--red);font-size:11px;margin-bottom:8px;
  }
  .authtitle{
    font-family:var(--display);font-weight:700;
    font-size:44px;line-height:1;margin-bottom:6px;
  }
  .authsub{color:var(--dim);font-size:14px;margin-bottom:28px;}
  .authgate input{
    width:100%;background:var(--panel);border:1px solid var(--line);
    border-radius:10px;color:var(--ink);font-size:16px;
    padding:14px;font-family:inherit;margin-bottom:10px;
  }
  .authgate input:focus{outline:none;border-color:var(--red);}
  /* The eye sits inside the password box, on the right. The box gets
     extra right padding so a long password never runs under it. */
  .pwwrap{position:relative;margin-bottom:10px;}
  .pwwrap input{margin-bottom:0;padding-right:52px;}
  .pwtoggle{
    position:absolute;top:0;right:0;bottom:0;width:48px;
    display:grid;place-items:center;background:none;border:none;
    color:var(--dim);cursor:pointer;border-radius:0 10px 10px 0;
  }
  .pwtoggle:focus-visible{outline:2px solid var(--red);outline-offset:-2px;}
  .pwtoggle[aria-pressed="true"]{color:var(--ink);}
  .authbtn{
    width:100%;padding:14px;border-radius:10px;font-family:inherit;
    font-size:15px;font-weight:600;cursor:pointer;margin-top:6px;
    background:var(--panel);border:1px solid var(--line);color:var(--ink);
  }
  .authbtn.primary{background:var(--red);border-color:var(--red);color:#fff;}
  .authbtn:active{opacity:.85;}
  .authlink{
    width:100%;background:none;border:none;color:var(--dim);
    font-family:inherit;font-size:13px;padding:14px 0 0;cursor:pointer;
  }
  .authmsg{
    margin-top:16px;font-size:13px;line-height:1.5;color:var(--dim);
    min-height:20px;text-align:center;
  }
  .authmsg.err{color:var(--red);}
  .authmsg.ok{color:#5a9a5a;}
  .syncnote{
    display:none;margin:12px 20px 0;padding:11px 13px;
    border:1px solid var(--red);border-radius:10px;
    background:var(--redglow);color:var(--ink);font-size:13px;
  }
  .signout{
    display:block;width:calc(100% - 40px);margin:12px 20px 0;
    background:transparent;border:1px solid var(--line);
    color:var(--dim);border-radius:10px;padding:13px;
    font-family:inherit;font-size:14px;cursor:pointer;
  }

  /* ===== Life =====
     Texture and motion, not ornament. A faint grain so the black isn't
     a flat void, and things that move when they change so the app feels
     like it noticed. Generated in the page, so it costs a few hundred
     bytes rather than an image download. */
  body::after{
    content:"";position:fixed;inset:0;z-index:1;
    pointer-events:none;opacity:.04;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  #appRoot,#authGate{position:relative;z-index:2;}

  /* bars fill rather than appear */
  .bar i{transition:width .5s cubic-bezier(.22,.8,.3,1);}

  /* the tick lands with a little weight behind it */
  .box svg,.taskbox svg{transition:opacity .14s ease, transform .18s cubic-bezier(.3,1.5,.5,1);}
  .box svg,.taskbox svg{transform:scale(.4);}
  .ex.done .box svg,.taskrow.done .taskbox svg{transform:scale(1);}
  .ex,.taskrow{transition:opacity .2s ease, border-color .2s ease;}
  .ex:active,.taskrow:active{border-color:#3c3c46;}

  /* switching tabs shows something arriving, not a hard cut.
     "backwards" so the animation lets go of the pane once it lands;
     holding it would stop a swipe from moving the pane under your
     finger. */
  .pane{animation:panein .22s ease backwards;}
  @keyframes panein{from{opacity:0;transform:translateY(5px);}to{opacity:1;transform:none;}}

  /* Sections sit side by side in the bottom bar's order. While you
     swipe (or after a tap), the section you're heading to rides in
     beside the one you're leaving, both moving together, the way
     Instagram slides between screens. */
  #appRoot{overflow-x:clip;}            /* nothing poking out sideways */
  .pane.sliding{will-change:transform;animation:none;}
  /* The one coming in is pinned to the top of the screen, so you see
     it exactly as it will look once it lands (the page scrolls to the
     top on arrival). */
  .pane.incoming{position:fixed;z-index:3;}
  /* The bar's blur has to be redrawn every frame anything moves
     behind it, which is what made swiping stutter on a phone. Its
     background is almost solid anyway, so it goes solid mid-swipe and
     nobody can tell. */
  body.swiping .bottomnav{backdrop-filter:none;-webkit-backdrop-filter:none;background:#16161a;}

  /* (The active tab used to "breathe" with a pulsing glow. It ran
     forever, so the phone redrew the blurred bar nonstop, and the
     whole app paid for it in stutter. Gone; the pill below glows
     without moving.) */

  /* a logged meal slides in instead of blinking into place */
  .ientry,.meal{animation:rowin .2s ease both;}
  @keyframes rowin{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:none;}}

  /* Every button gives under your thumb and springs back when you let
     go, so a tap feels received before anything else happens.
     `.pressed` is added by the code the instant a finger lands:
     iPhones hold back :active until they're sure you aren't
     scrolling, which is the delay you could feel. :active stays for
     mouse and keyboard. The drag grip is left out: shrinking it
     mid-drag would look like a glitch. */
  button{transition:transform .14s cubic-bezier(.3,1.6,.5,1);}
  .navbtn{transition:color .18s ease, transform .14s cubic-bezier(.3,1.6,.5,1);}
  button:not(:disabled):not(.egrip):active,
  button.pressed:not(:disabled):not(.egrip){transform:scale(.95);transition-duration:.05s;}
  .ex.pressed,.taskrow.pressed{transform:scale(.985);border-color:#3c3c46;transition-duration:.05s;}

  /* Changing day: the cards arrive one after another from the side
     you moved towards, instead of the whole list swapping at once.
     --dx is set by the code to +1 (later day) or -1 (earlier). */
  .dayin .ex,.dayin .daytitle,.dayin .dayfocus{
    /* "backwards", not "both": once it lands the animation lets go,
       or it would hold the card still and swallow the press effect */
    animation:cardin .24s cubic-bezier(.22,.8,.3,1) backwards;
  }
  @keyframes cardin{
    from{opacity:0;transform:translateX(calc(var(--dx,0) * 14px)) translateY(6px);}
    to{opacity:1;transform:none;}
  }
  /* the day you picked pops into the red */
  .tab.pop{animation:tabpop .22s cubic-bezier(.3,1.6,.5,1);}
  @keyframes tabpop{from{transform:scale(.9);}to{transform:none;}}

  /* the icon of the tab you just opened gives a small hop */
  .navbtn.on svg{animation:iconhop .3s cubic-bezier(.3,1.6,.5,1);}
  @keyframes iconhop{0%{transform:translateY(0) scale(1);}40%{transform:translateY(-3px) scale(1.1);}100%{transform:none;}}

  /* ===== The bottom bar's red pill =====
     One red block that slides between the buttons instead of each
     button turning red on its own. It follows your finger when you
     swipe between sections, and when you drag along the bar. The
     code sets its position and width; it only ever moves with
     transform, which phones can do without redrawing anything. */
  .bottomnav{touch-action:none;}       /* sideways drags on the bar are ours, not a scroll */
  .navpill{
    position:absolute;top:5px;bottom:5px;left:0;width:0;
    background:var(--red);border-radius:12px;
    box-shadow:0 2px 12px rgba(208,42,42,.42);
    pointer-events:none;will-change:transform;
    transition:transform .32s cubic-bezier(.3,1.25,.5,1), width .32s cubic-bezier(.3,1.25,.5,1);
  }
  .navpill.follow{transition:none;}    /* glued to the finger, no lag behind it */
  .navbtn{position:relative;z-index:1;}
  .navbtn.on{background:transparent;box-shadow:none;}
  /* while dragging along the bar, the white label follows your thumb */
  .bottomnav.dragging .navbtn.on{color:#9a9aa4;}
  .bottomnav.dragging .navbtn.hot{color:#fff;}

  /* stats and totals land as cards, then their numbers count */
  .stat{animation:rowin .24s ease both;}
  .stat:nth-child(2){animation-delay:.04s;}
  /* Counting numbers keep every digit the same width, so the line
     doesn't jiggle while they run. */
  .num{font-variant-numeric:tabular-nums;}

  /* ===== Wins =====
     Finishing a workout, a new best on a lift, a weigh-in that moved
     toward your goal. Embers instead of confetti: sparks off a fire
     suit the black and red, and rainbow paper would not. Nothing here
     can be tapped or needs closing; it plays over the app for a second
     or two and is gone. */
  .embers{position:fixed;inset:0;z-index:60;pointer-events:none;overflow:hidden;}
  /* A soft glowing dot painted as a gradient: a real glow (box-shadow)
     on thirty moving sparks is slow on a phone. */
  .ember{
    position:absolute;border-radius:50%;will-change:transform,opacity;
    background:radial-gradient(circle,#ffe0b8 0,#ff8a44 30%,rgba(224,52,42,.7) 52%,rgba(208,42,42,0) 72%);
  }
  .cheer{
    position:fixed;left:16px;right:16px;top:36%;z-index:61;pointer-events:none;
    transform:translateY(-50%);text-align:center;
  }
  /* a soft pool of shadow behind the words, so they read cleanly over
     whatever part of the app happens to be underneath */
  .cheer::before{
    content:"";position:absolute;z-index:-1;inset:-70px -16px;
    background:radial-gradient(ellipse at center,rgba(8,8,10,.92) 0,rgba(8,8,10,.7) 40%,rgba(8,8,10,0) 72%);
  }
  .cheer b{
    display:block;font-family:var(--display);font-weight:700;
    font-size:38px;line-height:1.05;letter-spacing:.02em;color:#fff;
    text-shadow:0 0 28px rgba(208,42,42,.85), 0 2px 10px rgba(0,0,0,.9);
  }
  .cheer small{
    display:block;margin-top:8px;font-family:var(--display);font-weight:600;
    font-size:13px;letter-spacing:.16em;text-transform:uppercase;color:#ff8a70;
    text-shadow:0 1px 8px rgba(0,0,0,.9);
  }

  /* a finished day keeps a small check on its button */
  .tab.complete::after{content:"✓";margin-left:5px;font-size:11px;color:var(--red);}
  .tab.active.complete::after{color:#fff;}

  /* the latest log on a lift is its best ever */
  .bestbadge{
    display:inline-block;margin-left:7px;padding:1px 6px;border-radius:5px;
    border:1px solid var(--red);color:var(--red);vertical-align:1px;
    font-family:var(--display);font-style:normal;font-weight:600;
    font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;
  }

  /* A chart draws its line from left to right when it appears, then
     the fill fades in under it and the last point lands. */
  .spark .sline{stroke-dasharray:1;animation:drawline .7s cubic-bezier(.3,.7,.3,1) backwards;}
  .spark .sarea{animation:fadeup .5s ease .25s backwards;}
  .spark .sdot{transform-box:fill-box;transform-origin:center;animation:dotpop .3s cubic-bezier(.3,1.6,.5,1) .55s backwards;}
  @keyframes drawline{from{stroke-dashoffset:1;}to{stroke-dashoffset:0;}}
  @keyframes fadeup{from{opacity:0;}to{opacity:1;}}
  @keyframes dotpop{from{transform:scale(0);}to{transform:none;}}

  /* ===== Weigh-in on the Progress tab ===== */
  .weighrow{display:flex;align-items:center;gap:8px;margin-top:14px;}
  /* 16px text stops iPhones zooming in on tap, same as the lift box */
  .weighrow input{flex:1;min-width:0;height:42px;background:#121212;border:1px solid #2a2a2a;color:#fff;
    border-radius:9px;padding:0 12px;font-family:inherit;font-size:16px;}
  .weighrow input:focus{outline:none;border-color:var(--red);}
  .weighrow .u{color:var(--dim);font-size:13px;}
  .weighrow button{height:42px;background:var(--red);border:1px solid var(--red);color:#fff;border-radius:9px;
    padding:0 18px;font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;}
  /* The goal row is the same shape as the weigh-in row, with a quieter
     button: logging a weight is the everyday action, changing the goal
     is rare. */
  .weighrow.goalrow{margin-top:8px;}
  .weighrow button.ghost{background:none;border-color:var(--line);color:var(--ink);font-weight:500;
    padding:0 12px;white-space:nowrap;}
  .weighnote{color:var(--dim);font-size:12px;line-height:1.55;margin-top:9px;}
  /* "Goal 165 lb ............ 14.8 lb to lose", and a bar from where
     they started to the goal */
  .goalstat{display:flex;justify-content:space-between;align-items:baseline;gap:10px;
    margin-top:12px;color:var(--dim);font-size:13px;}
  .goalstat b{font-family:var(--display);font-weight:700;font-size:18px;color:var(--ink);}
  .goalbar{margin-top:6px;}
  /* the goal weight on the chart: a quiet dashed line, so the red line
     heading toward it is what stands out */
  .spark .sgoal{stroke:#8a8a92;stroke-width:1;stroke-dasharray:4 4;}
  .spark .sgoallab{fill:#a4a4ac;}

  /* ===== Recipes and more meals ===== */
  .mealbtns{display:flex;gap:8px;}
  .mealbtns .logmeal{flex:1;width:auto;}
  .howmake{
    flex:1;background:none;border:1px solid var(--line);color:var(--ink);
    border-radius:9px;padding:10px;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;
  }
  .howmake[aria-expanded="true"]{border-color:var(--red);color:#fff;}
  .howmake:disabled{opacity:.55;cursor:default;}
  /* a quiet link-style button under a recipe: it's the exception, not
     something to tap every time */
  .rewrite{
    display:block;width:100%;margin-top:12px;background:none;border:none;
    color:var(--dim);font-family:inherit;font-size:12.5px;text-decoration:underline;
    text-underline-offset:3px;cursor:pointer;padding:6px;
  }
  .rewrite:disabled{opacity:.5;cursor:default;}
  .mealdel{
    background:none;border:none;color:#6a6a72;font-size:14px;line-height:1;
    padding:4px 2px 4px 8px;cursor:pointer;align-self:flex-start;
  }
  .recipe{margin-top:12px;padding-top:12px;border-top:1px solid var(--line);animation:rowin .22s ease both;}
  .recipe .rmeta{color:var(--dim);font-size:12px;margin-bottom:10px;}
  .recipe h5{
    font-family:var(--display);font-weight:600;font-size:11.5px;letter-spacing:.14em;
    text-transform:uppercase;color:var(--red);margin:12px 0 6px;
  }
  .recipe ul,.recipe ol{margin:0;padding-left:20px;color:var(--ink);font-size:13.5px;line-height:1.6;}
  .recipe ol li{margin-bottom:7px;padding-left:2px;}
  .recipe ol li::marker{color:var(--red);font-family:var(--display);font-weight:700;}
  .recipe ul li::marker{color:#55555e;}
  .recipe .rtip{
    margin-top:12px;padding:10px 12px;border-radius:9px;background:var(--panel2);
    border-left:2px solid var(--red);color:var(--ink);font-size:13px;line-height:1.55;
  }
  .recipe .rtip b{font-family:var(--display);letter-spacing:.06em;color:var(--red);margin-right:6px;}
  .recipewait{margin-top:10px;color:var(--dim);font-size:13px;animation:authpulse 1.6s ease-in-out infinite;}
  .recipeerr{margin-top:10px;color:#e0a13a;font-size:13px;line-height:1.5;}
  .moremeals{margin-top:6px;}
  .moremeals input{
    width:100%;height:42px;background:#121212;border:1px solid #2a2a2a;color:#fff;
    border-radius:9px;padding:0 12px;font-family:inherit;font-size:16px;margin-bottom:8px;
  }
  .moremeals input:focus{outline:none;border-color:var(--red);}
  .moremeals button{
    width:100%;background:none;border:1px dashed #3a3a42;color:var(--ink);
    border-radius:9px;padding:12px;font-family:inherit;font-size:13.5px;font-weight:600;cursor:pointer;
  }
  .moremeals button:disabled{opacity:.6;cursor:default;}
  /* ===== Physique check-in ===== */
  .cilead{color:var(--dim);font-size:13px;line-height:1.6;}
  /* The privacy promise gets its own quiet box so it's read, not
     skimmed past: it's the reason someone can trust this with a photo. */
  .ciprivacy{
    margin-top:10px;padding:10px 12px;border-radius:9px;background:var(--panel2);
    border-left:2px solid var(--done);color:var(--ink);font-size:12.5px;line-height:1.55;
  }
  .cibtn{
    width:100%;margin-top:12px;height:46px;background:var(--red);border:1px solid var(--red);color:#fff;
    border-radius:10px;font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;
  }
  .cibtn:disabled{opacity:.7;cursor:default;animation:authpulse 1.6s ease-in-out infinite;}
  .cifine{color:#6a6a72;font-size:11.5px;line-height:1.5;margin-top:8px;}
  .ciwear{margin-top:12px;color:var(--ink);font-size:13px;line-height:1.55;}
  .ciwear b{
    display:block;font-family:var(--display);font-weight:600;font-size:11.5px;
    letter-spacing:.14em;text-transform:uppercase;color:var(--red);margin-bottom:5px;
  }
  .ciwear ul{margin:0;padding-left:19px;color:var(--dim);}
  .ciwear li{margin-bottom:3px;}
  .ciwear li::marker{color:#55555e;}
  /* a big tap target: the whole line ticks the box, not just the square */
  .ciconfirm{
    display:flex;align-items:flex-start;gap:10px;margin-top:14px;padding:11px 12px;
    border:1px solid var(--line);border-radius:10px;cursor:pointer;
    color:var(--ink);font-size:13.5px;line-height:1.45;
  }
  .ciconfirm input{flex:0 0 auto;width:20px;height:20px;margin:0;accent-color:var(--red);}
  .cimsg{color:#e0a13a;font-size:13px;line-height:1.55;margin-top:10px;}
  .cimsg:empty{display:none;}
  .cicard{
    margin-top:14px;background:var(--panel);border:1px solid var(--line);
    border-radius:12px;padding:14px;animation:rowin .24s ease both;
  }
  .cihead{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:8px;}
  .cihead b{font-family:var(--display);font-weight:700;font-size:17px;letter-spacing:.01em;}
  .cihead span{color:var(--dim);font-size:12px;}
  .cisum{color:var(--ink);font-size:14px;line-height:1.6;}
  /* the lists and headings borrow the recipe look; this just removes
     the divider a recipe has above it */
  .cicard .recipe{margin-top:0;padding-top:0;border-top:none;animation:none;}
  .cinote{color:var(--dim);font-size:12px;line-height:1.5;margin-top:12px;}
  .cidel{
    background:none;border:none;color:#6a6a72;font-family:inherit;font-size:12px;
    text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:6px 0 0;margin-top:8px;
  }
  .ciold{
    display:block;width:100%;text-align:left;margin-top:9px;background:none;
    border:1px solid var(--line);border-radius:10px;padding:11px 13px;
    color:var(--ink);font-family:inherit;font-size:13px;cursor:pointer;
  }
  .ciold span{display:block;color:var(--dim);font-size:12px;margin-top:3px;line-height:1.45;}

  /* The meal library: a menu that opens under the meals */
  #libToggle[aria-expanded="true"]{border-style:solid;border-color:var(--red);}
  #libPanel{margin-top:12px;animation:rowin .22s ease both;}
  .libask{
    font-family:var(--display);font-weight:600;font-size:12px;letter-spacing:.14em;
    text-transform:uppercase;color:var(--red);margin:4px 0 9px;
  }
  .libchips{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:12px;}
  /* width:auto and the rest undo the full-width dashed look every
     other button in this block gets */
  .moremeals .libchip{
    width:auto;background:var(--panel);border:1px solid var(--line);color:var(--ink);
    border-radius:99px;padding:8px 13px;font-size:13px;font-weight:500;
  }
  .moremeals .libchip.on{background:var(--red);border-color:var(--red);color:#fff;}
  .libhint{color:var(--dim);font-size:13px;line-height:1.55;margin-bottom:12px;}
  .moremeals .libadd{
    background:var(--panel2);border:1px solid var(--line);color:var(--ink);
    border-radius:9px;padding:10px;font-size:13px;
  }
  .moremeals .libadd.have{background:none;color:var(--dim);border-style:dashed;}
  #libAsk{margin-top:16px;padding-top:14px;border-top:1px solid var(--line);}
  .moremsg{color:var(--dim);font-size:12.5px;line-height:1.5;margin-top:8px;min-height:1em;}
  .moremsg.err{color:#e0a13a;}

  @media (prefers-reduced-motion: reduce){
    .spark .sline,.spark .sarea,.spark .sdot,.recipe,.recipewait,#libPanel,.cicard,.cibtn:disabled{animation:none;}
    /* no drawing line, but the chart still fades in as one piece:
       a fade is the kind of change this setting allows */
    .spark{animation:fadeup .6s ease backwards;}
    .bar i,.box svg,.taskbox svg,.ex,.taskrow,.calexpand svg,.wday,button,.navbtn,.navpill{transition:none;}
    .pane,.navbtn.on,.ientry,.meal,.dayin .ex,.dayin .daytitle,.dayin .dayfocus,.tab.pop,.navbtn.on svg,.stat{animation:none;}
    .box svg,.taskbox svg{transform:none;}
    button:active{transform:none;}
  }
