#nav { gap: 2px; overflow-y: auto; max-height: calc(100vh - 80px); position: sticky; top: 0; }
#nav .nav-section { display: flex; flex-direction: column; gap: 2px; }
#nav .nav-top { padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line, #e7e9f0); }
#nav .nav-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#nav button[data-page] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
#nav button[data-page]:hover { background: #f4f2ff; color: var(--accent, #5b45e0); }
#nav .nav-group summary { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; list-style: none;
  color: #2b3245; font-weight: 600; user-select: none; }
#nav .nav-group summary::-webkit-details-marker { display: none; }
#nav .nav-group summary:hover { background: #f6f7fb; }
#nav .nav-group summary:focus-visible { outline: 2px solid var(--accent, #5b45e0); outline-offset: 1px; }
#nav .nav-group.nav-group-active > summary { color: var(--accent, #5b45e0); }
#nav .nav-chevron { margin-left: auto; width: 14px; height: 14px; flex-basis: 14px; transition: transform .15s ease; opacity: .6; }
#nav .nav-group[open] > summary .nav-chevron { transform: rotate(90deg); }
#nav .nav-items { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px 14px; margin-left: 9px; border-left: 1px solid var(--line, #e7e9f0); }
#nav .nav-items button[data-page] { font-size: .95em; padding: 7px 10px; }
#nav .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
#nav .nav-mobile-toggle { display: none; }
@media (max-width: 760px) {
  #nav { flex-direction: column !important; flex-wrap: nowrap !important; max-height: none; position: static; }
  #nav .nav-mobile-toggle { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-start; font-weight: 600; }
  #nav:not(.nav-open) .nav-section, #nav:not(.nav-open) > label { display: none; }
}
@media print { #nav { display: none; } }
.signup-tabs{display:flex;gap:6px;margin:6px 0 12px}.signup-tabs button{flex:1;border-radius:10px}.signup-tabs button.active{background:#eeebff;color:var(--accent,#5b45e0);border-color:#e2dcff}
#signupUsernameStep{display:flex;flex-direction:column;gap:6px}#signupUsernameStep[hidden]{display:none}
.perm-table th{font-size:.8em;white-space:normal;min-width:70px}.perm-table td{white-space:nowrap}
/* fit: labels wrap instead of overflowing, buttons never wider than the column */
@media (min-width: 761px) { #app { grid-template-columns: 264px minmax(0, 1fr); } }
#nav, #nav * { box-sizing: border-box; }
#nav button[data-page], #nav .nav-group summary { width: 100%; max-width: 100%; min-width: 0; align-items: flex-start; }
#nav .nav-icon { margin-top: 1px; }
#nav .nav-label { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; hyphens: auto; line-height: 1.3; flex: 1 1 auto; min-width: 0; }
#nav .nav-chevron { margin-top: 3px; }
#nav .nav-items { padding-left: 8px; margin-left: 8px; }
#nav { flex-wrap: nowrap !important; overflow-x: hidden; }
#nav > * { flex-shrink: 0; }
/* layout: content never pushes the page sideways; the menu stays in place */
#app { overflow-x: clip; }
#app > main { min-width: 0; max-width: 100%; }
#view .panel { max-width: 100%; overflow-x: auto; }
#view .fields { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
#view .grid { grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr)); }
#view input, #view select, #view textarea { max-width: 100%; min-width: 0; }
@media (min-width: 761px) {
  nav#nav { position: sticky; top: 0; align-self: start; height: 100vh; max-height: 100vh; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
/* the menu keeps the same width on every page (POS used to narrow it) */
@media (min-width: 761px) { body:has(.pos-shell) #app, #app { grid-template-columns: 264px minmax(0, 1fr); } }
/* day summary: equal, aligned tiles */
#view .day-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
#view .day-stats .stat { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 120px; }
#view .day-stats .stat > span { min-height: 2.6em; line-height: 1.3; }
#view .day-stats .stat strong { margin-top: auto; white-space: nowrap; }
@media (max-width: 1100px) { #view .day-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { #view .day-stats { grid-template-columns: minmax(0, 1fr); } }
