/* Net-Latch nav bar, Option B (picked 2026-11-22). Drop-in: templates/_nav.html + this file; everything below the nav
   stays in app.css. 0.2.9: black bar + black menus in light AND dark mode (same pills, spacing, active states).
   Option B "Navy bar": deep navy bar (the app's dark-theme colour) instead of pure black, a filled red
   "Invite user" pill, outlined Menu pill, and a wider two-part menu card (account on top, Admin pages in a grid). */
header.top{background:linear-gradient(180deg,#14213a,#0d1729);color:#fff;height:64px;padding:0 24px;display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:60;box-shadow:0 1px 0 #ffffff14,0 6px 18px #0b14264d}
header.top .brand{display:flex;align-items:center;gap:16px;min-width:0;flex:1 1 auto}
header.top .logo .wm{height:42px;width:auto;display:block}
header.top .logo .mk{height:32px;width:auto}
header.top .ptitle{font-size:18px;margin:0;font-weight:700;padding:4px 14px;border-radius:999px;background:#ffffff12;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff}
.hgrp{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}
.hbtn{display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 16px;border:1px solid #ffffff40;border-radius:999px;color:#fff;background:#ffffff0a;text-decoration:none;font-weight:600;font-size:14px;white-space:nowrap;cursor:pointer;font-family:inherit}
.hbtn:hover,details.menu[open]>summary.hbtn{background:#fff;color:#0d1729;border-color:#fff}
.hbtn.opt{background:#22c55e;border-color:#22c55e;color:#052e16}.hbtn.opt:hover{background:#4ade80;color:#052e16;border-color:#4ade80}
.th-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:999px;border:1px solid #ffffff40;background:#ffffff0a;color:#fff;cursor:pointer;flex:none;padding:0;min-height:0}
.th-btn:hover{background:#ffffff26}.th-btn svg{width:20px;height:20px}
.menu-list{position:absolute;right:0;top:calc(100% + 10px);margin:0;padding:8px;background:#fff;color:#14213a;border:1px solid #d6dbe4;border-radius:14px;box-shadow:0 18px 40px #0b142640;min-width:300px;z-index:70}
html[data-theme=dark] .menu-list{background:#15213a;color:#e6ecf5;border-color:#2a3956}
.menu-list a{display:block;padding:10px 12px;border-radius:8px;color:inherit;text-decoration:none;font-weight:600;font-size:14px}
.menu-list a:hover{background:#eef2f8}html[data-theme=dark] .menu-list a:hover{background:#1f2d4a}
.menu-list a.on{background:#14213a;color:#fff}html[data-theme=dark] .menu-list a.on{background:#e6ecf5;color:#14213a}
.menu-list .mi-adm{display:grid;grid-template-columns:1fr 1fr;gap:2px;margin:6px 0;padding:8px 0;border-top:1px solid #e3e7ee;border-bottom:1px solid #e3e7ee}
html[data-theme=dark] .menu-list .mi-adm{border-color:#2a3956}
.menu-list .mi-adm .adm-h{display:block;grid-column:1/-1;padding:2px 12px 4px;color:#6b778c;font-size:11px;text-transform:uppercase;letter-spacing:.08em}
.menu-list .sep{display:none}
.menu-list .who{padding:8px 12px;color:#6b778c;font-size:12px;line-height:1.35}
.menu-list .who b{color:inherit;font-weight:700}
html[data-theme=dark] .menu-list .who b{color:#fff}
.menu-list button{color:#e5e7eb;padding:10px 12px;border-radius:8px;font-weight:600;font-size:14px}
html[data-theme=dark] .menu-list button{color:#e5e7eb}
.menu-list button:hover{background:#1c1c1c;color:#fff}
@media(max-width:720px){
 header.top{padding:0 10px 0 14px;height:58px}
 header.top .ptitle{font-size:15px;padding:3px 12px}
 header.top.is-user .site-hdr{color:#fff;padding:3px 10px;border-radius:999px;background:#ffffff12;flex:1 1 0}
 header.top .brand{gap:10px}.hgrp{gap:6px}
 .hbtn{padding:0 12px}
 .menu-list{position:fixed;left:8px;right:8px;top:64px;min-width:0}
 .menu-list .who{font-size:13px;padding:10px 12px;border-bottom:1px solid #e3e7ee;margin-bottom:4px}
 html[data-theme=dark] .menu-list .who{border-color:#2a3956}
 .menu-list .who-l{color:#6b778c;font-size:11px;text-transform:uppercase;letter-spacing:.06em}
 .menu-list .who b{font-size:16px;margin:2px 0}
 .menu-list a,.menu-list button{padding:12px}
}
details.menu{position:relative;margin:0}
details.menu>summary::-webkit-details-marker{display:none}
details.menu>summary{list-style:none}
.menu-list{display:flex;flex-direction:column}
.menu-list form{margin:0}
.menu-list .who-l{display:none}.menu-list .adm-h{display:none}
.menu-list .who{order:5;display:flex;flex-direction:column}
.menu-list .mi-home{order:1}.menu-list .mi-adm{order:2}.menu-list .mi-sec{order:3}.menu-list .sep{order:4}.menu-list .mi-out{order:6}
.menu-list button{display:block;width:100%;text-align:left;background:none;border:0;border-radius:0;min-height:0;justify-content:flex-start;font-family:inherit}
.site-hdr{display:none}
header.top .logo{display:block;line-height:0;flex:none}
header.top .logo .mk{display:none}
@media(max-width:720px){
 header.top .logo .wm{display:none}header.top .logo .mk{display:block}
 header.top.is-user .ptitle{display:none}
 header.top.is-user .site-hdr{display:block;flex:1 1 0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700;font-size:16px;line-height:1.2}
 .hbtn.opt{display:none}
 .menu-list{min-width:0;max-height:calc(100vh - 90px);overflow-y:auto}
 .menu-list .who{order:1}.menu-list .who-l{display:block}
 .menu-list .mi-home{order:2}.menu-list .mi-sec{order:3}.menu-list .mi-out{order:4}
 .menu-list .sep{order:5}.menu-list .mi-adm{order:6}.menu-list:not(.has-adm) .sep{display:none}
 .menu-list .adm-h{display:block}
}

/* ---- 0.2.9: black header bar + black menus in BOTH light and dark mode (Dennis, 2026-11-22); Option B pills,
   spacing and active states. html:root matches the specificity of the html[data-theme=dark] rules above, and this
   block comes last, so it wins in both themes. Page content below the nav still follows the theme. ---- */
html:root header.top{background:#000;box-shadow:0 1px 0 #ffffff1f,0 4px 14px #0000004d}
html:root header.top .ptitle,html:root header.top.is-user .site-hdr{background:#ffffff1a}
html:root .hbtn,html:root .th-btn{border-color:#ffffff59;background:#ffffff0f}
html:root .hbtn:hover,html:root details.menu[open]>summary.hbtn{background:#fff;color:#000;border-color:#fff}
/* 0.3.1: Invite pill / active item / chosen theme = bright logo green, near-black label (6.54:1); Sign out neutral, not red */
html:root .hbtn.opt{background:#22c55e;border-color:#22c55e;color:#052e16}
html:root .hbtn.opt:hover{background:#4ade80;border-color:#4ade80;color:#052e16}
html:root .th-btn:hover{background:#ffffff2b}
html:root .menu-list{background:#000;color:#f2f2f2;border-color:#333;box-shadow:0 18px 40px #000c}
html:root .menu-list a:hover{background:#1c1c1c}
html:root .menu-list a.on{background:#22c55e;color:#052e16}
html:root .menu-list a.on:hover{background:#4ade80}
html:root .menu-list .mi-adm,html:root .menu-list .who{border-color:#2e2e2e}
html:root .menu-list .who,html:root .menu-list .mi-adm .adm-h,html:root .menu-list .who-l{color:#a3a3a3}
html:root .menu-list .who b{color:#fff}
html:root .menu-list button{color:#e5e7eb}
html:root .menu-list button:hover{background:#1c1c1c;color:#fff}
/* ---- 0.3.0: theme choice in the ☰ Menu (Auto / Light / Dark); the sun/moon header button is gone ---- */
.menu-list .th-row{padding:10px 12px 12px;border-top:1px solid #2e2e2e;margin-top:4px}
.menu-list .th-h{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#a3a3a3;margin-bottom:7px}
.menu-list .th-seg{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid #ffffff33;border-radius:10px;overflow:hidden}
html:root .menu-list .th-seg button{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 4px;min-height:36px;border:0;border-radius:0;
  background:transparent;color:#dfe5ee;font-size:13px;font-weight:600;width:auto}
html:root .menu-list .th-seg button+button{border-left:1px solid #ffffff33}
html:root .menu-list .th-seg button:hover{background:#1c1c1c}
html:root .menu-list .th-seg button[aria-checked=true]{background:#22c55e;color:#052e16}
.menu-list .th-seg svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.menu-list .th-seg svg .fill{fill:currentColor}
.menu-list .th-note{display:block;margin-top:6px;color:#a3a3a3;font-size:11px}
.menu-list .th-row{order:3}   /* right after Security, desktop and phone */

/* ---- 0.3.2: "My controls" is the green header button on computers (Invite user removed); hidden on My controls
   itself (template) and on phones (the Menu has it). ---- */
html:root .hbtn.ctrl{background:#22c55e;border-color:#22c55e;color:#052e16}
html:root .hbtn.ctrl:hover{background:#4ade80;border-color:#4ade80;color:#052e16}
@media(max-width:720px){
 .hbtn.ctrl{display:none}
}
/* ---- 0.3.2: phone menu in the SAME order as the computer menu: My controls, Admin, Security, Theme, name/role,
   Sign out (it used to put "Signed in as" first and Admin after Sign out). ---- */
@media(max-width:720px){
 .menu-list .mi-home{order:1}.menu-list .mi-ff{order:2}.menu-list .mi-vp{order:2}.menu-list .mi-adm{order:2}.menu-list .mi-sec{order:3}.menu-list .th-row{order:3}
 .menu-list .sep{order:4;display:none}.menu-list .who{order:5}.menu-list .mi-out{order:6}
 .menu-list .who-l{display:none}
 html:root .menu-list .who{border-bottom:0;border-top:1px solid #2e2e2e;margin:4px 0 0}
 .menu-list .who b{font-size:15px}
}

/* ---- 0.3.7: Help + About right after Security, before Theme (same order on computers and phones) ---- */
.menu-list .mi-help,.menu-list .mi-about{order:3}
html:root .menu-list .mi-about{font-size:14px}

/* ---- 0.3.8: Friends & Family after My controls, before Security ---- */
.menu-list .mi-ff{order:2}
/* ---- 0.3.9: Vendor passes immediately after Friends & Family ---- */
.menu-list .mi-vp{order:2}

/* ---- 0.3.14: the Menu fits the window on computers and phones. It is capped to the visible height
   (dvh, with a vh fallback), scrolls inside itself without scrolling the page, keeps clear of the iPhone
   home indicator (safe-area), and Sign out stays pinned at the bottom so it is always reachable. ui.js
   scrolls the list back to the top each time it opens. ---- */
.menu-list{max-height:calc(100vh - 84px - env(safe-area-inset-bottom));max-height:calc(100dvh - 84px - env(safe-area-inset-bottom));
  overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:0}
.menu-list .mi-out{position:sticky;bottom:0;background:inherit;z-index:1;padding-bottom:calc(8px + env(safe-area-inset-bottom));border-top:1px solid #2e2e2e}
@media (max-width:720px){
 .menu-list{top:calc(64px + env(safe-area-inset-top));
   max-height:calc(100vh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
   max-height:calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
}
