/* ============================================================
   phone-bar.css — the phone's bottom bar and the three views of home
   (phone-bar.js; docs/rounds/home-nav-phone-bar-2026-11-26.md)

   The bar is on (body.has-phone-bar) whenever somebody is signed in and the computer sidebar is not. --pbar-h is its height
   while it shows and 0 while it is hidden (a screen with its own fixed bottom bar, or a field with focus), so everything that
   sits above it ("bottom: var(--pbar-h)") falls back to where it always was.
   The task-list fold (.home-fold, app.js foldHomeList) is here too: it applies on the computer as well.
   ============================================================ */
:root { --pbar-h: 0px; }
body.has-phone-bar { --pbar-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
/* a screen with its own fixed bottom action bar: one bar, not two. Same for a field with focus (the keyboard is up). */
body.has-phone-bar.pb-typing,
body.has-phone-bar:has(.step-nav, .logm-foot, .logp-actions.dirty) { --pbar-h: 0px; }
body.has-phone-bar.pb-typing #phoneBar,
body.has-phone-bar:has(.step-nav, .logm-foot, .logp-actions.dirty) #phoneBar { display: none; }

.pb { display: none; }
body.has-phone-bar .pb {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: stretch; justify-content: space-between;
  height: var(--pbar-h); padding: 0 4px env(safe-area-inset-bottom, 0px);
  background: var(--white); border-top: 1px solid var(--gray-2); box-shadow: 0 -2px 10px rgba(26, 26, 26, .08);
}
body.has-phone-bar .pb[hidden] { display: none; }
body.has-phone-bar #app { padding-bottom: var(--pbar-h); }

.pb-item {
  flex: 1 1 0; min-width: 48px; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; border-radius: var(--radius-sm); color: var(--gray-7);
  font-size: 12.5px; font-weight: 700; line-height: 1.1; position: relative;
}
.pb-item[hidden] { display: none; }
.pb-item:active { background: var(--gray-1); }
.pb-item.on { color: var(--blue); }
.pb-ico { position: relative; display: flex; }
.pb-item .ic { width: 28px; height: 28px; }
.pb-count {
  position: absolute; left: 100%; top: -4px; margin-left: 2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 13px; font-weight: 800; line-height: 20px; text-align: center;
}
.pb-count[hidden] { display: none; }
/* the camera: larger and raised above the bar */
.pb-cam { justify-content: flex-start; }
.pb-cam .pb-camb {
  margin-top: -14px; width: 56px; height: 56px; border-radius: 16px;   /* 56 - 14 + the label = the bar's 64px; at 64px the label ran off the bottom edge */ background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 87, 184, .45);
}
.pb-cam .pb-camb .ic { width: 32px; height: 32px; }
.pb-cam:active { background: none; }
.pb-cam:active .pb-camb { background: var(--blue-dark); transform: scale(.96); }

/* the header is the logo and the job chip; the camera and the menu are the bar's */
body.has-phone-bar .cam-btn, body.has-phone-bar .app-header .menu-btn { display: none !important; }
/* More: today's menu panel, just above the bar and nearly full width */
body.has-phone-bar .menu-panel {
  position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(var(--pbar-h) + 8px); min-width: 0;
  max-height: calc(100vh - var(--pbar-h) - 24px); overflow-y: auto;
}

/* what sits at the bottom of the screen stays above the bar */
body.has-phone-bar .toast { bottom: calc(var(--pbar-h) + 96px); }
body.has-phone-bar .update-bar { bottom: var(--pbar-h); }
body.has-phone-bar .gd-runbar { bottom: calc(var(--pbar-h) + 16px); }
body.has-phone-bar .tb-rd-foot,
body.has-phone-bar .df-plan:not(.df-wide) .df-stepnav { bottom: var(--pbar-h); }

/* ---- Home, Tools, Tasks: three views of one home screen (app.js screenHome puts home-view-* on it) ---- */
.home-tasks-calm { display: none; margin: 18px 2px; font-size: 17px; font-weight: 600; color: var(--gray-5); }
body.has-phone-bar .home-view-tools .home-tasks { display: none; }
body.has-phone-bar .home-view-tasks .home-tools { display: none; }
/* only once the nudges have had time to answer (home-settled, app.js): the lists start empty on every draw */
body.has-phone-bar .home-view-tasks .home-layout.tasks-empty.home-settled .home-tasks-calm { display: block; }
/* Home: the two task lists are numbers only, one row that opens the Tasks view (app.js homeTaskSum) */
.home-tasks-sum { display: none; }
body.has-phone-bar .home-view-home .home-tasks { display: none; }
body.has-phone-bar .home-view-home .home-tasks-sum:not([hidden]) {
  display: flex; align-items: center; gap: 18px; width: 100%; min-height: 56px; margin: 0 0 var(--s4); padding: 8px 12px 8px 16px;
  background: var(--gold-tint); border: 1px solid #EAD79A; border-left: 5px solid var(--gold, #FFB81C); border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; color: var(--ink); text-align: left;
}
.home-tasks-sum-n b { font-size: 22px; font-weight: 800; margin-right: 4px; }
.home-tasks-sum-n[hidden] { display: none; }
.home-tasks-sum-go { margin-left: auto; display: flex; color: var(--gray-5); }
.home-tasks-sum-go .ic { width: 22px; height: 22px; }
.home-tasks-sum:active { filter: brightness(.97); }
/* Home: Favorites only; with no favorites yet (the hint is showing) every group, as before */
body.has-phone-bar .home-view-home .home-group-wrap:not([data-group="Favorites"]) { display: none; }
body.has-phone-bar .home-view-home .home-tools:has(.home-fav-hint) .home-group-wrap:not([data-group="Favorites"]) { display: block; }

/* ---- Task lists folded past 3 rows (app.js foldHomeList) ---- */
.home-fold:not(.home-fold-open) > :nth-child(n+4):not(#obsProjMore) { display: none; }
.home-fold-btn {
  display: block; width: 100%; min-height: 48px; margin: 0 0 var(--s4); padding: 0 var(--s3);
  background: none; border: 1.5px solid var(--gray-3); border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700; color: var(--blue);
}
.home-fold-btn:active { background: var(--gray-1); }
.tasks-collapsed .home-fold-btn { display: none; }   /* the panel is shut: its lists are hidden (styles.css), so is their button */
