  @font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/barlow-condensed-500.woff2) format("woff2"); }
  @font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-600.woff2) format("woff2"); }
  @font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-700.woff2) format("woff2"); }
  @font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/barlow-condensed-800.woff2) format("woff2"); }
  :root {
    --bg: #0b0c0f;
    --card: #17191f;
    --card2: #20232b;
    --line: #2b2f39;
    --txt: #f3f4f6;
    --mut: #8d93a1;
    --acc: #c6f432;
    --on-acc: #0b0c0f;
    --disp: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { margin: 0; height: 100%; background: #000; color: var(--txt);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
  button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
  button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

  #app { position: relative; height: 100vh; height: 100dvh; max-width: 460px; margin: 0 auto;
    overflow: hidden; background: var(--bg); }

  /* ---------- HUD (topo fixo) ---------- */
  #hud { position: absolute; inset: 0 0 auto 0; z-index: 5; padding: calc(10px + env(safe-area-inset-top)) 14px 18px;
    background: linear-gradient(#0b0c0fee 55%, #0b0c0f00); pointer-events: none; }
  #segs { display: flex; gap: 4px; }
  #segs i { flex: 1; height: 3px; border-radius: 2px; background: #ffffff26; transition: background .25s; }
  #segs i.done { background: color-mix(in srgb, var(--acc) 55%, transparent); }
  #segs i.on { background: var(--txt); }
  #hud .row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; pointer-events: auto; }
  #hudDay { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--mut); }
  #hudDay b { font-family: var(--disp); font-size: 18px; font-weight: 700; letter-spacing: .04em; color: var(--on-acc);
    background: var(--acc); padding: 1px 8px; border-radius: 6px; }
  #hudDay span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #clock { font-family: var(--disp); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums;
    display: flex; align-items: center; gap: 6px; }
  #clock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
  #clock.run::before { background: #ff4d4d; animation: pulse 1.4s infinite; }
  @keyframes pulse { 50% { opacity: .25; } }

  /* ---------- Feed ---------- */
  #feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
  #feed::-webkit-scrollbar { display: none; }
  .slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
    padding: 84px 16px calc(22px + env(safe-area-inset-bottom)); }
  .slide::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(120% 55% at 85% 0%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 70%); }
  .slide > * { position: relative; }
  .ghost { position: absolute; top: 56px; right: -6px; font-family: var(--disp); font-weight: 800; font-size: 250px;
    line-height: 1; color: transparent; -webkit-text-stroke: 1.5px #ffffff14; pointer-events: none; user-select: none; }

  .tag { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--acc); text-transform: uppercase; }
  h1, h2 { font-family: var(--disp); font-weight: 700; margin: 0; line-height: .95; text-transform: uppercase; text-wrap: balance; }
  h2 { font-size: 46px; margin-top: 6px; }
  .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
  .meta span { font-size: 13px; color: var(--mut); background: #ffffff10; border-radius: 999px; padding: 5px 11px; }
  .meta b { color: var(--txt); font-weight: 600; }

  .top { display: flex; align-items: flex-end; gap: 10px; }
  .cap { flex: 1; min-width: 0; }
  .rail { display: flex; flex-direction: column; gap: 14px; align-items: center; }
  .rail button { display: grid; justify-items: center; gap: 3px; font-size: 10px; color: var(--mut); }
  .rail svg { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: #ffffff14; color: var(--txt); }
  .rail button.has svg { background: var(--acc); color: var(--on-acc); }

  /* séries */
  .prep { display: flex; gap: 6px; flex-wrap: wrap; }
  .prep button { font-size: 12px; padding: 7px 12px; border-radius: 999px; border: 1px dashed var(--line); color: var(--mut); }
  .prep button.done { border-style: solid; border-color: transparent; background: #ffffff1c; color: var(--txt); }
  .prep button.done::before { content: "✓ "; color: var(--acc); }

  .sets { display: grid; gap: 8px; }
  .cols, .set { display: grid; grid-template-columns: 30px 1fr 1fr 52px; gap: 8px; align-items: center; }
  .cols { font-size: 10px; letter-spacing: .12em; color: var(--mut); text-align: center; margin-bottom: -2px; }
  .set .sl { font-family: var(--disp); font-size: 22px; font-weight: 700; color: var(--mut); }
  .num { display: flex; align-items: center; height: 52px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .num button { width: 34px; height: 100%; font-size: 22px; color: var(--mut); flex: none; }
  .num button:active { background: var(--card2); color: var(--txt); }
  .num input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; background: none; color: var(--txt); text-align: center;
    font-family: var(--disp); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; }
  .num input::placeholder { color: #ffffff30; }
  .ok { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: var(--mut);
    transition: transform .15s, background .15s; }
  .ok svg { width: 24px; height: 24px; }
  .ok:active { transform: scale(.9); }
  .set.done .ok { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
  .set.done .num { border-color: color-mix(in srgb, var(--acc) 45%, transparent); background: color-mix(in srgb, var(--acc) 9%, var(--card)); }
  .set.done .sl { color: var(--acc); }
  .last { font-size: 12px; color: var(--mut); min-height: 16px; }
  .last b { color: var(--txt); font-weight: 500; }

  /* intro */
  .days { display: flex; gap: 6px; }
  .days button { flex: 1; padding: 9px 0; border-radius: 10px; background: #ffffff10; font-family: var(--disp); font-size: 17px;
    font-weight: 600; letter-spacing: .05em; color: var(--mut); }
  .days button.on { background: var(--acc); color: var(--on-acc); }
  .intro h1 { font-size: 132px; letter-spacing: -.01em; }
  .intro .focus { font-family: var(--disp); font-size: 28px; font-weight: 600; text-transform: uppercase; line-height: 1; margin-top: 2px; }
  .list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #ffffff10; font-size: 15px; }
  .list li i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center;
    font-style: normal; font-size: 11px; color: var(--on-acc); }
  .list li.done i { background: var(--acc); border-color: var(--acc); }
  .list li.done i::before { content: "✓"; }
  .list li small { margin-left: auto; color: var(--mut); font-size: 12px; white-space: nowrap; }
  .cta { height: 56px; border-radius: 16px; background: var(--acc); color: var(--on-acc); font-family: var(--disp); font-size: 24px;
    font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .cta:active { transform: scale(.98); }
  .cta.ghosty { background: #ffffff14; color: var(--txt); }
  .hint { text-align: center; font-size: 12px; color: var(--mut); animation: bob 1.6s ease-in-out infinite; }
  @keyframes bob { 50% { transform: translateY(-5px); } }
  .link { font-size: 13px; color: var(--mut); text-decoration: underline; text-underline-offset: 3px; align-self: center; padding: 6px; }

  /* cardio + resumo */
  .big { font-family: var(--disp); font-weight: 700; font-size: 112px; line-height: .9; font-variant-numeric: tabular-nums; }
  .bar { height: 6px; border-radius: 3px; background: #ffffff18; overflow: hidden; }
  .bar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .4s linear; }
  .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
  .stats b { display: block; font-family: var(--disp); font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
  .stats span { font-size: 12px; color: var(--mut); }

  /* ---------- Descanso (overlay) ---------- */
  #rest { position: absolute; inset: 0; z-index: 10; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
    background: #0b0c0ff2; backdrop-filter: blur(10px); padding: 24px; text-align: center; }
  #rest.show { display: flex; }
  #rest .tag { color: var(--mut); }
  .ring { position: relative; width: min(74vw, 300px); aspect-ratio: 1; }
  .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
  .ring circle { fill: none; stroke-width: 8; }
  .ring .bg { stroke: #ffffff14; }
  .ring .fg { stroke: var(--txt); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
  #rest.min .fg, #rest.end .fg { stroke: var(--acc); }
  .ring .t { position: absolute; inset: 0; display: grid; place-content: center; }
  .ring .t b { font-family: var(--disp); font-size: 104px; font-weight: 700; line-height: .9; font-variant-numeric: tabular-nums; }
  .ring .t span { font-size: 13px; color: var(--mut); margin-top: 6px; }
  #rest.min .t span, #rest.end .t span { color: var(--acc); }
  #restNext { font-size: 14px; color: var(--mut); min-height: 20px; }
  #restNext b { color: var(--txt); font-weight: 600; }
  .rbtns { display: flex; gap: 10px; }
  .rbtns button { height: 52px; padding: 0 20px; border-radius: 999px; background: #ffffff14; font-family: var(--disp); font-size: 20px; font-weight: 600; }
  .rbtns .skip { background: var(--acc); color: var(--on-acc); padding: 0 30px; }

  /* ---------- Sheet ---------- */
  #sheet { position: absolute; inset: 0; z-index: 12; display: none; align-items: flex-end; background: #000a; }
  #sheet.show { display: flex; }
  #sheet .box { width: 100%; max-height: 80%; overflow: auto; background: var(--card); border-radius: 22px 22px 0 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
  @keyframes up { from { transform: translateY(30px); opacity: 0; } }
  #sheet h3 { font-family: var(--disp); font-size: 26px; text-transform: uppercase; margin: 0 0 12px; }
  #sheet ul { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 14px; line-height: 1.45; color: #d5d8df; }
  #sheet textarea { width: 100%; min-height: 110px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; color: var(--txt);
    font: inherit; padding: 12px; resize: none; }
  #sheet .cta { width: 100%; margin-top: 14px; }

  @media (max-height: 640px) {
    h2 { font-size: 38px; } .ghost { font-size: 190px; } .intro h1 { font-size: 96px; } .big { font-size: 88px; }
    .num, .ok { height: 46px; } .ok { width: 46px; } .cols, .set { grid-template-columns: 30px 1fr 1fr 46px; }
  }
  @media (prefers-reduced-motion: reduce) { * { animation: none !important; } #feed { scroll-behavior: auto; } }

  /* ================= v2: sync, botões da capa ================= */
  #hud .right { display: flex; align-items: center; gap: 10px; }
  #sync { font-size: 11px; color: #ff8a8a; }
  .intro .list { overflow: auto; min-height: 0; flex-shrink: 1; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .two button { height: 44px; border-radius: 12px; background: #ffffff10; font-size: 14px; color: var(--txt);
    display: flex; align-items: center; justify-content: center; gap: 8px; }
  .two svg { width: 18px; height: 18px; color: var(--acc); }
  .prep button b { color: var(--txt); font-weight: 600; }

  /* popup de carga (aquecimento / preparatória) */
  .kgbig { display: flex; align-items: center; height: 76px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
  .kgbig button { width: 68px; height: 100%; font-size: 30px; color: var(--mut); flex: none; }
  .kgbig button:active { background: var(--card2); color: var(--txt); }
  .kgbig input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--txt); text-align: center; outline: none;
    font-family: var(--disp); font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .kgbig input::placeholder { color: #ffffff30; }
  .quick { display: flex; gap: 6px; margin-top: 8px; }
  .quick button { flex: 1; height: 36px; border-radius: 10px; background: #ffffff10; font-size: 13px; color: var(--mut); }
  #sheet p { font-size: 13px; color: var(--mut); margin: 0 0 12px; line-height: 1.45; }
  #sheet p b { color: var(--txt); font-weight: 500; }
  #sheet .err { color: #ff8a8a; }

  /* opções */
  .opts { display: grid; gap: 2px; margin: 0 -6px; }
  .opts > * { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 6px; font-size: 15px; color: var(--txt);
    text-decoration: none; border-bottom: 1px solid #ffffff10; text-align: left; width: 100%; cursor: pointer; }
  .opts small { color: var(--mut); font-size: 12px; }
  .opts .danger { color: #ff8a8a; }
  .opts h4 { margin: 14px 0 0; padding: 0 6px 4px; border: 0; font-size: 11px; letter-spacing: .12em; color: var(--mut); text-transform: uppercase; font-weight: 700; cursor: default; }
  .pv { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 0; }
  #sheet .pv { padding: 0; gap: 0; }
  .pv li { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid #ffffff10; font-size: 14px; }
  .pv li b { font-family: var(--disp); font-size: 18px; min-width: 44px; color: var(--acc); }
  .pv li small { margin-left: auto; color: var(--mut); white-space: nowrap; }

  /* ================= senha ================= */
  #lock { position: absolute; inset: 0; z-index: 30; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    background: var(--bg); padding: 24px; text-align: center; }
  #lock.show { display: flex; }
  #lock h3 { font-family: var(--disp); font-size: 34px; text-transform: uppercase; margin: 0; line-height: 1; }
  #lockDots { display: flex; gap: 14px; height: 18px; align-items: center; }
  #lockDots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); transition: all .12s; }
  #lockDots i.on { background: var(--acc); border-color: var(--acc); transform: scale(1.15); }
  #lockDots.shake { animation: shake .35s; }
  @keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
  #lockMsg { min-height: 18px; font-size: 13px; color: #ff8a8a; }
  #pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; margin-top: 6px; }
  #pad button { height: 76px; border-radius: 50%; background: #ffffff10; font-family: var(--disp); font-size: 34px; font-weight: 600; }
  #pad button:active { background: var(--acc); color: var(--on-acc); }
  #pad .txt { background: none; font-family: inherit; font-size: 14px; font-weight: 400; color: var(--mut); }
  #pad .txt[data-k=b] { font-size: 24px; }
  #lock.busy #pad { opacity: .35; pointer-events: none; }

  /* ================= relatório ================= */
  #page { position: absolute; inset: 0; z-index: 11; display: none; flex-direction: column; background: var(--bg); }
  #page.show { display: flex; }
  .phead { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 16px 10px; }
  .phead h3 { font-family: var(--disp); font-size: 34px; text-transform: uppercase; margin: 0; }
  .phead button { width: 40px; height: 40px; border-radius: 50%; background: #ffffff14; font-size: 16px; }
  #pageBody { flex: 1; overflow: auto; padding: 4px 16px calc(28px + env(safe-area-inset-bottom)); display: grid; gap: 14px; align-content: start; }
  #pageBody h4 { margin: 10px 0 -4px; font-size: 11px; letter-spacing: .14em; color: var(--mut); text-transform: uppercase; }
  #pageBody select { width: 100%; height: 48px; border-radius: 12px; background: var(--card); color: var(--txt); border: 1px solid var(--line);
    padding: 0 12px; font: inherit; font-size: 15px; }
  .chart { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px 8px; }
  .chart .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 4px 6px; }
  .chart .hd b { font-family: var(--disp); font-size: 34px; line-height: 1; }
  .chart .hd span { display: block; font-size: 12px; color: var(--mut); margin-bottom: 4px; }
  .chart .hd em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--acc); white-space: nowrap; }
  .chart .hd em.down { color: #ff8a8a; }
  .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
  .chart text { fill: var(--mut); font-size: 10px; font-family: system-ui, sans-serif; }
  .chart .v { fill: var(--txt); font-size: 11px; font-weight: 600; }
  .tbl { display: grid; }
  .tbl > div { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #ffffff10; font-size: 14px; align-items: baseline; }
  .tbl .d { color: var(--mut); font-size: 12px; font-variant-numeric: tabular-nums; }
  .tbl small { display: block; color: var(--mut); font-size: 12px; margin-top: 2px; }
  .tbl .r { color: var(--mut); font-size: 12px; text-align: right; white-space: nowrap; }
  .empty { text-align: center; color: var(--mut); font-size: 14px; padding: 40px 20px; line-height: 1.5; }

  /* ================= v3: servidor (APK) e sincronização ================= */
  #srv { display: none; width: 100%; max-width: 320px; gap: 12px; }
  #lock.srv #srv { display: grid; }
  #lock.srv #lockDots, #lock.srv #pad { display: none; }
  #srv input { height: 52px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--txt); padding: 0 14px; font: inherit; font-size: 15px; }
  #lock h3 { text-wrap: balance; }
  #sync { color: var(--mut); }
  #sync.err { color: #ff8a8a; }
  .note { font-size: 12px; color: var(--mut); text-align: center; margin: -4px 0 0; }
  #retry { display: none; width: 100%; max-width: 320px; }
  #lock.fail #retry { display: block; }
  #lock.fail #lockDots, #lock.fail #pad { display: none; }
