/* Panora Life — one top and one bottom for every part (js/partnav.js; Craig,
   2026-10-15, option C: design/headers-c.html). The theme's own tokens carry it,
   so Grove, Sunrise, Glacier and dark all come for free. */

.parthead{ padding:14px 18px 4px; background:var(--canvas); }
.parthead[hidden]{ display:none; }
.parthead .ph-row{ display:flex; align-items:center; gap:12px; }
.parthead .ph-chip{ width:38px; height:38px; border-radius:12px; display:grid; place-items:center; flex:none; }
.parthead .ph-chip svg{ width:22px; height:22px; fill:none; stroke:var(--wheel-ink, #1f3a2c); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.parthead .ph-name{ margin:0; flex:1; min-width:0; font:800 28px/1.15 var(--font-ui, system-ui); letter-spacing:-.02em; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.parthead .ph-act{ width:44px; height:44px; border:0; border-radius:12px; background:transparent; display:grid; place-items:center; cursor:pointer; color:var(--ink-muted); }
.parthead .ph-act:active{ background:var(--surface-quiet, rgba(0,0,0,.05)); }
.parthead .ph-act:focus-visible, .parthead .ph-arw:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.parthead .ph-act svg{ width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
/* The one status line: the day on the left, this part's key number on the right. */
.parthead .ph-status{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin:2px 0 6px 50px; min-height:28px;
  font:500 14px/1.3 var(--font-ui, system-ui); color:var(--ink-muted); }
.parthead .ph-left{ display:flex; align-items:center; gap:2px; min-width:0; }
.parthead .ph-left > span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Larger text wraps rather than cutting off the date or the status. */
html[data-text-size] .parthead .ph-left > span, html[data-text-size] .parthead .ph-right{ white-space:normal; }
.parthead .ph-right{ color:var(--ink); font-weight:700; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
/* Narrow phones: the status may take two lines rather than be cut off ("Nenhuma ref..."). */
@media (max-width: 359px){ .parthead .ph-left{ flex:none; } .parthead .ph-left > span{ overflow:visible; } .parthead .ph-right{ white-space:normal; font-size:14px; line-height:1.2; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; } }
/* Three lines, not two: "Nenhuma refeição ainda" dropped its last word at 320 px (deep check
   2026-10-24). */
.parthead .ph-arw{ border:0; background:none; color:var(--accent-text, var(--accent)); font:800 20px/1 var(--font-ui, system-ui); width:30px; height:30px; border-radius:8px; cursor:pointer; }
.parthead .ph-arw:first-child{ margin-left:-8px; }
.parthead .ph-arw[disabled]{ opacity:.25; cursor:default; }

/* The bar along the bottom, in thumb reach. */
.partbar{ position:fixed; left:0; right:0; bottom:0; z-index:44; display:flex; justify-content:space-around;
  padding:7px 6px calc(7px + env(safe-area-inset-bottom, 0px)); background:var(--surface); border-top:1px solid var(--edge);
  box-shadow:0 -8px 24px -18px rgba(0,0,0,.25); }
.partbar[hidden]{ display:none; }
.partbar .pb-item{ flex:1; max-width:120px; display:flex; flex-direction:column; align-items:center; gap:3px; min-height:50px; padding:4px 2px;
  border:0; background:none; border-radius:12px; color:var(--ink-muted); font:600 11.5px var(--font-ui, system-ui); cursor:pointer; -webkit-tap-highlight-color:transparent; }
.partbar .pb-item svg{ width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.partbar .pb-item.on{ color:var(--accent-text, var(--accent)); }
.partbar .pb-item:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
html.has-partbar{ --tabbar-h: 66px; }

/* What the header and bar replace, hidden while they show. The old pieces stay in
   the page (their parts still drive them), just out of sight. */
html.has-partnav .subnav{ display:none !important; }
html.has-partnav #sleep-home > .topbar, html.has-partnav #sleep-trends > .topbar, html.has-partnav #sleep-guide > .topbar,
html.has-partnav #still-home > .topbar, html.has-partnav #still-library > .topbar, html.has-partnav #still-history > .topbar,
html.has-partnav #unplug-home > .topbar, html.has-partnav #unplug-setup > .topbar{ display:none !important; }
html.has-partnav .dom-sleep.tabbed{ padding-top:4px !important; }
html.has-partnav #food-home .tabbar{ display:none !important; }
html.has-partnav #screen-today .page-head, html.has-partnav #screen-foods .page-head, html.has-partnav #screen-trends .page-head{ display:none !important; }
html.has-partnav #focus-home .brand{ display:none !important; }

/* The framed parts fit between the header and the bar. */
html.has-partnav #exercise-frame, html.has-partnav #know-frame{
  height:calc(calc(100vh / var(--tz, 1)) - var(--appbar-total) - var(--parthead-h, 96px) - var(--tabbar-h, 0px) - env(safe-area-inset-bottom, 0px));
  height:calc(calc(100dvh / var(--tz, 1)) - var(--appbar-total) - var(--parthead-h, 96px) - var(--tabbar-h, 0px) - env(safe-area-inset-bottom, 0px)); }

/* Food scrolls inside its own column: it ends where the bar begins, so nothing hides behind it. */
html.has-partnav .dom-food #app{
  height:calc(calc(100vh / var(--tz, 1)) - var(--appbar-total) - var(--parthead-h, 96px) - var(--tabbar-h, 0px) - env(safe-area-inset-bottom, 0px));
  height:calc(calc(100dvh / var(--tz, 1)) - var(--appbar-total) - var(--parthead-h, 96px) - var(--tabbar-h, 0px) - env(safe-area-inset-bottom, 0px)); }

/* Extra large and Huge (decision 0085): the name and the day get their own room. */
html[data-text-size='1.6'] .parthead .ph-name, html[data-text-size='2'] .parthead .ph-name{ white-space:normal; overflow:visible; font-size:24px; }
html[data-text-size='1.6'] .parthead .ph-status, html[data-text-size='2'] .parthead .ph-status{ flex-wrap:wrap; margin-left:0; }
html[data-text-size='1.6'] .parthead .ph-left, html[data-text-size='2'] .parthead .ph-left{ flex:1 1 100%; }
html[data-text-size='1.6'] .parthead .ph-left > span, html[data-text-size='2'] .parthead .ph-left > span{ flex:1; overflow:visible; }
html[data-text-size='1.6'] .parthead .ph-right, html[data-text-size='2'] .parthead .ph-right{ flex:1 1 100%; text-align:left; overflow:visible; }
html[data-text-size='1.6'] .partbar .pb-item, html[data-text-size='2'] .partbar .pb-item{ min-width:0; overflow:hidden; font-size:10px; }
html[data-text-size='1.6'] .parthead .ph-row, html[data-text-size='2'] .parthead .ph-row{ flex-wrap:wrap; }
/* (The sweep, 2026-11-02: min-width:max-content pushed the buttons onto their own row; the name now shrinks to fit.) */
html[data-text-size='2'] .partbar .pb-item{ font-size:9px; }
