/* ===== Bottom nav ===== */
.bottom-nav{
  /* Centered with margins, not a transform: on iPhone a transformed fixed bar can drift with the page bounce. */
  position:fixed;z-index:50;bottom:0;left:0;right:0;margin:0 auto;
  width:min(720px,100%);display:grid;grid-template-columns:repeat(6,1fr);
  background:rgba(18,20,23,.96);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  border-top:1px solid var(--line);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom))
}
.nav{border:0;background:none;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;padding:2px}
.nav svg{width:24px;height:24px}
.nav small{font-size:12px;font-weight:700}
.nav.active{color:var(--lime)}
.nav-main .nav-plus{width:48px;height:36px;border-radius:14px;background:var(--surface3);display:grid;place-items:center}
.nav-main.active .nav-plus{background:var(--lime);color:var(--lime-ink)}

/* ===== Sheets ===== */
.overlay{display:none;position:fixed;z-index:100;inset:0;background:rgba(0,0,0,.6);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);padding:0;align-items:flex-end;justify-content:center}
.overlay.show{display:flex;animation:fade .15s ease}
/* Small forms and info sheets open from inside the admin center, so they stack above it. */
/* Small dialogs always open above the big sheets (planner, food picker, weekly board, exercise library: 115). */
#genericSheet,#infoSheet,#menuSheet{z-index:130}#confirmDialog{z-index:140}
@keyframes fade{from{opacity:0}to{opacity:1}}
.sheet{width:min(680px,100%);max-height:92vh;max-height:92dvh;overflow:auto;overscroll-behavior:contain;background:var(--surface);border-radius:24px 24px 0 0;padding:8px 18px calc(18px + env(safe-area-inset-bottom));animation:up .2s ease}
.sheet:before{content:"";display:block;width:40px;height:5px;border-radius:3px;background:var(--line2);margin:0 auto 10px}
@keyframes up{from{transform:translateY(24px)}to{transform:none}}
.tall-sheet{max-height:95vh;max-height:95dvh}
.sheet-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.sheet-head h2{margin:0;font-size:21px;font-weight:800}
.sheet-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
#genericFields{display:grid;gap:12px}
.calc-preview{background:var(--surface2);border-radius:12px;color:var(--text2);padding:12px;margin:14px 0;font-size:14px;line-height:1.7}
.calc-preview b{color:var(--text)}
.routine-edit-row{background:var(--surface2);border-radius:14px;padding:12px;margin-bottom:10px}
.routine-edit-head{display:flex;justify-content:space-between;gap:8px;margin-bottom:10px}
.routine-edit-head small{display:block;color:var(--text2);font-size:13px}
.routine-edit-controls{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.routine-edit-controls label{font-size:12px}
.routine-edit-controls input{padding:8px;text-align:center}
.move-tools{display:flex;gap:6px}
.move-tools button{width:38px;height:38px;border:0;border-radius:10px;background:var(--surface3);color:var(--text);font-size:16px}

/* Action menu + confirm dialog */
.menu-list{display:grid;gap:6px}
.menu-item{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:10px 14px;border:0;border-radius:14px;background:var(--surface2);color:var(--text);font-size:16px;font-weight:650;text-align:right}
.menu-item .mi{width:30px;text-align:center;font-size:19px}
.menu-item.danger{color:var(--red)}
.confirm-box{width:min(420px,calc(100% - 32px));background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:20px;margin:auto;animation:pop .15s ease}
@keyframes pop{from{transform:scale(.96);opacity:0}to{transform:none;opacity:1}}
#confirmDialog{align-items:center}
.confirm-box h3{margin:0 0 8px;font-size:19px}
.confirm-box p{margin:0;color:var(--text2);line-height:1.55;font-size:15px;white-space:pre-line}
.confirm-box .sheet-actions{margin-top:18px}
.confirm-box .primary.danger{background:var(--red);color:#1a0505}

/* The routine editor also opens from the coach's client sheet, so it must sit above it; the exercise picker sits above the editor. */
#routineEditor{z-index:105}#exercisePicker{z-index:110}
