/* reps-app.css — REPS Coach as its own app (Nov 17 2026).
 * Loaded last by workouts.html. Phone layout (≤820px): a compact app header, a fixed
 * 5-tab bar (Send · Today · Clients · Programs · More) with the rest in a "More" sheet,
 * and the wide tables turned into tap-friendly cards. On coachwithreps.com
 * (html.reps-host) the sign-in screen is REPS-branded and YardIntel links go away for
 * trainers. Remove the <link> to turn all of it off. */

/* ---------- pieces reps-app.js adds (hidden on desktop) ---------- */
.rpHead,.rpMore,.rpSheet,.rpScrim{display:none}
.rpInstall{display:none}

/* desktop: the YardIntel link only for owners/managers once reps-app.js knows the role */
html.reps-host .rpYiLink{display:none !important}
html.reps-host.rp-staff .rpYiLink{display:inline-flex !important}

/* ---------- phone ---------- */
@media (max-width:820px){
  html,body{overscroll-behavior-y:none}
  body{-webkit-tap-highlight-color:transparent}

  /* header: logo + page title + one primary action */
  .topbar{gap:10px;padding:10px 14px;min-height:56px;background:rgba(12,13,17,.92);
    -webkit-backdrop-filter:saturate(1.4) blur(12px);backdrop-filter:saturate(1.4) blur(12px)}
  .topbar .search,.topbar .iconbtn,html .topbar .rpYiLink,html.reps-host.rp-staff .topbar .rpYiLink{display:none !important}
  .topbar>div[style*="flex:1"]{display:none}
  .rpHead{display:flex;align-items:center;gap:10px;flex:1;min-width:0}
  .rpHead .rpLogo{width:32px;height:32px;border-radius:9px;flex:none;display:block}
  .rpHead .rpT{min-width:0}
  .rpHead .rpT b{display:block;font-size:16px;font-weight:800;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .rpHead .rpT small{display:block;font-size:11px;color:var(--faint);font-weight:600;letter-spacing:.04em}
  .topbar .rpAssign{flex:none;width:40px;height:40px;padding:0;border-radius:12px;font-size:0;display:grid;place-items:center}
  .topbar .rpAssign::before{content:"+";font-size:24px;font-weight:700;line-height:1}
  html.rp-standalone .topbar{padding-top:calc(10px + env(safe-area-inset-top))}

  /* page titles: the header already says where you are */
  .content{padding:14px 14px 18px}
  h1.page{font-size:22px}

  /* tab bar: five fixed tabs, no sideways scrolling */
  .side{overflow:hidden !important;justify-content:stretch;padding:4px 4px calc(4px + env(safe-area-inset-bottom)) !important;
    background:rgba(17,19,26,.96);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
  .side .nav{width:100% !important;display:grid !important;grid-template-columns:repeat(5,1fr);gap:0 !important}
  .side .nav button{min-width:0 !important;width:100%;padding:7px 2px 6px !important;border-radius:12px;font-size:10.5px !important;position:relative}
  .side .nav button span:not(.ico):not(.badge){overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .side .nav button.rpOverflow{display:none !important}
  .side .nav .badge{display:none}
  .side .nav .rpMore{display:flex}
  .side .nav button.on .ico{transform:translateY(-1px)}
  .main{padding-bottom:calc(76px + env(safe-area-inset-bottom)) !important}

  /* "More" sheet */
  .rpScrim{position:fixed;inset:0;z-index:900;background:rgba(5,5,8,.55);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
  .rpSheet{position:fixed;left:0;right:0;bottom:0;z-index:901;background:var(--card,#181b24);border-top:1px solid var(--line2,#2a2f3d);
    border-radius:22px 22px 0 0;padding:8px 14px calc(16px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(0,0,0,.5);
    transform:translateY(105%);transition:transform .24s cubic-bezier(.2,.8,.2,1)}
  body.rp-sheet-open .rpScrim{display:block}
  body.rp-sheet-open .rpSheet{display:block;transform:none}
  .rpSheet.rpReady{display:block}
  .rpGrab{width:40px;height:5px;border-radius:5px;background:var(--line2,#2a2f3d);margin:4px auto 12px}
  .rpWho{display:flex;align-items:center;gap:12px;padding:6px 4px 14px;border-bottom:1px solid var(--line,#232733);margin-bottom:8px}
  .rpWho .av{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-weight:800;background:var(--brandSoft,rgba(255,106,26,.15));color:var(--brand,#ff6a1a)}
  .rpWho b{display:block;font-size:15px}
  .rpWho small{color:var(--faint);font-size:12px}
  .rpList{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .rpList button,.rpList a{display:flex;align-items:center;gap:10px;padding:14px 12px;border-radius:14px;background:var(--card2,#1f2330);
    border:1px solid var(--line,#232733);color:var(--text,#e9e9f0);font:inherit;font-size:14px;font-weight:650;text-align:left;text-decoration:none;cursor:pointer;min-height:52px}
  .rpList .ico{width:22px;text-align:center;font-size:17px;color:var(--brand,#ff6a1a)}
  .rpList .on{border-color:var(--brand,#ff6a1a)}
  .rpList .rpWide{grid-column:1/-1}
  .rpList .rpOut{color:#ff8a80}

  /* clients + programs tables become cards */
  .card:has(> .tbl){background:transparent;border:0;box-shadow:none;padding:0 !important}
  .tbl thead{display:none}
  .tbl,.tbl tbody{display:block;width:100%}
  .tbl tr{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 10px;padding:12px 14px;margin:0 0 8px;
    background:var(--card,#181b24);border:1px solid var(--line,#232733);border-radius:14px}
  .tbl tr:active{background:var(--card2,#1f2330)}
  .tbl td{display:block;border:0;padding:0;font-size:13px;min-width:0}
  .tbl td[colspan]{grid-column:1/-1}
  #clientsBody tr,#programsBody tr{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
  #clientsBody td:first-child{flex:1 0 100%}
  #clientsBody td:first-child b{font-size:15px}
  #clientsBody td:not(:first-child){white-space:nowrap;color:var(--muted);font-size:12.5px}
  #clientsBody td.mt:last-child:not(:first-child){margin-left:auto}
  #clientsBody td select{max-width:100%;font-size:14px}
  #programsBody td:first-child{flex:1 1 60%;font-weight:700;font-size:15px}
  #programsBody td:last-child{flex:none;order:2}
  #programsBody td:nth-child(2),#programsBody td:nth-child(3),#programsBody td:nth-child(4){order:3;color:var(--muted);font-size:12.5px}

  /* friendlier tap targets in lists and forms */
  .btn{min-height:42px}
  .daytabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:2px}
  .daytabs::-webkit-scrollbar{display:none}
  .daytab{flex:none}
  .modal{max-height:calc(100dvh - 24px);overflow:auto}
  .scrim{padding:12px}

  /* the old iOS hint sits above the tab bar; the new install card replaces it */
  #a2hs{display:none !important}
  .rpInstall{position:fixed;left:12px;right:12px;bottom:calc(80px + env(safe-area-inset-bottom));z-index:80;display:none;align-items:center;gap:12px;
    padding:12px 12px 12px 14px;border-radius:16px;background:var(--card2,#1f2330);border:1px solid var(--line2,#2a2f3d);box-shadow:0 14px 40px rgba(0,0,0,.5);font-size:13px}
  .rpInstall.show{display:flex}
  .rpInstall img{width:40px;height:40px;border-radius:10px;flex:none}
  .rpInstall b{display:block;font-size:14px}
  .rpInstall span{color:var(--muted)}
  .rpInstall .rpGo{margin-left:auto;flex:none;background:var(--brand,#ff6a1a);color:#fff;border:0;border-radius:10px;padding:9px 14px;font:inherit;font-weight:800}
  .rpInstall .rpX{flex:none;background:none;border:0;color:var(--faint);font-size:22px;line-height:1;padding:0 2px}
}

/* ---------- REPS sign-in on coachwithreps.com (orange instead of the YardIntel yellow) ---------- */
html.reps-host.yi-gate .yi-gate-stage{
  background:radial-gradient(900px 420px at 50% -10%, rgba(255,106,26,.24), rgba(255,106,26,0) 60%),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0/100% 56px,
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px) 0 0/56px 100%, #0c0d11}
html.reps-host.yi-gate .yi-gate-mark{border-radius:16px;filter:drop-shadow(0 10px 30px rgba(255,106,26,.3))}
html.reps-host.yi-gate .yi-gate-brand small,html.reps-host.yi-gate .yi-gate-foot b{color:#ff8c42}
html.reps-host.yi-gate .yi-gate-stripe{background:#ff6a1a}
html.reps-host.yi-gate #login::before{background:linear-gradient(90deg,#ff6a1a,#ffb37a 50%,#ff6a1a)}
html.reps-host.yi-gate #login input:focus{border-color:#ff6a1a !important;box-shadow:0 0 0 3px rgba(255,106,26,.22) !important}
html.reps-host.yi-gate #login button,html.reps-host.yi-gate #login .btn{background:#ff6a1a !important;color:#fff !important;box-shadow:0 10px 26px rgba(255,106,26,.28) !important}
html.reps-host.yi-gate #login button:hover{background:#ff7d38 !important}
html.reps-host.yi-gate #login a{color:#ff8c42 !important}
html.reps-host.yi-gate #login .logo{display:none}

/* sign-in (both addresses): the gate already draws the card, so the page's own wrapper goes flat */
html.yi-gate #login.login-screen{min-height:0 !important;display:block !important;padding:0 !important;background:transparent !important;border:0 !important;box-shadow:none !important;width:min(420px,100%) !important}
html.yi-gate #login.login-screen::before{display:none}
html.yi-gate #login .login-card{width:100% !important;position:relative;overflow:hidden;background:#141416;border:1px solid rgba(255,255,255,.08);border-radius:22px;padding:26px 24px 22px;box-shadow:0 30px 80px rgba(0,0,0,.6)}
html.yi-gate #login .login-card::before{content:"";position:absolute;left:0;right:0;top:0;height:4px;background:linear-gradient(90deg,#F4C430,#ffe27a 50%,#F4C430)}
html.reps-host.yi-gate #login .login-card::before{background:linear-gradient(90deg,#ff6a1a,#ffb37a 50%,#ff6a1a)}
html.reps-host.yi-gate #login .login-card h1{font-size:20px !important}
