/* ============ Daveedus - themes ============ */
/* Archivo (variable) - display face for the wordmark and big numbers; self-hosted for offline */
@font-face{
  font-family:'Archivo'; font-style:normal; font-weight:400 800; font-display:swap;
  src:url('../fonts/archivo-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family:'Archivo'; font-style:normal; font-weight:400 800; font-display:swap;
  src:url('../fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root{
  --display:'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
/* Selectable skins (data-skin on <html>), each with a dark and a light palette
   (data-theme). The bare :root block below is the BASE token layer every skin
   overrides - not a selectable skin itself (the old "Ice Cold" retired 2026-08-13;
   both it and its aero successor retired). Order matters: skin blocks come
   after the base blocks, and each skin's light block carries higher specificity
   than its dark base, so the cascade resolves skin+theme without JS help.
   Shared rules: win/loss green-red never changes meaning; warmup orange and
   deload amber stay warm in every skin; solid-accent surfaces read --on-accent. */

/* ---- base tokens (fallback when no data-skin is stamped yet) ---- */
:root, :root[data-theme="dark"]{
  --bg:#05070c; --card:#0d141f; --input:#16202c; --line:#253349;
  --text:#edf3fa; --dim:#92a5ba; --ghost:#5a6f86;
  --edge:rgba(151,197,255,.09);
  --accent:#38bdf8; --accent-soft:#85d3ff; --on-accent:#071726;
  --accent-bg:rgba(56,189,248,.13);
  --glow:rgba(56,189,248,.15);
  --atmo:linear-gradient(180deg, #0a1220 0%, #05070c 380px);
  --topbar-bg:rgba(8,13,22,.86); --tabbar-bg:rgba(7,11,19,.88);
  --green:#2ecf87; --green-bg:rgba(46,207,135,.13);
  --red:#ff453a; --red-bg:rgba(255,69,58,.13);
  --orange:#ff9f0a; --orange-bg:rgba(255,159,10,.14);
  --shadow:0 10px 34px rgba(1,6,16,.7);
  --card-shadow:none;
}
:root[data-theme="light"]{
  --bg:#eef2f8; --card:#ffffff; --input:#e7edf5; --line:#dde5f0;
  --text:#0b1524; --dim:#6e8098; --ghost:#a7b6c9;
  --edge:#e3eaf4;
  --accent:#0369a1; --accent-soft:#0369a1; --on-accent:#fff;
  --accent-bg:rgba(3,105,161,.09);
  --glow:rgba(3,105,161,.10);
  --atmo:linear-gradient(180deg, #e7edf6 0%, #eef2f8 380px);
  --topbar-bg:rgba(240,244,250,.86); --tabbar-bg:rgba(240,244,250,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.11);
  --red:#ff3b30; --red-bg:rgba(255,59,48,.10);
  --orange:#ff9500; --orange-bg:rgba(255,149,0,.12);
  --shadow:0 10px 34px rgba(15,30,55,.16);
  --card-shadow:0 1px 2px rgba(14,17,22,.05);
}




/* ---- ZAZA ENJOYER: purple haze, kush green, everything soft and unhurried ---- */
:root[data-skin="zaza"]{
  --bg:#0a0712; --card:#151024; --input:#1f1833; --line:#332a4e;
  --text:#f0edf8; --dim:#a79ac2; --ghost:#6c5f8c;
  --edge:rgba(134,239,172,.09);
  --accent:#4ade80; --accent-soft:#86efac; --on-accent:#05200f;
  --accent-bg:rgba(74,222,128,.12);
  --glow:rgba(74,222,128,.16);
  --atmo:linear-gradient(180deg, #150c28 0%, #0a0712 380px);
  --topbar-bg:rgba(17,11,30,.86); --tabbar-bg:rgba(15,10,26,.88);
  --green:#2ecf87; --green-bg:rgba(46,207,135,.13);
  --red:#ff453a; --red-bg:rgba(255,69,58,.13);
  --orange:#ff9f0a; --orange-bg:rgba(255,159,10,.14);
  --shadow:0 10px 34px rgba(8,3,20,.75);
  --card-shadow:none;
}
:root[data-skin="zaza"][data-theme="light"]{
  --bg:#f0f2ec; --card:#ffffff; --input:#e6ebe0; --line:#d9e0d2;
  --text:#131b10; --dim:#6f7f68; --ghost:#a6b39e;
  --edge:#e0e6d9;
  --accent:#15803d; --accent-soft:#166534; --on-accent:#fff;
  --accent-bg:rgba(22,163,74,.10);
  --glow:rgba(22,163,74,.12);
  --atmo:linear-gradient(180deg, #e9ede2 0%, #f0f2ec 380px);
  --topbar-bg:rgba(242,244,238,.86); --tabbar-bg:rgba(242,244,238,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.11);
  --red:#ff3b30; --red-bg:rgba(255,59,48,.10);
  --orange:#ff9500; --orange-bg:rgba(255,149,0,.12);
  --shadow:0 10px 34px rgba(20,35,15,.14);
  --card-shadow:0 1px 2px rgba(15,25,10,.05);
}

/* ---- LOCKED IN: pure monochrome, no sky, no halo - nothing competes ---- */
:root[data-skin="locked"]{
  --bg:#000000; --card:#101010; --input:#1a1a1a; --line:#2a2a2a;
  --text:#f5f5f5; --dim:#9a9a9a; --ghost:#5c5c5c;
  --edge:rgba(255,255,255,.08);
  --accent:#f5f5f5; --accent-soft:#d9d9d9; --on-accent:#000000;
  --accent-bg:rgba(255,255,255,.08);
  --glow:transparent;
  --atmo:none;
  --topbar-bg:rgba(8,8,8,.86); --tabbar-bg:rgba(6,6,6,.88);
  --green:#2ecf87; --green-bg:rgba(46,207,135,.13);
  --red:#ff453a; --red-bg:rgba(255,69,58,.13);
  --orange:#ff9f0a; --orange-bg:rgba(255,159,10,.14);
  --shadow:0 10px 34px rgba(0,0,0,.8);
  --card-shadow:none;
}
:root[data-skin="locked"][data-theme="light"]{
  --bg:#f5f5f5; --card:#ffffff; --input:#ececec; --line:#dedede;
  --text:#111111; --dim:#767676; --ghost:#ababab;
  --edge:#e4e4e4;
  --accent:#111111; --accent-soft:#111111; --on-accent:#ffffff;
  --accent-bg:rgba(0,0,0,.06);
  --glow:transparent;
  --atmo:none;
  --topbar-bg:rgba(247,247,247,.86); --tabbar-bg:rgba(247,247,247,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.11);
  --red:#ff3b30; --red-bg:rgba(255,59,48,.10);
  --orange:#b45309; --orange-bg:rgba(180,83,9,.12);
  --shadow:0 10px 34px rgba(0,0,0,.14);
  --card-shadow:0 1px 2px rgba(0,0,0,.05);
}

/* ---- HELLO KITTY: two colors done properly - warm white and bow red. Dark mode
        is a deep plum night so the pink still reads pink; light mode is the
        classic: white ground, soft pink cards, red bow accent ---- */
:root[data-skin="kitty"]{
  --bg:#1c0f16; --card:#2a1721; --input:#38202c; --line:#4e2f3f;
  --text:#fff1f6; --dim:#d9a9bd; --ghost:#9a6a80;
  --edge:rgba(255,190,214,.14);
  --accent:#ff5c8a; --accent-soft:#ff9dbb; --on-accent:#2a0712;
  --accent-bg:rgba(255,92,138,.14);
  --glow:rgba(255,92,138,.18);
  --atmo:linear-gradient(180deg, #2c1522 0%, #1c0f16 380px);
  --topbar-bg:rgba(30,17,25,.86); --tabbar-bg:rgba(26,15,22,.88);
  --green:#2ecf87; --green-bg:rgba(46,207,135,.14);
  --red:#ff5a50; --red-bg:rgba(255,90,80,.15);
  --orange:#ffab2e; --orange-bg:rgba(255,171,46,.15);
  --shadow:0 10px 34px rgba(20,6,13,.6);
  --card-shadow:none;
}
:root[data-skin="kitty"][data-theme="light"]{
  --bg:#fff7fa; --card:#ffffff; --input:#ffe6ef; --line:#f7cddc;
  --text:#3a1220; --dim:#a8607c; --ghost:#d19bb0;
  --edge:#fbdbe6;
  --accent:#e6194b; --accent-soft:#c2103b; --on-accent:#fff;
  --accent-bg:rgba(230,25,75,.08);
  --glow:rgba(230,25,75,.12);
  --atmo:linear-gradient(180deg, #ffe9f1 0%, #fff7fa 380px);
  --topbar-bg:rgba(255,246,249,.86); --tabbar-bg:rgba(255,246,249,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.11);
  --red:#e0264d; --red-bg:rgba(224,38,77,.10);
  --orange:#f59e0b; --orange-bg:rgba(245,158,11,.12);
  --shadow:0 10px 34px rgba(120,30,60,.13);
  --card-shadow:0 1px 2px rgba(100,20,50,.05);
}

/* ---- WHITE MONSTER: the white can - chalk white ground, black claw-mark
        accent, one cold silver-blue glint. Inverted skin: its DARK mode is
        near-white with black accent (that IS the can), light mode the same
        idea one shade softer ---- */
:root[data-skin="monster"]{
  --bg:#e9eaec; --card:#f7f7f8; --input:#dcdee2; --line:#c9ccd2;
  --text:#0b0c0e; --dim:#5b6068; --ghost:#9aa0a8;
  --edge:rgba(0,0,0,.08);
  --accent:#111214; --accent-soft:#2b2e33; --on-accent:#f7f7f8;
  --accent-bg:rgba(17,18,20,.08);
  --glow:rgba(120,190,230,.35);
  --atmo:radial-gradient(ellipse 70% 40% at 50% -10%, rgba(120,190,230,.28), transparent 60%),
         linear-gradient(180deg, #f2f3f5 0%, #e9eaec 380px);
  --topbar-bg:rgba(240,241,243,.86); --tabbar-bg:rgba(240,241,243,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.12);
  --red:#e5312a; --red-bg:rgba(229,49,42,.10);
  --orange:#d97706; --orange-bg:rgba(217,119,6,.13);
  --shadow:0 10px 34px rgba(0,0,0,.14);
  --card-shadow:0 1px 2px rgba(0,0,0,.06);
}
:root[data-skin="monster"][data-theme="light"]{
  --bg:#f5f5f6; --card:#ffffff; --input:#e8e9ec; --line:#d6d8dd;
  --text:#0b0c0e; --dim:#62676f; --ghost:#a3a8b0;
  --edge:#e2e4e8;
  --accent:#111214; --accent-soft:#2b2e33; --on-accent:#ffffff;
  --accent-bg:rgba(17,18,20,.07);
  --glow:rgba(120,190,230,.3);
  --atmo:radial-gradient(ellipse 70% 40% at 50% -10%, rgba(120,190,230,.22), transparent 60%),
         linear-gradient(180deg, #fafafb 0%, #f5f5f6 380px);
  --topbar-bg:rgba(247,247,248,.86); --tabbar-bg:rgba(247,247,248,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.11);
  --red:#e5312a; --red-bg:rgba(229,49,42,.10);
  --orange:#d97706; --orange-bg:rgba(217,119,6,.13);
  --shadow:0 10px 34px rgba(0,0,0,.12);
  --card-shadow:0 1px 2px rgba(0,0,0,.05);
}

/* ---- GOLDEN ERA: sepia iron, dusty amber light on old plates ---- */
:root[data-skin="golden"]{
  --bg:#120e08; --card:#1e1811; --input:#2a2317; --line:#3e3524;
  --text:#f3e9d6; --dim:#b3a284; --ghost:#7a6c52;
  --edge:rgba(240,192,96,.10);
  --accent:#e0a32e; --accent-soft:#f0c060; --on-accent:#201200;
  --accent-bg:rgba(224,163,46,.12);
  --glow:rgba(224,163,46,.14);
  --atmo:linear-gradient(180deg, #1c1610 0%, #120e08 380px);
  --topbar-bg:rgba(24,19,12,.86); --tabbar-bg:rgba(21,17,11,.88);
  --green:#2ecf87; --green-bg:rgba(46,207,135,.13);
  --red:#ff453a; --red-bg:rgba(255,69,58,.13);
  --orange:#ff9f0a; --orange-bg:rgba(255,159,10,.14);
  --shadow:0 10px 34px rgba(8,6,2,.75);
  --card-shadow:none;
}
:root[data-skin="golden"][data-theme="light"]{
  --bg:#f1e9d8; --card:#faf5e9; --input:#e7dcc4; --line:#d8cbae;
  --text:#241c0e; --dim:#82755b; --ghost:#b3a687;
  --edge:#ddd2b8;
  --accent:#92400e; --accent-soft:#92400e; --on-accent:#fff;
  --accent-bg:rgba(146,64,14,.10);
  --glow:rgba(146,64,14,.12);
  --atmo:linear-gradient(180deg, #e9dfc9 0%, #f1e9d8 380px);
  --topbar-bg:rgba(243,236,222,.86); --tabbar-bg:rgba(243,236,222,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.11);
  --red:#e02d22; --red-bg:rgba(224,45,34,.10);
  --orange:#b45309; --orange-bg:rgba(180,83,9,.12);
  --shadow:0 10px 34px rgba(45,35,15,.14);
  --card-shadow:0 1px 2px rgba(40,30,12,.05);
}

/* ---- SPOODERMAN: web-slinger night blue, spidey-red accent doing the pointing ---- */
:root[data-skin="spooder"]{
  --bg:#070a18; --card:#101527; --input:#181f36; --line:#293356;
  --text:#eef1fb; --dim:#98a3c6; --ghost:#5d688f;
  --edge:rgba(96,140,255,.10);
  --accent:#f43f4b; --accent-soft:#ff7a82; --on-accent:#2a040a;
  --accent-bg:rgba(244,63,75,.13);
  --glow:rgba(244,63,75,.16);
  --atmo:linear-gradient(180deg, #101a3c 0%, #070a18 380px);
  --topbar-bg:rgba(10,15,34,.86); --tabbar-bg:rgba(9,13,29,.88);
  --green:#2ecf87; --green-bg:rgba(46,207,135,.13);
  --red:#ff453a; --red-bg:rgba(255,69,58,.13);
  --orange:#ff9f0a; --orange-bg:rgba(255,159,10,.14);
  --shadow:0 10px 34px rgba(2,5,18,.75);
  --card-shadow:none;
}
:root[data-skin="spooder"][data-theme="light"]{
  --bg:#eef1fa; --card:#ffffff; --input:#e5eaf7; --line:#d8dff0;
  --text:#101832; --dim:#68739b; --ghost:#a2accc;
  --edge:#e0e7f4;
  --accent:#d92637; --accent-soft:#b01c2b; --on-accent:#fff;
  --accent-bg:rgba(217,38,55,.09);
  --glow:rgba(217,38,55,.11);
  --atmo:linear-gradient(180deg, #dde5f8 0%, #eef1fa 380px);
  --topbar-bg:rgba(240,243,251,.86); --tabbar-bg:rgba(240,243,251,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.11);
  --red:#ff3b30; --red-bg:rgba(255,59,48,.10);
  --orange:#ff9500; --orange-bg:rgba(255,149,0,.12);
  --shadow:0 10px 34px rgba(12,25,60,.16);
  --card-shadow:0 1px 2px rgba(10,20,50,.05);
}

/* ---- I'M BATMAN: Gotham night - graphite blue-black, bat-signal yellow,
        a faint signal glow in the sky; light mode is Bruce Wayne's daytime ---- */
:root[data-skin="batman"]{
  --bg:#05060a; --card:#0e1219; --input:#171c26; --line:#28303f;
  --text:#eef1f6; --dim:#96a0b0; --ghost:#5a6373;
  --edge:rgba(255,214,10,.08);
  --accent:#ffd60a; --accent-soft:#ffe25c; --on-accent:#1a1400;
  --accent-bg:rgba(255,214,10,.10);
  --glow:rgba(255,214,10,.12);
  --atmo:radial-gradient(ellipse 62% 42% at 50% -12%, rgba(255,214,10,.10), transparent 62%),
         linear-gradient(180deg, #0c1016 0%, #05060a 380px);
  --topbar-bg:rgba(9,11,16,.86); --tabbar-bg:rgba(8,10,14,.88);
  --green:#2ecf87; --green-bg:rgba(46,207,135,.13);
  --red:#ff453a; --red-bg:rgba(255,69,58,.13);
  --orange:#ff9f0a; --orange-bg:rgba(255,159,10,.14);
  --shadow:0 10px 34px rgba(0,2,6,.8);
  --card-shadow:none;
}
:root[data-skin="batman"][data-theme="light"]{
  --bg:#f0f0f2; --card:#ffffff; --input:#e8e8ec; --line:#dbdce2;
  --text:#14161c; --dim:#71767f; --ghost:#a8adb6;
  --edge:#e2e3e8;
  --accent:#a16207; --accent-soft:#854d0e; --on-accent:#fff;
  --accent-bg:rgba(161,98,7,.10);
  --glow:rgba(161,98,7,.10);
  --atmo:linear-gradient(180deg, #e9eaee 0%, #f0f0f2 380px);
  --topbar-bg:rgba(242,242,245,.86); --tabbar-bg:rgba(242,242,245,.88);
  --green:#0ca678; --green-bg:rgba(12,166,120,.11);
  --red:#ff3b30; --red-bg:rgba(255,59,48,.10);
  --orange:#b45309; --orange-bg:rgba(180,83,9,.12);
  --shadow:0 10px 34px rgba(20,22,28,.14);
  --card-shadow:0 1px 2px rgba(15,17,22,.05);
}

/* ---- per-skin personality (beyond color): shape, type, tempo ---- */
/* I'm Batman: hard edges, heavy caps - the symbol does the talking */
:root[data-skin="batman"] .card, :root[data-skin="batman"] .tplbtn, :root[data-skin="batman"] .stat,
:root[data-skin="batman"] .splitcard, :root[data-skin="batman"] .btn{border-radius:8px;}
:root[data-skin="batman"] .btn.primary{border-radius:8px;}
:root[data-skin="batman"] #topbar h1{text-transform:uppercase; letter-spacing:3px;}

/* Locked In: tighter corners; the pulses stay alive - a still dot read as broken */
:root[data-skin="locked"] .card, :root[data-skin="locked"] .tplbtn, :root[data-skin="locked"] .stat,
:root[data-skin="locked"] .splitcard, :root[data-skin="locked"] .btn{border-radius:10px;}
:root[data-skin="locked"] .btn.primary{border-radius:10px;}
/* Hello Kitty: round everything, soft pink glow under the primary button */
:root[data-skin="kitty"] .card, :root[data-skin="kitty"] .tplbtn, :root[data-skin="kitty"] .stat,
:root[data-skin="kitty"] .splitcard{border-radius:20px;}
:root[data-skin="kitty"] .btn{border-radius:22px;}
:root[data-skin="kitty"] .btn.primary{box-shadow:0 5px 16px var(--glow);}
/* White Monster: sharp can edges, condensed shouting caps, no glow anywhere */
:root[data-skin="monster"] .card, :root[data-skin="monster"] .tplbtn, :root[data-skin="monster"] .stat,
:root[data-skin="monster"] .splitcard, :root[data-skin="monster"] .btn{border-radius:6px;}
:root[data-skin="monster"] .btn.primary{border-radius:6px;}
:root[data-skin="monster"] #topbar h1{text-transform:uppercase; letter-spacing:2.5px; font-weight:900;}
:root[data-skin="monster"] h2.sec{text-transform:uppercase; letter-spacing:1.5px;}
:root[data-skin="monster"] .tbdot, :root[data-skin="monster"] .pulse{animation-duration:.7s;}
/* Golden Era: iron-plate caps, engraved section headers */
:root[data-skin="golden"] #topbar h1{text-transform:uppercase; letter-spacing:1.6px;}
:root[data-skin="golden"] h2.sec{letter-spacing:2px;}
:root[data-skin="golden"] .card, :root[data-skin="golden"] .tplbtn, :root[data-skin="golden"] .stat,
:root[data-skin="golden"] .splitcard{border-radius:10px;}
/* Zaza: everything rounder, pulses at half speed - no rush */
:root[data-skin="zaza"] .card, :root[data-skin="zaza"] .tplbtn, :root[data-skin="zaza"] .stat,
:root[data-skin="zaza"] .splitcard{border-radius:22px;}
:root[data-skin="zaza"] .btn{border-radius:20px;}
:root[data-skin="zaza"] .tbdot, :root[data-skin="zaza"] .pulse{animation-duration:2.6s;}
:root[data-skin="zaza"] #topbar h1{text-transform:lowercase; letter-spacing:-.5px;}
/* ============ base ============ */
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent; touch-action:manipulation;}
html,body{margin:0; padding:0; background:var(--bg); color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:16px; overscroll-behavior-y:none; -webkit-font-smoothing:antialiased;}
/* winter night sky: the page brightens faintly toward the top, like moonlight */
body{background-image:var(--atmo); background-repeat:no-repeat; background-color:var(--bg);}
/* dvh, not vh: on iOS 26 a home-screen app can get a vh taller than the screen */
#app{max-width:560px; margin:0 auto; min-height:100vh; min-height:100dvh;}
button{font-family:inherit; cursor:pointer; user-select:none; -webkit-user-select:none;}
input,select,textarea{font-family:inherit; color:var(--text);}
h2.sec{font-size:11px; text-transform:uppercase; letter-spacing:1.1px; color:var(--dim);
  margin:26px 6px 8px; font-weight:700;}
/* subtle hairline edge gives surfaces definition on the near-black background */
.stat, .splitcard{border:1px solid var(--edge);}

/* ============ top bar ============ */
/* transparent while the page rests at the top (melts into the sky gradient);
   the frosted band appears only once content actually scrolls beneath it */
#topbar{display:flex; align-items:center; gap:10px;
  padding:calc(12px + env(safe-area-inset-top)) 16px 8px;
  position:sticky; top:0; z-index:20;
  background:transparent;
  min-height:calc(54px + env(safe-area-inset-top));
  border-bottom:1px solid transparent; transition:border-color .2s, background .2s;}
/* workout progress: work sets done, a hairline along the bottom edge */
#topbar .toprog{position:absolute; left:0; bottom:-1px; height:2px; background:var(--accent);
  border-radius:0 2px 2px 0; transition:width .4s ease; pointer-events:none;}
#topbar .toprog.full{background:var(--green);}
#topbar.scrolled{border-bottom-color:var(--line);
  background:var(--topbar-bg); -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px);}
#topbar h1{font-family:var(--display); font-size:28px; font-weight:800; letter-spacing:-.4px; margin:0; flex:1;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  /* moonlight-to-ice sheen on the title */
  background:linear-gradient(128deg, var(--text) 45%, var(--accent-soft) 92%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;}
#topbar .elapsed{flex:1; min-width:0; font-family:var(--display); font-size:24px; font-weight:700; font-variant-numeric:tabular-nums;}
#topbar .elapsed small{display:block; font-size:11px; font-weight:600; color:var(--dim);
  letter-spacing:.6px; text-transform:uppercase; margin-bottom:1px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
/* rest count-up in the topbar label line */
#topbar .tbr{color:var(--accent-soft); font-weight:800; font-variant-numeric:tabular-nums;}
#topbar .tbdot{display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--accent);
  margin-right:5px; vertical-align:1px; animation:pulse-dot 1.2s ease-in-out infinite;}
.iconbtn{background:none; border:none; color:var(--accent-soft); flex:none;
  min-width:42px; min-height:42px; font-size:30px; font-weight:400; line-height:1;
  display:flex; align-items:center; justify-content:center; padding:0 4px 4px 0;}
.iconbtn:active{opacity:.5;}
.iconbtn.danger{color:var(--red); padding:0;}
.iconbtn svg{width:20px; height:20px;}
.finishbtn{display:inline-flex; align-items:center; justify-content:center; gap:6px; flex:none;
  background:var(--accent-bg); border:none; color:var(--accent-soft); border-radius:10px;
  min-height:40px; padding:0 18px; font-size:14px; font-weight:800; letter-spacing:.8px;}
.finishbtn svg{width:13px; height:13px;}
.finishbtn:active{opacity:.6;}

/* ============ main ============ */
#screen{padding:0 16px 130px;}
.card{background:var(--card); border:1px solid var(--edge); box-shadow:var(--card-shadow);
  border-radius:14px; padding:14px 16px; margin-bottom:10px;}
.empty{color:var(--dim); text-align:center; padding:36px 20px; font-size:15px; line-height:1.5;}

/* ============ buttons ============ */
.btn{display:flex; align-items:center; justify-content:center; gap:8px; width:100%;
  min-height:52px; border-radius:14px; border:none; box-shadow:var(--card-shadow);
  background:var(--card); color:var(--accent-soft); font-size:16px; font-weight:600;
  margin-bottom:10px; padding:8px 14px;}
.btn:active{opacity:.55;}
.btn svg{width:18px; height:18px; flex:none;}
.btn.primary{background:var(--accent); color:var(--on-accent); font-weight:700; border-radius:999px; border:none;}
.btn.ghostbtn{background:var(--accent-bg); box-shadow:none; color:var(--accent-soft); font-weight:700;}
.btn.danger{color:var(--red);}
.btn.small{min-height:40px; font-size:14px; width:auto; display:inline-flex; margin:0; box-shadow:none; background:var(--input); color:var(--text);}
.btn.danger.small{background:var(--red-bg); color:var(--red);}
.minibtn{flex:none; width:40px; min-height:40px; border-radius:50%; border:none;
  background:var(--input); color:var(--dim); font-size:15px;}
.minibtn:active{opacity:.5;}
.minibtn.del{background:var(--red-bg); color:var(--red);}
.minibtn.acc{background:var(--accent-bg); color:var(--accent-soft);}

/* ============ home ============ */
.hero{margin:2px 4px 10px; display:flex; align-items:center; gap:10px;}
.hero .date{flex:1; min-width:0;}
/* quiet cloud pill: ghost when synced, orange while a push is owed */
.syncpill{flex:none; border:none; background:none; font-size:11px; font-weight:700; color:var(--ghost);
  padding:4px 0; cursor:pointer; font-variant-numeric:tabular-nums;}
.syncpill.dirty{color:var(--orange);}
.syncpill.busy{color:var(--dim);}
.hero .date{color:var(--dim); font-size:14px; font-weight:500;}
.statrow{display:flex; gap:10px; margin-bottom:4px;}
.stat{flex:1; background:var(--card); box-shadow:var(--card-shadow); border-radius:14px; padding:12px 16px;}
.stat .v{font-family:var(--display); font-size:26px; font-weight:750; letter-spacing:-.02em; color:var(--accent-soft); font-variant-numeric:tabular-nums;}
.stat .l{font-size:12px; color:var(--dim); font-weight:500; margin-top:1px;}
.tplbtn{display:flex; align-items:center; width:100%; text-align:left; gap:12px;
  background:var(--card); border:1px solid var(--edge); box-shadow:var(--card-shadow); border-radius:14px;
  padding:14px 16px; margin-bottom:8px; color:var(--text); min-height:68px;
  cursor:pointer; font-family:inherit; box-sizing:border-box;}
.tplbtn.continue, .tplbtn.next{border-color:transparent;}
.tplbtn:active{opacity:.6;}
.tplbtn .tinfo{flex:1; min-width:0;}
.tplbtn .tname{font-family:var(--display); font-size:17px; font-weight:700; letter-spacing:-.01em;}
.tplbtn .tsub{color:var(--dim); font-size:13px; margin-top:3px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
.tplbtn .go{flex:none; width:38px; height:38px; border-radius:50%; background:var(--accent-bg);
  color:var(--accent-soft); display:flex; align-items:center; justify-content:center;
  font-size:15px; font-weight:700;}
.continue{background:var(--accent); color:var(--on-accent);}
.continue .tsub{color:var(--on-accent); opacity:.72;}
.continue .go{background:var(--on-accent); color:var(--accent); opacity:.9;}
.tplbtn.next{background:var(--accent-bg);}
.nextchip{display:inline-block; vertical-align:2px; background:var(--accent); color:var(--on-accent);
  font-size:9px; font-weight:800; letter-spacing:.6px; padding:3px 7px; border-radius:7px; margin-left:6px;}

/* ============ workout ============ */
.exhead{display:flex; align-items:center; gap:8px;}
/* long level labels ("Ab Wheel (half)") wrap onto a second line instead of being
   cut. overflow-wrap is what saves a narrow screen: on a 320 px phone the header
   can squeeze this box under 70 px, and a single long word ("Pushdown") used to
   be sliced off with no ellipsis to admit it. -webkit-line-clamp is deliberately
   NOT used here - a flex item never gets display:-webkit-box, so it silently
   does nothing. */
.exname{flex:1; font-family:var(--display); font-size:17px; font-weight:700; letter-spacing:-.01em;
  color:var(--text); min-width:0; overflow:hidden; line-height:1.2; overflow-wrap:break-word;}
.extarget{color:var(--dim); font-family:var(--display); font-size:12px; font-weight:700; flex:none; background:var(--input); cursor:pointer;
  border-radius:8px; padding:4px 9px; font-variant-numeric:tabular-nums;}
/* double-progression offer: all sets hit the range top last time - tap fills weights+step */
.dpchip{flex:none; border:none; border-radius:8px; background:var(--accent-bg); color:var(--accent-soft);
  font-family:var(--display); font-size:12px; font-weight:800; padding:4px 9px; cursor:pointer;
  font-variant-numeric:tabular-nums;}
.dpchip:active{opacity:.6;}
.exhead .minibtn{width:34px; min-height:34px; font-size:13px; background:none; color:var(--ghost);}
.exhead .minibtn.acc{color:var(--accent-soft);}
.exhead .minibtn.del{color:var(--red);}
/* one-tap warmup ramp button - orange like the W set type */
.exhead .minibtn.warm{color:var(--orange); font-weight:800; font-size:14px;}
.exhead .minibtn.warm.on{background:var(--orange-bg);}
/* order badge: green = this session's completion order; outlined = last session's order */
.ordbadge{flex:none; width:22px; height:22px; padding:0; border-radius:50%; background:var(--green);
  border:none; color:#fff; font-size:11px; font-weight:700; line-height:1;
  display:inline-flex; align-items:center; justify-content:center;}
.ordbadge.last{background:transparent; color:var(--dim); border:1px solid var(--ghost);}
.exdone .exname{color:var(--dim);}
/* outline the exercise currently being worked on (wins over the alt outline) -
   a thin ice ring with a faint cold halo */
.card.excur{box-shadow:inset 0 0 0 1.5px var(--accent), 0 0 26px var(--glow); border-color:transparent;}
.lastnote{display:flex; align-items:center; gap:7px; background:var(--accent-bg); color:var(--accent-soft);
  border-radius:9px; padding:8px 12px; font-size:13px; margin-top:10px; font-style:italic;}
.lastnote svg{width:14px; height:14px; flex:none;}
.lastnote span{min-width:0;}
/* permanent (pinned) note - kept on the template, always shown */
.pnote{display:flex; align-items:center; gap:7px; background:var(--accent-bg); color:var(--accent-soft);
  border-radius:9px; padding:8px 12px; font-size:13px; font-weight:600; margin-top:10px;}
.pnote svg{width:14px; height:14px; flex:none;}
.noterow{display:flex; gap:8px; align-items:stretch; margin-top:10px;}
.exnote{flex:1; min-width:0; background:var(--input); color:var(--text); border:none; border-radius:9px;
  min-height:38px; padding:8px 12px; font-size:16px; -webkit-appearance:none;}
.exnote.perm{box-shadow:inset 0 0 0 1.5px var(--accent-soft);}
.exnote::placeholder{color:var(--ghost);}
.exnote:focus{outline:none;}
.noteperm{flex:none; width:42px; border:none; border-radius:9px; background:var(--input); color:var(--ghost);
  display:flex; align-items:center; justify-content:center;}
.noteperm svg{width:17px; height:17px;}
.noteperm.on{background:var(--accent-bg); color:var(--accent-soft);}
.noteperm:active{opacity:.6;}
/* home: grid of split cards with their templates inside */
.splitgrid{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:2px;}
.splitcard{background:var(--card); box-shadow:var(--card-shadow); border-radius:14px; padding:12px; min-width:0;}
.splitcard .sphead{display:flex; align-items:center; gap:6px; font-size:12px; font-weight:800; letter-spacing:.5px;
  text-transform:uppercase; color:var(--dim); margin:0 2px 6px; cursor:pointer;}
.sphead .sphn{flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
/* full-cycle counter since the last deload */
.cyc{flex:none; background:var(--accent-bg); color:var(--accent-soft); border-radius:7px;
  font-size:10px; font-weight:800; padding:3px 6px; font-variant-numeric:tabular-nums;}
/* per-workout counter on split rows */
.spcnt{flex:none; font-size:11px; font-weight:800; opacity:.5; font-variant-numeric:tabular-nums;}
/* assigned weekday tag on split rows */
.sprow .spwd{flex:none; font-size:10px; font-weight:800; color:var(--ghost); text-transform:uppercase; letter-spacing:.4px;}
.sprow.next .spwd{color:var(--on-accent); opacity:.65;}
/* orange dot: this workout's deload pass is still due */
.dldot{flex:none; width:7px; height:7px; border-radius:50%; background:var(--orange);}
/* main-program star on split card headers */
.mainbtn{flex:none; width:24px; height:24px; border:none; background:none; padding:0;
  display:flex; align-items:center; justify-content:center; color:var(--ghost);}
.mainbtn svg{width:15px; height:15px;}
.mainbtn.on{color:var(--orange);}
.mainbtn.on svg{fill:currentColor;}
.mainbtn:active{opacity:.5;}
/* deload: subtle section-header button, active banner, badges */
.secbtn{border:none; background:var(--input); color:var(--dim); border-radius:8px;
  min-height:26px; padding:0 10px; font-size:11px; font-weight:800; letter-spacing:.5px; text-transform:uppercase;}
.secbtn:active{opacity:.6;}
.dlcard{background:var(--orange-bg); border-radius:14px; padding:12px 16px; margin-bottom:10px;
  cursor:pointer; display:flex; flex-direction:column; gap:2px;}
.dlcard:active{opacity:.7;}
.dlcard .dlttl{color:var(--orange); font-weight:800; font-size:15px; letter-spacing:.3px;}
.dlcard .dlsub{color:var(--dim); font-size:12px; font-weight:600;}
.dlbar{background:var(--orange-bg); color:var(--orange); border-radius:10px;
  padding:9px 12px; margin-bottom:10px; font-size:12px; font-weight:700; text-align:center;}
.dlchip{flex:none; background:var(--orange-bg); color:var(--orange); border-radius:6px;
  font-size:9px; font-weight:800; letter-spacing:.5px; padding:2px 6px; vertical-align:1px;}
.rc.on.dl{background:var(--orange);}
.sprow{display:flex; align-items:center; gap:6px; width:100%; text-align:left;
  background:var(--input); border:none; border-radius:9px; min-height:42px;
  padding:6px 10px; margin-top:6px; color:var(--text); font-size:14px; font-weight:650;
  font-family:var(--display); cursor:pointer;}
.sprow:active{opacity:.6;}
.sprow .spn{flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.sprow.next{background:var(--accent); color:var(--on-accent);}
.sprow.next .nextchip{background:var(--on-accent); color:var(--accent); margin-left:0;}
/* today's planned workout, already logged today */
.donechip{flex:none; background:var(--green-bg); color:var(--green); font-size:9px; font-weight:800;
  letter-spacing:.6px; padding:3px 7px; border-radius:7px;}
.setgrid{display:grid; grid-template-columns:22px 1fr 70px 46px 40px 22px; gap:5px; align-items:center; margin-top:8px;}
/* no dropset column (D+ off, no drop rows): 5 columns, Previous gets the spare room */
.setgrid.nod{grid-template-columns:22px 1fr 70px 46px 40px;}
.setgrid.hdr{margin-top:14px;}
.setgrid.hdr div{font-size:11px; font-weight:700; letter-spacing:.4px; color:var(--dim); text-transform:uppercase; text-align:center;}
.setgrid.hdr div:nth-child(2){text-align:left; padding-left:2px;}
.setrow-wrap{border-radius:10px;}
.setrow-wrap.done{background:var(--green-bg);}
.setnum{min-height:42px; border:none; background:none; color:var(--dim); font-family:var(--display); font-weight:700; font-size:15px; border-radius:8px;}
.setnum.warm{color:var(--orange);}
.setnum.dropn{color:var(--accent-soft);}
.setnum.failn{color:var(--red);}
.dropbtn{flex:none; width:22px; min-height:36px; border:none; background:none; color:var(--ghost);
  font-size:10px; font-weight:800; padding:0; border-radius:7px;}
.dropbtn:active{color:var(--accent-soft);}
.dropbtn.del{color:var(--red); font-size:12px;}
/* dropset rows - smaller, indented */
.setrow-wrap.droprow{margin-left:20px;}
.droprow .setgrid{margin-top:4px;}
.droprow .setgrid input{min-height:34px; font-size:16px;}
.droprow .checkbtn{min-height:34px;}
.droprow .checkbtn svg{width:14px; height:14px;}
.droprow .setnum{min-height:34px; font-size:13px;}
.droprow .prev{font-size:11px;}
.prev{color:var(--dim); font-family:var(--display); font-size:12.5px; font-weight:550; padding-left:2px; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums; letter-spacing:-.01em;}
.setgrid input{width:100%; background:var(--input); border:none;
  border-radius:9px; min-height:42px; font-family:var(--display); font-size:17px; font-weight:650; text-align:center;
  font-variant-numeric:tabular-nums; -webkit-appearance:none; appearance:none;}
.setgrid input::placeholder{color:var(--ghost); font-weight:500;}
.setgrid input:focus{outline:none; box-shadow:0 0 0 2px var(--accent);}
.setrow-wrap.done .setgrid input{background:transparent;}
/* the haptic switch (hapLabel): a label over the whole button takes the real
   tap; the switch inside stays invisible and 1px - a full-size one under the
   finger would swallow page scrolls. Its native look must stay (appearance:none
   silences the tick). */
.checkbtn, .missbtn{position:relative;}
.hap{position:absolute; inset:0; border-radius:inherit; cursor:pointer;
  -webkit-tap-highlight-color:transparent; touch-action:manipulation;}
.setgrid .hap input, .hap input{position:absolute; left:0; top:0; width:1px; height:1px; min-height:0;
  margin:0; padding:0; border:0; visibility:hidden; pointer-events:none; -webkit-appearance:auto; appearance:auto;}
.checkbtn{width:100%; min-height:42px; border-radius:9px; border:none;
  background:var(--input); color:var(--dim); padding:0;
  display:flex; align-items:center; justify-content:center;}
.checkbtn svg{width:17px; height:17px;}
.setgrid.hdr svg{width:12px; height:12px; opacity:.8; vertical-align:-2px;}
.checkbtn.done{background:var(--green); color:#fff;}
.checkbtn.loss{background:var(--red); color:#fff;}
/* the current set to complete - inviting; later sets wait their turn (dimmed) */
.checkbtn.cur{background:var(--accent-bg); color:var(--accent-soft); box-shadow:inset 0 0 0 1.5px var(--accent-soft);}
.setrow-wrap.locked{opacity:.42;}
.checkbtn.pop{animation:check-pop .32s ease;}
@keyframes check-pop{0%{transform:scale(1);}40%{transform:scale(1.18);}100%{transform:scale(1);}}
.setctl{display:flex; gap:8px; margin-top:14px;}
.setctl button{flex:1; min-height:38px; background:var(--input); border:none;
  color:var(--dim); border-radius:9px; font-size:13px; font-weight:700;}
.setctl button:first-child{background:var(--accent-bg); color:var(--accent-soft);}
/* the note button: the field opens on demand; lit when the card has a note */
.setctl button.notebtn{flex:0 0 46px; display:flex; align-items:center; justify-content:center; padding:0;}
.setctl .notebtn svg{width:16px; height:16px;}
.setctl .notebtn.on{background:var(--accent-bg); color:var(--accent-soft);}

/* rest stopwatch (inline, counts up after a checked set) */
.restbar{display:flex; align-items:center; justify-content:center; gap:4px;
  min-height:40px; border-radius:9px; background:var(--accent-bg);
  border:none; margin-top:8px; cursor:pointer; position:relative; overflow:hidden;}
.restbar .rsp{flex:none; width:44px;}
.restbar .rrst{flex:none; width:44px; min-height:40px; background:none; border:none;
  color:var(--accent-soft); display:flex; align-items:center; justify-content:center;
  position:relative; cursor:pointer;}
.restbar .rrst svg{width:15px; height:15px;}
.restbar .rrst:active{opacity:.5;}
.restbar.done .rrst{color:var(--green);}
.restbar .pulse{width:8px; height:8px; border-radius:50%; background:var(--accent);
  animation:pulse-dot 1.2s ease-in-out infinite;}
@keyframes pulse-dot{50%{opacity:.2; transform:scale(.7);}}
.restbar .tm{font-family:var(--display); font-weight:700; font-size:16px; font-variant-numeric:tabular-nums; color:var(--accent-soft);}
/* rest target mode: progress fill + inline ±15 s + green "done" state */
.restbar.target{padding:0 2px;}
.restbar .rfill{position:absolute; left:0; top:0; bottom:0; width:0;
  background:linear-gradient(90deg, var(--accent), var(--accent-soft)); opacity:.16;
  transition:width 1s linear; pointer-events:none;}
.restbar .mid{display:flex; align-items:center; gap:8px; min-width:0; position:relative;
  flex:1; justify-content:center; min-width:0;}
.restbar .tm{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0;}
.restbar .adj{position:relative; background:none; border:none; min-width:46px; min-height:40px;
  font-family:var(--display); font-weight:700; font-size:13px; color:var(--accent-soft);
  font-variant-numeric:tabular-nums; cursor:pointer;}
.restbar.done{background:var(--green-bg);}
.restbar.done .rfill{background:var(--green); opacity:.1;}
.restbar.done .tm, .restbar.done .adj{color:var(--green);}
.restbar.done .pulse{background:var(--green); animation:none;}
.restbar.flash{animation:rest-flash 1.1s ease;}
@keyframes rest-flash{
  0%,100%{box-shadow:0 0 0 0 transparent;}
  15%,55%{box-shadow:0 0 0 3px var(--green);}
  35%,80%{box-shadow:0 0 0 0 transparent;}}
/* topbar + keyboard bar echo the "rest done" state */
#topbar .tbr.done{color:var(--green);}
#topbar .tbr.done .tbdot{background:var(--green); animation:none;}
#stepper .steptime .rst.ok{color:var(--green);}
/* per-exercise rest target row in the template editor */
.numfield input.restin{width:64px; background:none; border:none; text-align:center;
  font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; padding:0;}
.numfield input.restin::placeholder{color:var(--ghost); font-weight:700;}
.ctlrow .resthint{color:var(--ghost); font-size:12px; font-weight:600;}

/* screen entrance (on tab/nav change only, see go()) */
#screen.screen-in{animation:screen-in .28s ease;}
@keyframes screen-in{from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);}}

/* quick ±weight stepper, docked above the keyboard while a weight input is focused */
#stepper{position:fixed; left:0; right:0; bottom:0; z-index:30; display:none;
  gap:10px; padding:8px 16px calc(8px + env(safe-area-inset-bottom));
  background:var(--card); border-top:1px solid var(--line); will-change:transform;
  transition:opacity .16s ease;}
#stepper.show{display:flex;}
/* hidden while the visual viewport is in motion (scroll / keyboard animation) */
#stepper.moving{opacity:0; pointer-events:none;}
#stepper button{flex:0 0 76px; min-height:44px; border:none; border-radius:10px;
  background:var(--input); color:var(--accent-soft); font-size:16px; font-weight:800;}
#stepper button:active{opacity:.6;}
/* workout + rest time between the steppers (topbar hides behind the iOS keyboard) */
#stepper .steptime{flex:1; min-width:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--display); font-size:15px; font-weight:700; color:var(--dim);
  font-variant-numeric:tabular-nums; white-space:nowrap; gap:4px;}
#stepper .steptime .rst{color:var(--accent-soft);}

/* bodyweight line: separate body-weight value shown per bodyweight exercise */
.bwline{display:flex; align-items:center; gap:8px; margin-top:10px; font-size:12px;
  font-weight:700; color:var(--dim); flex-wrap:wrap;}
.bwline .bwlbl{display:inline-flex; align-items:center; gap:5px; cursor:pointer; user-select:none;}
.bwline .bwlbl svg{width:14px; height:14px;}
/* pill grouping the −/+ steppers around the value, so it reads as one quick control */
.bwstepper{flex:none; display:flex; align-items:center; background:var(--input); border-radius:10px; overflow:hidden;}
.bwstepper:focus-within{box-shadow:0 0 0 2px var(--accent);}
.bwstepper .bwstep{flex:none; width:38px; min-height:36px; border:none; background:none;
  color:var(--accent-soft); font-size:15px; font-weight:800; padding:0; line-height:1;}
.bwstepper .bwstep:active{opacity:.45;}
.bwline .bwinput{flex:none; width:64px; background:none; border:none; min-height:36px;
  font-size:16px; font-weight:800; text-align:center; -webkit-appearance:none;
  font-variant-numeric:tabular-nums;}
.bwline .bwinput:focus{outline:none;}
.bwline .bwu{color:var(--dim);}
.bwline .bwhint{color:var(--ghost); font-weight:500; font-size:11px; flex:1 1 0; min-width:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} /* never force the row to wrap */

/* quick body-weight logging modal (home stat card) - big ±0.1 stepper */
.bwmodal{display:flex; align-items:center; justify-content:center; gap:8px; margin:6px 0 18px;}
.bwmodal .bwmstep{flex:none; width:58px; min-height:58px; border:none; border-radius:14px;
  background:var(--input); color:var(--accent-soft); font-size:22px; font-weight:800;}
.bwmodal .bwmstep:active{opacity:.5;}
.bwmodal .bwminput{flex:none; width:110px; background:var(--input); border:none; border-radius:14px;
  min-height:58px; font-family:var(--display); font-size:28px; font-weight:750; text-align:center; color:var(--text);
  -webkit-appearance:none; font-variant-numeric:tabular-nums;}
.bwmodal .bwminput:focus{outline:none; box-shadow:0 0 0 2px var(--accent);}
.bwmodal .bwmu{color:var(--dim); font-weight:700; font-size:15px;}
/* quiet context under the logger: median line, trend spark, recent entries */
.bwminfo{margin-top:16px; border-top:1px solid var(--line); padding-top:12px;}
.bwmmed{display:flex; align-items:baseline; gap:8px; font-size:13px; color:var(--dim); margin:0 2px 8px;}
.bwmmed b{color:var(--text); font-weight:750; font-variant-numeric:tabular-nums;}
.bwmspark{opacity:.85; margin-bottom:6px;}
.bwmspark svg.spark{width:100%; height:auto; max-height:56px;}
.bwmlist{max-height:168px; overflow-y:auto; -webkit-overflow-scrolling:touch;}
.bwmrow{display:flex; gap:8px; padding:5px 2px; align-items:center; font-size:14px;}
.bwmrow .d{color:var(--dim); flex:1;}
.bwmrow .w{font-weight:700; font-variant-numeric:tabular-nums;}

/* comeback note: quiet line on the exercise card while suggestions are eased in */
.cbnote{font-size:12px; color:var(--orange); font-weight:600; margin:2px 2px 6px;}
/* mastery fact in the finish summary: one quiet win on no-PR days */
.mfact{display:flex; align-items:center; gap:9px; background:var(--accent-bg); color:var(--accent-soft);
  border-radius:12px; padding:11px 14px; margin-top:14px; font-weight:650; font-size:14px;}
.mfact svg{width:16px; height:16px; flex:none;}
/* superset connector between linked exercise cards */
.ssline{display:flex; align-items:center; justify-content:center; gap:6px;
  color:var(--accent-soft); font-size:11px; font-weight:800; letter-spacing:.6px;
  text-transform:uppercase; margin:-4px 0 6px;}

/* one-shot confetti burst on a new PR */
#confetti{position:fixed; inset:0; pointer-events:none; z-index:80; overflow:hidden;}
#confetti i{position:absolute; top:-14px; width:9px; height:14px; border-radius:2px;
  opacity:.95; animation-name:confetti-fall; animation-timing-function:cubic-bezier(.3,.6,.4,1);
  animation-fill-mode:forwards;}
@keyframes confetti-fall{
  0%{transform:translateY(-20px) translateX(0) rotate(0deg); opacity:1;}
  100%{transform:translateY(102vh) translateX(var(--drift)) rotate(var(--rot)); opacity:.9;}
}

/* ============ program / editor ============ */
.tplrow{display:flex; align-items:center; gap:8px;}
.tplrow .info{flex:1; min-width:0; cursor:pointer; padding:2px 0;}
.tplrow .nm{font-size:17px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.tplrow .ct{color:var(--dim); font-size:13px; margin-top:2px;}
.exedit{border-top:1px solid var(--line); padding-top:14px; margin-top:14px;}
.exedit:first-child{border-top:none; margin-top:0; padding-top:2px;}
.exhrow{display:flex; gap:8px; align-items:flex-start;}
.exedit .exlabel{flex:1; min-width:0; padding-top:3px;}
.exedit .exlabel .n{font-weight:700; font-size:16px;}
.exedit .exlabel .gr{color:var(--dim); font-size:12px; margin-top:2px;}
/* aligned control rows: fixed-width label + stepper(s) */
.ctlrow{display:flex; gap:6px; align-items:center; margin-top:10px; flex-wrap:wrap;}
.ctlrow .clbl{width:34px; flex:none; color:var(--dim); font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.3px;}
/* longer labels (e.g. Progression) get their full width instead of clipping at 34px */
.ctlrow .clbl.wide{width:auto; min-width:34px; padding-right:2px;}
.repsrow .rgdash{color:var(--dim); font-weight:800; font-size:15px;}
/* clean square icon buttons for row actions (no emoji) */
.rowacts{display:flex; gap:6px; align-items:center; flex:none;}
.iconbtn2{width:34px; height:34px; flex:none; border:none; border-radius:9px; background:var(--input);
  color:var(--dim); display:flex; align-items:center; justify-content:center; padding:0;}
.iconbtn2 svg{width:17px; height:17px;}
.iconbtn2:active{opacity:.5;}
.iconbtn2.on{background:var(--accent-bg); color:var(--accent-soft);}
.iconbtn2.danger{color:var(--red);}
.iconbtn2.play{background:var(--accent); color:var(--on-accent);}
/* program reorder rows: nothing to open, only big up/down targets */
.tplbtn.ordrow{cursor:default;}
.tplbtn.ordrow:active{opacity:1;}
/* the program just moved: an accent outline, visible on every skin (the tint alone vanishes on monochrome ones) */
.tplbtn.ordrow.next{border-color:var(--accent);}
.ordrow .iconbtn2{width:44px; height:44px; border-radius:11px;}
.ordrow .iconbtn2 svg{width:20px; height:20px;}
.ordrow .iconbtn2:disabled{opacity:.3;}
.iconbtn2.play svg{width:15px; height:15px; margin-left:1px;}
.nameinput{width:100%; background:var(--input); border:none;
  border-radius:10px; min-height:46px; font-size:16px; font-weight:600; padding:0 12px; -webkit-appearance:none;}
.nameinput:focus{outline:none; box-shadow:0 0 0 2px var(--accent);}
/* segmented button group (full-width variant; matches the compact .seg look) */
.segmented{display:flex; gap:4px; background:var(--input); border-radius:10px; padding:3px;}
.segmented .seg{flex:1; min-height:40px; border:none; border-radius:8px; background:transparent;
  color:var(--dim); font-size:14px; font-weight:600;
  display:flex; align-items:center; justify-content:center; text-align:center; padding:0 6px;}
.segmented .seg.on{background:var(--card); color:var(--text); font-weight:700; box-shadow:0 1px 4px rgba(0,0,0,.15);}
.segmented .seg:active{opacity:.7;}
.numfield{display:flex; align-items:center; background:var(--input); border:none; border-radius:10px; overflow:hidden;}
.numfield:focus-within{box-shadow:0 0 0 2px var(--accent);}
.numfield button{width:34px; min-height:42px; background:none; border:none; color:var(--accent-soft); font-size:19px; font-weight:700;
  display:flex; align-items:center; justify-content:center; padding:0;}
.numfield .val{min-width:20px; text-align:center; font-size:16px; font-weight:700; font-variant-numeric:tabular-nums;}
/* reps range toggle - flows right after the steppers (no floating gap) */
.rangetog{min-height:36px; padding:0 11px; border:none; border-radius:9px; background:var(--input);
  color:var(--dim); font-size:12px; font-weight:700;
  display:inline-flex; align-items:center; justify-content:center;}
.rangetog.acc{background:var(--accent-bg); color:var(--accent-soft);}
.rangetog:active{opacity:.6;}
.go svg{width:18px; height:18px;}
.ssline svg{width:13px; height:13px;}
.minibtn svg{width:16px; height:16px;}

/* ===== exercise alternatives ===== */
/* workout: swap planned <-> alternative; alternative card is subtly outlined */
.altcard{box-shadow:inset 0 0 0 1.5px var(--accent-soft);}
.altbar{display:flex; align-items:center; gap:7px; margin-top:10px; padding:7px 11px;
  background:var(--accent-bg); color:var(--accent-soft); border-radius:9px;
  font-size:12px; font-weight:700; cursor:pointer;}
.altbar svg{width:15px; height:15px; flex:none;}
.altbar:active{opacity:.6;}
/* pair-of-dumbbells toggle in the set-table weight column header */
.x2chip{background:none; border:1px solid var(--line); border-radius:7px;
  color:var(--ghost); font-size:10px; font-weight:800; padding:1px 5px;
  margin-left:3px; cursor:pointer; vertical-align:1px; letter-spacing:.3px;}
.x2chip.on{background:var(--accent-bg); border-color:transparent; color:var(--accent-soft);}

/* rep-max table in exercise detail */
.rmrow{display:flex; align-items:baseline; gap:10px; padding:7px 0; border-bottom:1px solid var(--line); font-size:14px;}
.rmrow:last-child{border-bottom:none;}
.rmrow .rr{flex:none; width:38px; color:var(--dim); font-weight:700;
  font-family:var(--display); font-variant-numeric:tabular-nums;}
.rmrow .rw{flex:1; font-weight:800; font-size:15px; font-family:var(--display); font-variant-numeric:tabular-nums;}
.rmrow .rd{flex:none; color:var(--ghost); font-size:12px; font-weight:600;}

/* e1RM trend arrow on tracked-lift cards */
.tktrend{flex:none; font-weight:800; font-size:15px; margin-left:2px;}
.tktrend.up{color:var(--green);}
.tktrend.flat{color:var(--dim);}
.tktrend.down{color:var(--orange);}

/* deload divider woven into the history list */
.dldiv{display:flex; align-items:center; gap:8px; margin:14px 4px 10px;
  font-size:12px; font-weight:700; color:var(--orange);}
.dldiv .l{text-transform:uppercase; letter-spacing:.8px;}
.dldiv .d{color:var(--dim); font-weight:600;}
.dldiv .r{margin-left:auto; color:var(--dim); font-weight:600;}
.dldiv::before{content:''; width:14px; height:2px; border-radius:2px; background:var(--orange);}
.dldiv2{margin:-6px 4px 10px 26px; font-size:12px; font-weight:600; color:var(--ghost); line-height:1.6;}
.dldiv2 .cy{color:var(--orange); font-weight:700;}

/* "Continue" pill on the newest history row - undo an accidental Finish */
.contbtn{display:inline-flex; align-items:center; gap:5px; background:var(--accent-bg);
  color:var(--accent-soft); border:none; border-radius:999px; min-height:30px;
  padding:0 12px; font-size:12px; font-weight:800; cursor:pointer; flex:none;}
.contbtn svg{width:11px; height:11px;}
.contbtn:active{opacity:.6;}

/* ghost exercise suggestion: faded, inert until tapped */
.card.ghostex{display:flex; align-items:center; gap:10px; background:none; box-shadow:none;
  border:1px dashed var(--line); padding:12px 8px 12px 16px; opacity:.8;}
.ghostex .ginfo{flex:1; min-width:0; cursor:pointer;}
.ghostex .gname{font-weight:700; font-size:15px; color:var(--dim);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.ghostex .gsub{font-size:12px; color:var(--ghost); margin-top:2px; line-height:1.4;}
.ghostex .gx{flex:none; background:none; border:none; color:var(--ghost);
  min-width:40px; min-height:40px; font-size:14px; cursor:pointer;}
.ghostex .gx:active{opacity:.5;}

/* subtle "add exercise to this session" at the bottom of the workout screen */
.addexbtn{display:block; width:100%; min-height:48px; margin-top:2px;
  background:none; border:1px dashed var(--line); border-radius:14px;
  color:var(--dim); font-size:14px; font-weight:600; cursor:pointer;}
.addexbtn:active{opacity:.6;}

/* workout preview modal (tap a workout on Home) */
.pvsub{color:var(--dim); font-size:13px; font-weight:600; margin:0 4px 10px;}
.pvsub .pvdl{color:var(--orange); font-weight:700;}
.pvrow{display:flex; align-items:center; gap:10px; min-height:38px; border-bottom:1px solid var(--line);}
.pvrow:last-child{border-bottom:none;}
.pvnum{flex:none; width:20px; text-align:center; color:var(--ghost); font-size:13px; font-weight:700;
  font-family:var(--display); font-variant-numeric:tabular-nums;}
.pvname{flex:1; min-width:0; font-size:15px; font-weight:600;
  overflow:hidden; line-height:1.25; /* long level names wrap, never clip */
  display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
.pvname .ssic{display:flex; color:var(--accent-soft);}
.pvname .ssic svg{width:13px; height:13px;}
.pvsr{flex:none; color:var(--dim); font-size:14px; font-weight:700;
  font-family:var(--display); font-variant-numeric:tabular-nums;}

/* swap menu (modal) */
.swaplist{display:flex; flex-direction:column; gap:6px; margin-top:4px;}
.swapitem{display:flex; align-items:center; gap:8px; width:100%; text-align:left;
  background:var(--input); border:none; border-radius:11px; min-height:52px; padding:0 14px;
  color:var(--text); font-size:16px; font-weight:600; font-family:inherit; cursor:pointer;}
.swapitem:active{opacity:.6;}
.swapitem.on{box-shadow:0 0 0 2px var(--accent);}
.swapitem .sn{flex:1; min-width:0;}
.swapitem .basetag{font-size:10px; font-weight:800; letter-spacing:.5px; text-transform:uppercase;
  color:var(--accent-soft); background:var(--accent-bg); padding:2px 7px; border-radius:6px; margin-left:6px;}
.swapitem .chk{flex:none; display:flex; color:var(--accent-soft);}
.swapitem .chk svg{width:18px; height:18px;}
/* swap rows with a trailing "make main" pin: the row is a div, tap zones are separate buttons */
.swapitem.swaprow{padding:0 8px 0 0;}
.swapitem .swapmain{flex:1; display:flex; align-items:center; gap:8px; min-width:0;
  background:none; border:none; color:inherit; font:inherit; text-align:left;
  min-height:52px; padding:0 0 0 14px; cursor:pointer;}
.swapitem .pinbtn{flex:none; display:flex; align-items:center; gap:5px;
  background:var(--accent-bg); color:var(--accent-soft); border:none; border-radius:9px;
  min-height:36px; padding:0 10px; font-size:12px; font-weight:800; letter-spacing:.3px; cursor:pointer;}
.swapitem .pinbtn svg{width:14px; height:14px;}
.swapitem .pinbtn:active{opacity:.6;}
/* exercise action menu rows: leading icon + label */
.swapitem .mi{flex:none; display:flex; color:var(--dim);}
.swapitem .mi svg{width:18px; height:18px;}
.swapitem.on .mi{color:var(--accent-soft);}
.swapitem.danger{color:var(--red);}
.swapitem.danger .mi{color:var(--red);}
/* template editor: alternatives row */
.altsrow{display:flex; gap:6px; align-items:center; margin-top:10px; flex-wrap:wrap;}
.altsrow .clbl{width:34px; flex:none; color:var(--dim); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.3px;}
.altchip{display:inline-flex; align-items:center; gap:3px; background:var(--input); color:var(--text);
  border-radius:8px; padding:5px 5px 5px 10px; font-size:13px; font-weight:600;}
.altchip button{width:22px; height:22px; flex:none; border:none; border-radius:6px; background:none; color:var(--dim);
  display:flex; align-items:center; justify-content:center; padding:0;}
.altchip button svg{width:12px; height:12px;}
.altadd{display:inline-flex; align-items:center; gap:5px; background:var(--accent-bg); color:var(--accent-soft);
  border:none; border-radius:8px; min-height:34px; padding:0 11px; font-size:12px; font-weight:700;}
.altadd svg{width:14px; height:14px;}
.altadd:active{opacity:.6;}

/* ============ exercise browser ============ */
.searchbox{display:flex; align-items:center; gap:10px; background:var(--card); border:1px solid var(--edge);
  box-shadow:var(--card-shadow); border-radius:12px; padding:0 14px; margin-bottom:10px;}
.searchbox input{flex:1; background:none; border:none; min-height:46px; font-size:16px; font-weight:500;}
.searchbox input:focus{outline:none;}
.searchbox svg{color:var(--ghost); flex:none; width:19px; height:19px;}
.chips{display:flex; gap:7px; overflow-x:auto; padding:2px 0 10px; -webkit-overflow-scrolling:touch; scrollbar-width:none;}
.chips::-webkit-scrollbar{display:none;}
.chip{flex:none; background:var(--card); border:none; box-shadow:var(--card-shadow); color:var(--dim);
  border-radius:18px; min-height:35px; padding:0 15px; font-size:13px; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center;}
/* chip rows inside cards wrap instead of spilling past the card edge */
.card .chips{flex-wrap:wrap; overflow-x:visible;}
/* the deload sheet's option rows wrap too - a sixth option (100 %) was cut off at the
   edge; the exercise picker keeps its one scrolling row of filters */
#dlm-body .chips{flex-wrap:wrap; overflow-x:visible;}
.chip.on{background:var(--accent); color:var(--on-accent); font-weight:700;}
.exitem{display:flex; align-items:center; gap:12px; width:100%; text-align:left;
  background:var(--card); border:1px solid var(--edge); box-shadow:var(--card-shadow); border-radius:12px;
  padding:10px 14px; margin-bottom:7px; color:var(--text); min-height:56px;}
.exitem:active{opacity:.6;}
.exitem .xi{flex:1; min-width:0;}
.exitem .xn{font-weight:600; font-size:15px;}
.exitem .xg{color:var(--dim); font-size:12px; margin-top:2px;}
/* time-exercise tag in list sub-lines: seconds are logged, not reps */
.xt{color:var(--accent-soft); font-weight:700;}
/* skin picker rows: fixed-color swatch (dark bg + accent dot) per style */
/* skin swatch = the skin's real sky (atmo-to-bg gradient) with its accent dot(s) */
.skinsw{flex:none; width:44px; height:30px; border-radius:9px; border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; gap:5px;}
.skinsw i{width:13px; height:13px; border-radius:50%; display:block;
  box-shadow:0 1px 3px rgba(0,0,0,.4);}
.exitem .best{flex:none; color:var(--accent-soft); font-weight:700; font-size:13px; font-variant-numeric:tabular-nums;}

/* ============ stats dashboard ============ */
/* card header: title + compact per-chart period chips */
.chead{display:flex; align-items:center; gap:8px; margin-bottom:10px; min-height:30px;}
.chead .ct{flex:1; min-width:0; font-size:12px; font-weight:800; letter-spacing:.5px;
  text-transform:uppercase; color:var(--dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.pchips{flex:none; display:flex; gap:2px; background:var(--input); border-radius:9px; padding:2px;}
.pchips button{border:none; background:none; color:var(--dim); font-size:12px; font-weight:700;
  min-height:28px; padding:0 9px; border-radius:7px;}
.pchips button.on{background:var(--card); color:var(--text); box-shadow:0 1px 4px rgba(0,0,0,.15);}
.pchips button:active{opacity:.6;}
/* custom from-to range (native date inputs) */
.rangebar{display:flex; gap:8px; margin:0 0 12px;}
.rangebar label{flex:1; min-width:0; display:flex; align-items:center; gap:6px;
  font-size:10px; font-weight:700; color:var(--dim); text-transform:uppercase; letter-spacing:.3px;}
.rangebar input{flex:1; min-width:0; background:var(--input); border:none; border-radius:9px;
  min-height:38px; padding:0 8px; font-size:14px; font-weight:600; color:var(--text); -webkit-appearance:none;}
.rangebar input:focus{outline:none; box-shadow:0 0 0 2px var(--accent);}
/* summary strip deltas vs the prior 7 days */
.dlt{font-size:13px; font-weight:800; margin-left:6px; vertical-align:3px;}
.dlt.up{color:var(--green);}
.dlt.down{color:var(--red);}
/* rhythm strip - one square per day, letter = that day's workout */
.rhythm{display:flex; gap:4px;}
/* 30/90 d: wrap into 15-day rows (deliberately not a weekday grid) */
.rhythm.multi{display:grid; grid-template-columns:repeat(15,1fr);}
.rhythm.multi .rc{height:26px; font-size:10px;}
.rc{flex:1; height:32px; min-width:0; border:none; border-radius:7px; background:var(--input);
  display:flex; align-items:center; justify-content:center; padding:0;
  font-size:11px; font-weight:800; color:var(--on-accent);}
.rc.on{background:var(--accent); cursor:pointer;}
.rc.on:active{opacity:.6;}
.rc.today{box-shadow:inset 0 0 0 2px var(--accent);}
.rc.on.today{box-shadow:inset 0 0 0 2px var(--on-accent);}
/* year grid: GitHub-style, 7 rows (Mon top) x ~53 week columns, fluid width */
.ynav{display:flex; align-items:center; justify-content:center; gap:14px; margin:2px 0 8px;}
.ynav .minibtn{width:34px; min-height:30px; font-size:18px; line-height:1;}
.ynav .minibtn:disabled{opacity:.25;}
.yyr{font-family:var(--display); font-weight:750; font-size:16px; min-width:52px; text-align:center;}
/* the grid keeps GitHub-size cells and scrolls sideways on phones; it opens
   scrolled to the current week (rhythmYearScroll) */
.ywrap{padding-top:16px; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none;
  margin:0 -4px; padding-left:4px; padding-right:4px;}
.ywrap::-webkit-scrollbar{display:none;}
.yinner{position:relative; width:max-content; min-width:100%;}
.ymonths{position:relative; height:0;}
.ymonths span{position:absolute; top:-15px; font-size:10px; color:var(--ghost); font-weight:600; white-space:nowrap;}
.ygrid{display:flex; gap:3px;}
.ycol{display:flex; flex-direction:column; gap:3px; flex:none;}
.yc{display:block; width:11px; height:11px; border:none; padding:0; border-radius:2px; background:var(--input);}
@media (min-width:760px){ .yc{width:13px; height:13px;} }
.yc.off{background:transparent;}
.yc.on{background:var(--accent); opacity:.72; cursor:pointer;}
.yc.on.x2{opacity:1;}
.yc.on.dl{background:var(--orange);}
.yc.today{box-shadow:inset 0 0 0 1.5px var(--accent);}
.yc.on.today{box-shadow:inset 0 0 0 1.5px var(--on-accent);}
.ystats{font-size:12px; color:var(--dim); margin-top:10px; line-height:1.5;}
/* all-time month heat map: a row per year */
.mrow{display:flex; gap:3px; align-items:center; margin-bottom:3px;}
.mrow .myr{flex:none; width:36px; font-size:11px; color:var(--dim); font-weight:600;}
.mhead span{flex:1; text-align:center; font-size:10px; color:var(--ghost); font-weight:600;}
.mc{flex:1; height:24px; border-radius:5px; background:var(--input); display:flex; align-items:center;
  justify-content:center; font-style:normal; font-size:10px; font-weight:800; color:var(--text);
  font-variant-numeric:tabular-nums; position:relative; overflow:hidden;}
.mc.off{background:transparent;}
/* shade lives on a ::before layer so the number stays fully legible */
.mc.l1::before, .mc.l2::before, .mc.l3::before, .mc.l4::before{content:''; position:absolute; inset:0; background:var(--accent);}
.mc.l1::before{opacity:.28;} .mc.l2::before{opacity:.5;} .mc.l3::before{opacity:.75;} .mc.l4::before{opacity:1;}
.mc.l3, .mc.l4{color:var(--on-accent);}
.mc span{position:relative;}
.mc.dl{box-shadow:inset 0 0 0 2px var(--orange);}
/* tracked lift cards */
.trackcard{cursor:pointer;}
.trackcard:active{opacity:.7;}
.tkhead{display:flex; align-items:center; gap:8px;}
.tkname{flex:1; min-width:0; font-weight:700; font-size:16px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.tkhead .iconbtn2{width:28px; height:28px; background:none; color:var(--ghost);}
.tkhead .iconbtn2 svg{width:13px; height:13px;}
.tkrow{display:flex; align-items:flex-end; gap:12px; margin-top:4px;}
.tkleft{flex:1; min-width:0;}
.tkval{font-family:var(--display); font-size:24px; font-weight:750; letter-spacing:-.02em; color:var(--accent-soft);
  font-variant-numeric:tabular-nums;}
.tkdelta{display:inline-block; margin-top:3px; font-size:12px; font-weight:700; color:var(--dim);}
.tkdelta.up{color:var(--green);}
.tkdelta.down{color:var(--red);}
svg.spark{flex:none; width:130px; height:40px;}
/* lift goal: thin progress toward the target e1RM */
.goalrow{display:flex; align-items:center; flex-wrap:wrap; gap:6px 10px; margin-top:10px;}
.goalrow .goalbar{flex:1; height:5px; background:var(--input); border-radius:3px; overflow:hidden;}
.goalrow .goalbar i{display:block; height:100%; background:var(--accent); border-radius:3px;}
.goalrow .goaltxt{flex:1 1 100%; white-space:normal; font-size:11px; font-weight:700; color:var(--dim); font-variant-numeric:tabular-nums;}
.goalrow .goaltxt.done{color:var(--green);}
/* PR feed rows */
.prrow{display:flex; align-items:center; gap:10px; padding:9px 0;
  border-bottom:1px solid var(--line); cursor:pointer;}
.prrow:last-child{border-bottom:none;}
.prrow:active{opacity:.6;}
.prbadge{flex:none; min-width:42px; text-align:center; background:var(--accent-bg); color:var(--accent-soft);
  font-size:11px; font-weight:800; border-radius:8px; padding:5px 6px; font-variant-numeric:tabular-nums;}
.pri{flex:1; min-width:0;}
.prn{font-weight:700; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.prd{color:var(--dim); font-size:12px; margin-top:1px;}
.prv{flex:none; font-weight:800; font-size:15px; font-variant-numeric:tabular-nums;}
.mb-row{display:flex; align-items:center; gap:10px; padding:5px 0; font-size:13px;}
.mb-name{width:92px; flex:none; color:var(--dim); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.mb-bar{flex:1; height:10px; background:var(--input); border-radius:5px; overflow:hidden;}
.mb-bar i{display:block; height:100%; background:var(--accent); border-radius:5px;}
.mb-val{flex:none; min-width:24px; text-align:right; font-weight:800; font-variant-numeric:tabular-nums;}
/* weekly sets bar: muted 10-20 guide band under the fill + last week's tick */
.wv-bar{position:relative; overflow:hidden;}
.wv-bar .wv-band{position:absolute; top:0; bottom:0; background:var(--dim); opacity:.18; border-radius:3px;}
.wv-bar i{position:relative; z-index:1;}
.wv-bar .wv-tick{position:absolute; top:0; bottom:0; width:2px; background:var(--text); opacity:.45; z-index:2;}
.dlt.wv-down{color:var(--dim);} /* a lighter week is information, not a red mark */

/* ============ history ============ */
.histrow{cursor:pointer;}
.histrow .hd{display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;}
.histrow .dt{font-weight:700; font-size:15px;}
.histrow .dt .tmm{color:var(--dim); font-weight:600; font-size:12px; font-variant-numeric:tabular-nums;}
.histrow .dn{color:var(--accent-soft); font-weight:600; font-size:14px;}
.histrow .sm{margin-left:auto; color:var(--dim); font-size:12px; flex:none; font-variant-numeric:tabular-nums;}
.histdetail{border-top:1px solid var(--line); margin-top:12px; padding-top:8px; font-size:14px;}
.histdetail .exl{display:flex; gap:8px; padding:5px 0; align-items:baseline;}
/* the label column keeps at least a third of the row: a long run of set tokens
   used to squeeze it to one word per line ("Mon / 14 / Sept / Upper / A") */
.histdetail .exl .n{color:var(--dim); flex:1 1 0; min-width:34%; overflow-wrap:break-word;}
.histdetail .exl .s{font-weight:600; text-align:right; flex:0 1 auto; min-width:0;
  font-variant-numeric:tabular-nums; line-height:1.5;}
.histdetail .exl .s .tok{white-space:nowrap;}
/* warm-ups stay in the log but step back: the work sets are what the eye looks for */
.histdetail .exl .s .tok.w{color:var(--ghost); font-weight:500;}
#chartbox svg{width:100%; height:auto; display:block;}

/* ============ settings ============ */
.setline{display:flex; align-items:center; gap:10px; min-height:50px;}
.setline .lb{flex:1; font-weight:500; font-size:15px;}
.seg{display:flex; background:var(--input); border:none; border-radius:9px; padding:2px;}
.seg button{min-width:54px; min-height:34px; background:none; border:none; color:var(--dim);
  font-size:13px; font-weight:600; padding:0 12px; border-radius:7px;}
.seg button.on{background:var(--card); color:var(--text); font-weight:700; box-shadow:0 1px 4px rgba(0,0,0,.15);}
/* plate calculator: toggle which plates the gym has */
.platechips{display:flex; flex-wrap:wrap; gap:8px;}
.platechip{min-width:52px; min-height:42px; border:none; border-radius:10px; background:var(--input);
  color:var(--ghost); font-size:15px; font-weight:700; padding:0 12px; font-variant-numeric:tabular-nums;
  box-shadow:inset 0 0 0 1.5px transparent;}
.platechip.on{background:var(--accent-bg); color:var(--accent-soft); box-shadow:inset 0 0 0 1.5px var(--accent-soft);}
.platechip:active{opacity:.6;}
.switch{width:51px; height:31px; border-radius:16px; background:var(--input); border:none; padding:0;
  position:relative; cursor:pointer; flex:none; transition:background .15s;}
.switch::after{content:''; position:absolute; top:2px; left:2px; width:27px; height:27px;
  border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:left .15s;}
.switch.on{background:var(--green);}
.switch.on::after{left:22px;}

/* ============ modal ============ */
#modal{position:fixed; inset:0; z-index:60; display:none; background:rgba(0,0,0,.45);
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);}
#modal.show{display:flex; align-items:flex-end; justify-content:center;}
#modal .sheet{width:100%; max-width:560px; max-height:88vh; max-height:88dvh; background:var(--bg);
  border-radius:22px 22px 0 0; padding:18px 16px calc(20px + env(safe-area-inset-bottom));
  overflow-y:auto; box-shadow:var(--shadow);}
#modal .sheet h3{font-family:var(--display); margin:0 2px 16px; font-size:22px; font-weight:750; letter-spacing:-.3px; display:flex; align-items:center;}
#modal .sheet h3 .x{margin-left:auto; flex:none; align-self:flex-start; background:var(--input); border:none;
  color:var(--dim); width:34px; height:34px; border-radius:50%; font-size:14px;}
.codebox{width:100%; background:var(--input); border:none; border-radius:12px;
  color:var(--text); font-size:16px; font-family:ui-monospace,Consolas,monospace; padding:12px;
  min-height:110px; word-break:break-all; resize:none;}
.codebox:focus{outline:none; box-shadow:0 0 0 2px var(--accent);}

/* ============ tab bar ============ */
/* a floating glass capsule over the content, the way iOS 26 draws its tab bars:
   inset from the edges, lifted above the home indicator, the active tab in a pill */
#tabbar{position:fixed; z-index:30; left:14px; right:14px; max-width:540px; margin:0 auto;
  bottom:max(10px, calc(env(safe-area-inset-bottom) - 10px));
  border-radius:30px; border:1px solid var(--edge); padding:5px;
  background:var(--tabbar-bg);
  background:color-mix(in srgb, var(--tabbar-bg) 74%, transparent);
  -webkit-backdrop-filter:blur(24px) saturate(1.7); backdrop-filter:blur(24px) saturate(1.7);
  box-shadow:var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);}
#tabbar .inner{display:flex;}
#tabbar button{flex:1; background:none; border:none; color:var(--dim); padding:7px 0;
  border-radius:24px; transition:background .2s, color .2s;
  font-size:10px; font-weight:600; display:flex; flex-direction:column; align-items:center; gap:3px;}
#tabbar button svg{width:23px; height:23px;}
#tabbar button.on{color:var(--accent-soft); background:var(--accent-bg);}
#tabbar button:active{opacity:.6;}
/* the hard-edged skins keep their corners */
:root[data-skin="batman"] #tabbar{border-radius:14px;} :root[data-skin="batman"] #tabbar button{border-radius:9px;}
:root[data-skin="monster"] #tabbar{border-radius:10px;} :root[data-skin="monster"] #tabbar button{border-radius:6px;}
/* Reduce Transparency: a solid bar */
@media (prefers-reduced-transparency: reduce){
  #tabbar{background:var(--card); -webkit-backdrop-filter:none; backdrop-filter:none;}
}

/* ============ quality floor ============ */
/* keyboard navigation: visible focus on controls (inputs already have their own rings) */
button:focus-visible, .chip:focus-visible, .switch:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px;}
/* respect reduced-motion preferences: keep state changes, drop the theatrics */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important;}
  html{scroll-behavior:auto;}
}

/* first card: the way back for a lifter moving from another phone, above the fold */
.obrestore{display:flex; align-items:center; gap:9px; width:100%; min-height:46px; margin:0 0 10px;
  background:var(--accent-bg); color:var(--accent-soft); border:none; border-radius:12px; padding:0 14px;
  font-size:14px; font-weight:700; text-align:left;}
.obrestore svg{width:17px; height:17px; flex:none;}
.obrestore span{flex:1;}
.obrestore .obr-go{flex:none; font-size:18px; line-height:1;}
.obrestore:active{opacity:.6;}
/* onboarding step dots */
.obdot{width:7px; height:7px; border-radius:50%; background:var(--input); display:inline-block;}
.obdot.on{background:var(--accent);}
/* onboarding demo: a real set row acting out the gesture on a loop */
.obdemo{background:var(--card); border:1px solid var(--edge); border-radius:12px;
  padding:8px 14px 12px; margin:0 0 16px; pointer-events:none;}
.obdemo .obin{min-height:42px; background:var(--input); border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--display); font-size:17px; font-weight:650; color:var(--ghost);
  font-variant-numeric:tabular-nums;}
/* the demo set number is a span, not a button - center it like the real one */
.obdemo .setnum{display:flex; align-items:center; justify-content:center;}
.obdemo .checkbtn{position:relative;}
/* the "finger": a soft dot that lands on the check button */
.obtap{position:absolute; inset:0; margin:auto; width:26px; height:26px; border-radius:50%;
  background:var(--text); opacity:0; animation:ob-tap 3.6s ease-in-out infinite;}
.ob1 .obchk{animation:ob-done 3.6s ease-in-out infinite;}
@keyframes ob-tap{
  0%,38%{opacity:0; transform:scale(.4);}
  46%{opacity:.35; transform:scale(1);}
  56%,100%{opacity:0; transform:scale(1.7);}}
@keyframes ob-done{
  0%,50%{background:var(--input); color:var(--dim);}
  57%,90%{background:var(--green); color:#fff;}
  100%{background:var(--input); color:var(--dim);}}
/* step 2: the new weight "types itself", then the check lands and goes green */
.ob2 .obtype{font-style:normal; color:var(--text); opacity:0; animation:ob-type 4.4s ease infinite;}
.ob2 .obtap{animation:ob-tap2 4.4s ease-in-out infinite;}
.ob2 .obchk2{animation:ob-done2 4.4s ease-in-out infinite;}
@keyframes ob-type{0%,10%{opacity:0;} 20%,100%{opacity:1;}}
@keyframes ob-tap2{
  0%,42%{opacity:0; transform:scale(.4);}
  50%{opacity:.35; transform:scale(1);}
  60%,100%{opacity:0; transform:scale(1.7);}}
@keyframes ob-done2{
  0%,54%{background:var(--input); color:var(--dim);}
  61%,92%{background:var(--green); color:#fff;}
  100%{background:var(--input); color:var(--dim);}}
.obbody{font-size:15px; line-height:1.6; color:var(--text); margin:0 2px 18px;}
/* welcome card: the wordmark, same sheen as the topbar title */
.obdemo.obw{display:flex; align-items:center; justify-content:center; padding:30px 14px;}
.obw .obwm{font-family:var(--display); font-size:30px; font-weight:800; letter-spacing:-.4px;
  background:linear-gradient(128deg, var(--text) 45%, var(--accent-soft) 92%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;}
/* swap step: tap the menu, the name crossfades to the alternative */
.obswap{position:relative; min-height:34px;}
.obswap span{position:absolute; left:0; top:50%; transform:translateY(-50%);
  white-space:nowrap; display:flex; align-items:center; gap:6px;}
.obswap svg{width:15px; height:15px; color:var(--accent-soft);}
.obswap .obn1{animation:ob-n1 5s ease infinite;}
.obswap .obn2{opacity:0; animation:ob-n2 5s ease infinite; color:var(--accent-soft);}
.obmenu{position:relative;}
.obtap.tap4{animation-name:ob-tap4; animation-duration:5s;}
@keyframes ob-tap4{
  0%,18%{opacity:0; transform:scale(.4);}
  26%{opacity:.35; transform:scale(1);}
  36%,100%{opacity:0; transform:scale(1.7);}}
@keyframes ob-n1{0%,32%{opacity:1;} 40%,92%{opacity:0;} 100%{opacity:1;}}
@keyframes ob-n2{0%,36%{opacity:0;} 44%,88%{opacity:1;} 96%,100%{opacity:0;}}
/* warmup step: tap W, the ramp rows unfold one after another - the card grows
   with them (no empty space reserved), exactly how the real screen behaves */
.obwbtn{position:relative;}
.obtap.tap5{animation-name:ob-tap4; animation-duration:5s;}
.obwr{overflow:hidden; max-height:0; opacity:0; margin-top:0; animation:ob-wrow 5s ease infinite;}
.obwr.r2{animation-name:ob-wrow2;}
.obwr.r3{animation-name:ob-wrow3;}
@keyframes ob-wrow {0%,30%{max-height:0; opacity:0; margin-top:0;} 38%,88%{max-height:46px; opacity:1; margin-top:8px;} 96%,100%{max-height:0; opacity:0; margin-top:0;}}
@keyframes ob-wrow2{0%,36%{max-height:0; opacity:0; margin-top:0;} 44%,88%{max-height:46px; opacity:1; margin-top:8px;} 96%,100%{max-height:0; opacity:0; margin-top:0;}}
@keyframes ob-wrow3{0%,42%{max-height:0; opacity:0; margin-top:0;} 50%,88%{max-height:46px; opacity:1; margin-top:8px;} 96%,100%{max-height:0; opacity:0; margin-top:0;}}
/* programs step: the tap lands on the star, it lights up and TODAY follows */
.ob6 .splitcard{pointer-events:none;}
.ob6 .obstar{position:relative; color:var(--ghost); animation:ob-star 5s ease infinite;}
.ob6 .obstar svg{animation:ob-starfill 5s ease infinite;}
.obtap.tap6{animation-name:ob-tap4; animation-duration:5s;}
.ob6 .obtoday{opacity:0; animation:ob-today 5s ease infinite;}
@keyframes ob-star{0%,34%{color:var(--ghost);} 42%,92%{color:var(--orange);} 100%{color:var(--ghost);}}
@keyframes ob-starfill{0%,34%{fill:transparent;} 42%,92%{fill:currentColor;} 100%{fill:transparent;}}
@keyframes ob-today{0%,44%{opacity:0;} 54%,92%{opacity:1;} 100%{opacity:0;}}
/* body-weight step: the tap lands on the third home tile, the dash becomes a weight */
.ob7 .stat{pointer-events:none;}
.ob7 .obbwtile{position:relative;}
.ob7 .obbwtile .v{position:relative;}
.ob7 .obbw1{animation:ob-n1 5s ease infinite;}
.ob7 .obbw2{position:absolute; left:0; opacity:0; /* left-aligned like every real tile value */
  animation:ob-n2 5s ease infinite; color:var(--accent-soft);}
.obtap.tap7{animation-name:ob-tap4; animation-duration:5s;}
/* step 3: the backup code line */
.obdemo.ob3{display:flex; align-items:center; gap:10px; padding:14px;}
.ob3 .obkey{display:flex; color:var(--accent-soft);}
.ob3 .obkey svg{width:18px; height:18px;}
.ob3 .obcode{font-family:ui-monospace,Consolas,monospace; font-size:13px; color:var(--dim);
  overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}

/* ============ toast ============ */
#toast{position:fixed; left:50%; transform:translateX(-50%) translateY(20px);
  bottom:calc(96px + env(safe-area-inset-bottom)); background:var(--card); color:var(--text);
  border:1px solid var(--edge); padding:12px 22px; border-radius:999px; font-weight:600; font-size:14px; opacity:0;
  pointer-events:none; transition:all .25s; z-index:70; white-space:nowrap; box-shadow:var(--shadow);
  max-width:calc(100vw - 32px); overflow:hidden; text-overflow:ellipsis;}
/* undo lives in its OWN element: an incidental toast must never wipe the only
   way back from a deletion, and it sits UNDER the modal so a sheet built on
   now-stale indices cannot be undone from behind it */
#undo{position:fixed; left:50%; transform:translateX(-50%) translateY(20px);
  bottom:calc(96px + env(safe-area-inset-bottom)); background:var(--card); color:var(--text);
  border:1px solid var(--edge); padding:12px 12px 12px 22px; border-radius:999px; font-weight:600;
  font-size:14px; opacity:0; pointer-events:none; transition:all .25s; z-index:55;
  white-space:nowrap; box-shadow:var(--shadow);
  display:flex; align-items:center; max-width:calc(100vw - 32px);}
#undo .um{min-width:0; overflow:hidden; text-overflow:ellipsis;}
#undo.over{z-index:65;} /* undo from a sheet that redraws itself (see undoToast) */
#undo.show{opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto;}
#undo button{background:var(--accent-bg); color:var(--accent-soft); border:none;
  border-radius:999px; min-height:32px; padding:0 14px; margin-left:12px; flex:none;
  font-weight:800; font-size:13px; cursor:pointer;}
#toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

/* ============ per-workout progress ============ */
/* one lift, measured inside a single workout: name, its shape over the last
   sessions, where it stands now and how far it moved since the first time */
.wprow{display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  background:var(--card); border:1px solid var(--edge); box-shadow:var(--card-shadow);
  border-radius:12px; padding:10px 12px; margin-bottom:8px; color:inherit; font:inherit; cursor:pointer;}
.wprow:active{opacity:.7;}
.wpn{flex:1; min-width:0; font-weight:700; font-size:14px; overflow-wrap:break-word;}
.wpoff{display:inline-block; font-style:normal; font-size:10px; font-weight:800; letter-spacing:.4px;
  text-transform:uppercase; color:var(--dim); background:var(--input);
  padding:1px 6px; border-radius:5px; margin-left:6px; vertical-align:1px;}
.wpsp{flex:none; display:flex; align-items:center; opacity:.85;}
.wpsp svg{width:80px; height:26px;}
.wpv{flex:none; text-align:right; font-family:var(--display); font-weight:800; font-size:14px;
  font-variant-numeric:tabular-nums; line-height:1.35; white-space:nowrap;}
.wptr{font-style:normal; font-size:11px; vertical-align:1px;}
.wptr.up{color:var(--green);} .wptr.down{color:var(--red);} .wptr.flat{color:var(--dim);}
.wpdlt{font-style:normal; font-size:12px; font-weight:700; color:var(--dim);}
.wpdlt.up{color:var(--green);} .wpdlt.down{color:var(--red);}
.wpnew{font-style:normal; font-size:11px; font-weight:700; color:var(--ghost);}
/* the session list: date, what it cost, what it moved */
.wplog{display:flex; align-items:baseline; gap:10px; padding:9px 12px; font-size:13px;
  border-bottom:1px solid var(--edge);}
.wplog:last-child{border-bottom:none;}
.wplog .d{flex:1; min-width:0; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.wplog .m{flex:none; color:var(--dim); font-size:12px;}
.wplog .v{flex:none; font-weight:800; font-variant-numeric:tabular-nums; min-width:64px; text-align:right;}

/* ============ programs side by side ============ */
.cmpwrap{padding:6px 4px; overflow-x:auto;}
.cmptbl{width:100%; border-collapse:collapse; font-size:13px; font-variant-numeric:tabular-nums;}
.cmptbl th{text-align:right; font-size:11px; font-weight:800; letter-spacing:.4px; text-transform:uppercase;
  color:var(--dim); padding:6px 8px; border-bottom:1px solid var(--edge);
  white-space:normal; min-width:5.5em; vertical-align:bottom;} /* long program names wrap, the numbers do not */
.cmptbl th:first-child{text-align:left;}
.cmptbl td{padding:8px; text-align:right; border-bottom:1px solid var(--edge); vertical-align:top; white-space:nowrap;}
.cmptbl td:first-child{text-align:left; color:var(--dim); font-weight:600; white-space:normal; min-width:6em;}
.cmptbl tr:last-child td{border-bottom:none;}
.cmptbl.lifts td b{font-weight:800; font-family:var(--display);}
.cmprate{font-style:normal; font-size:11px; font-weight:700; color:var(--dim);}
.cmprate.up{color:var(--green);} .cmprate.down{color:var(--red);}
.cmpna{color:var(--ghost);}

/* ---- max test: the card's attempt rows and the attempts log on an exercise screen ---- */
.maxchip{flex:none; background:var(--accent-bg); color:var(--accent-soft); border-radius:6px;
  font-size:9px; font-weight:800; letter-spacing:.5px; padding:2px 6px; vertical-align:1px;}
.maxinfo{font-size:13px; color:var(--dim); line-height:1.45; margin:6px 2px 0;}
.maxinfo b{color:var(--text); font-weight:800;}
.maxinfo .hint{display:block; color:var(--ghost); font-size:12px; margin-top:2px;}
.setnum.attnum{display:flex; align-items:center; justify-content:center; color:var(--accent-soft);}
.missbtn{width:100%; min-height:42px; border-radius:9px; border:none; padding:0;
  background:var(--input); color:var(--dim); font-size:15px; font-weight:800;}
.missbtn.on{background:var(--ghost); color:var(--bg);}
/* a miss is information, not failure: neutral row, never red */
.setrow-wrap.done.miss{background:none;}
.setrow-wrap.miss .setgrid input{text-decoration:line-through; color:var(--dim);}
.maxhd{display:flex; align-items:baseline; gap:8px; margin-bottom:4px;
  font-size:12px; font-weight:800; letter-spacing:.5px; text-transform:uppercase; color:var(--dim);}
.maxhd .maxtop{margin-left:auto; text-transform:none; letter-spacing:0; font-size:13px; font-weight:600;}
.maxhd .maxtop b{color:var(--text); font-weight:800; font-size:15px;}
.maxrow{display:flex; align-items:baseline; gap:10px; padding:8px 0; border-top:1px solid var(--line); font-size:14px;}
.maxhd + .maxrow{border-top:none;}
.maxrow .md{flex:none; color:var(--dim); font-size:13px;}
.maxrow .md .tmm{opacity:.7; margin-left:2px;}
.maxrow .ma{margin-left:auto; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:2px 12px;}
.matt{font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap;}
.matt.miss{color:var(--ghost); font-weight:600;}
.matt.best{color:var(--accent-soft); font-weight:800;}

/* ---- the app's own yes/no sheet (ask) ---- */
.askmsg{font-size:16px; font-weight:600; line-height:1.5; color:var(--text); margin:6px 4px 18px;}
