/* Phit stylesheet, part 6 of 8. The app shell: header, left navigation panel, the bottom bar on phones, and the narrow-screen rules.
   The parts are one stylesheet cut into files: they must load in this order (index.html and the plain pages list them), because a later rule can override an earlier one. */

/* ----- app shell: header on top, the left navigation panel, then the page ----- */
:root { --header-h: 0px; --stick: 0px; --nav-w: 204px; --nav-w-min: 60px; --bottom-nav-h: 0px; }
html { scroll-padding-top: var(--stick); }
.shell { display: flex; align-items: flex-start; }
.content { flex: 1 1 auto; min-width: 0; }
.sidenav { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: 0.75rem 0.5rem; background: var(--bg); border-right: 1px solid var(--border); }
.sidenav[hidden] { display: none; }
.nav-group { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-group[hidden] { display: none; }
.nav-item, .fold-btn {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; min-height: 42px; padding: 0 0.85rem;
  border-radius: var(--r-md); background: transparent; color: var(--muted); font-size: var(--fs-base); font-weight: 600; text-align: left; white-space: nowrap;
}
.nav-item:hover, .fold-btn:hover { color: var(--text); background: rgb(var(--ink-rgb) / 0.06); }
.nav-item:focus-visible, .fold-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-item.active { color: var(--accent-ink); background: rgb(var(--accent-rgb) / 0.14); }
.nav-item[hidden], .fold-btn[hidden] { display: none; }
.nav-ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-dot { fill: var(--good); stroke: none; }
.nav-reset:hover { color: var(--warn); }
a.nav-item { text-decoration: none; }

@media (min-width: 800px) {
  :root { --stick: var(--header-h); }
  body > header { position: sticky; top: 0; z-index: 30; background: var(--bg); }
  .sidenav {
    position: sticky; top: var(--header-h); flex: none; width: var(--nav-w);
    height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    overflow-y: auto; overflow-x: hidden; transition: width 0.16s ease;
  }
  body.nav-collapsed .sidenav { width: var(--nav-w-min); }
  body.nav-collapsed .nav-item { justify-content: center; padding: 0; }
  body.nav-collapsed .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .nav-toggle .nav-ico { transition: transform 0.16s ease; }
  body.nav-collapsed .nav-toggle .nav-ico { transform: rotate(180deg); }
}

/* phones: the panel becomes a bottom bar (icon over label), always as wide as the screen */
@media (max-width: 799.98px) {
  :root { --bottom-nav-h: calc(58px + env(safe-area-inset-bottom)); }
  body.has-nav { padding-bottom: var(--bottom-nav-h); }
  .sidenav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; flex-direction: row; gap: 0;
    padding: 0.2rem 0.25rem env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--border);
  }
  .sidenav .nav-group { flex-direction: row; gap: 0.1rem; }
  #nav-main { flex: 3 1 0; }
  .nav-foot { flex: 1 1 0; }
  .nav-item { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 0.12rem; min-height: 52px; padding: 0.2rem 0; font-size: var(--fs-xs); text-align: center; }
  .nav-toggle { display: none; }
}

/* ----- narrow screens ----- */
@media (max-width: 700px) {
  header { flex-wrap: wrap; row-gap: 0.5rem; }
  .header-right { flex-wrap: wrap; justify-content: flex-end; }
  .experience { order: 3; flex: 1 1 100%; display: flex; margin: 0; }
  .experience .seg { flex: 1 1 auto; padding: 0.1rem 0.4rem; white-space: nowrap; }
}
@media (max-width: 640px) {
  .records-table thead { display: none; }
  .records-table, .records-table tbody, .records-table tr, .records-table td { display: block; }
  .records-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.75rem; padding: 0.65rem 0.1rem; border-bottom: 1px solid var(--border); }
  .records-table td { padding: 0; border: 0; }
  .records-table td:nth-child(2) { text-align: right; }
  .records-table td:nth-child(4) { text-align: right; }
  .records-table td:nth-child(5), .records-table td:nth-child(6) { grid-column: 1 / -1; }
}


