/* THE TOP BAR — the same bar the sourcing app and the client portal wear
   (owner, 2026-11-24: "navigation should be equivalent"). The measurements
   are theirs (the portal's app.css: .topbar, .find-btn, .bell-btn, .me-menu,
   .bell-pop, .find-overlay, .tabbar), written with the hub's own tokens from
   hub.css, so the accent follows the hub's colour and nothing here names one.

   Left to right: the mark, the sections as pills, then Search, the bell and
   your photo. Under it, the open section's own tabs. On a phone the sections
   move to a tab bar at the bottom. */

.topbar { position:sticky; top:0; z-index:30; display:flex; align-items:center;
          gap:16px; padding:12px 24px; background:var(--card);
          border-bottom:1px solid var(--paper-200); }
.topbar .wordmark { flex:none; }
.topbar .spacer { flex:1; }
.topbar nav { display:flex; gap:16px; margin-left:24px; min-width:0; }
/* The sourcing app's measures (its app.css), so the two bars line up by eye. */
.topbar nav a { color:var(--ink-600);
                font-weight:500; font-size:13px; padding:6px 10px;
                border-radius:999px; text-decoration:none; white-space:nowrap; }
.topbar nav a:hover, .topbar nav a.on { color:var(--ink-900);
                                         background:var(--paper-100); }
.topbar nav a:focus-visible, .subbar a:focus-visible, .tabbar a:focus-visible,
.find-btn:focus-visible, .bell-btn:focus-visible,
.me-menu > summary:focus-visible { outline:none;
                                   box-shadow:0 0 0 3px var(--tint), 0 0 0 1px var(--accent); }
/* Counts in the bar wear the accent, like the bell's, so the number beside
   Today and the number on the bell read as the same kind of thing. */
.topbar nav .pip, .nav-unread { background:var(--accent); color:#fff; }
.nav-unread { display:inline-flex; align-items:center; justify-content:center;
              min-width:18px; height:18px; padding:0 5px; border-radius:999px;
              font-size:11px; font-weight:700; font-variant-numeric:tabular-nums; }
.nav-unread[hidden] { display:none; }

/* The open section's own pages: a quiet second row. */
.subbar { display:flex; gap:4px; padding:7px 20px; background:var(--paper-50);
          border-bottom:1px solid var(--paper-200); overflow-x:auto;
          scrollbar-width:none; }
.subbar::-webkit-scrollbar { display:none; }
.subbar a { color:var(--ink-600); text-decoration:none; font-size:.84rem;
            padding:5px 12px; border-radius:999px; white-space:nowrap; }
.subbar a:hover { color:var(--ink-900); background:var(--paper-200); }
.subbar a.on { color:var(--brand-700); background:var(--tint); font-weight:600; }

/* Search: a pill with its shortcut on wide screens, an icon on small ones. */
.find-btn { flex:none; display:inline-flex; align-items:center; gap:8px;
            min-width:180px; margin:0; padding:6px 8px 6px 12px;
            border:1.5px solid var(--ink-900); border-radius:999px;
            background:var(--card); color:var(--ink-900);
            font-family:var(--font-sans); font-weight:600; font-size:.9rem;
            line-height:1.4; cursor:pointer; text-align:left; }
.find-btn-word { flex:1; }
.find-kbd { font:inherit; font-size:11px; line-height:1; padding:4px 7px;
            border-radius:6px; background:var(--paper-100); color:var(--ink-600); }
.find-btn:hover { background:var(--ink-900); color:var(--card); }
.find-btn:hover .find-kbd { background:rgba(255,255,255,.18); color:var(--card); }

/* The bell and your photo: two 40px round targets. */
.bell-btn { position:relative; flex:none; display:inline-flex; align-items:center;
            justify-content:center; width:40px; height:40px; border-radius:999px;
            color:var(--ink-700); text-decoration:none; }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { background:var(--paper-100);
                                                   color:var(--ink-900); }
.bell-btn .nav-unread { position:absolute; top:-2px; left:22px; }
.me-menu { position:relative; flex:none; }
.me-menu > summary { position:relative; list-style:none; cursor:pointer; display:flex;
                     align-items:center; justify-content:center; width:40px;
                     height:40px; border-radius:999px; }
.me-menu > summary::-webkit-details-marker { display:none; }
.me-menu img { width:34px; height:34px; border-radius:50%; object-fit:cover;
               display:block; }
.me-initial { width:34px; height:34px; border-radius:50%; background:var(--ink-900);
              color:var(--card); display:inline-flex; align-items:center;
              justify-content:center; font-family:var(--font-display);
              font-weight:600; font-size:14px; flex:none; }
.me-menu > summary:hover img, .me-menu[open] > summary img,
.me-menu > summary:hover .me-initial, .me-menu[open] > summary .me-initial {
  box-shadow:0 0 0 2px var(--card), 0 0 0 4px var(--ink-900); }
/* Something unread in What's new: a dot on your photo, and one beside the
   entry itself once the menu is open. */
.me-dot { position:absolute; top:3px; right:3px; width:10px; height:10px;
          border-radius:50%; background:var(--accent);
          box-shadow:0 0 0 2px var(--card); }
.me-pop { position:absolute; right:0; top:calc(100% + 10px); width:260px;
          padding:8px; background:var(--card); border-radius:16px;
          box-shadow:0 18px 50px rgba(12,10,24,.18); z-index:60; }
.me-head { display:flex; align-items:center; gap:10px; padding:10px;
           margin-bottom:4px; background:var(--paper-50); border-radius:12px; }
.me-head b { font-size:.92rem; color:var(--ink-900); min-width:0;
             overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.me-pop > a { display:block; padding:10px 12px; border-radius:10px;
              font-size:.92rem; font-weight:500; color:var(--ink-700);
              text-decoration:none; }
.me-pop > a:hover, .me-pop > a:focus-visible { background:var(--paper-100);
                                               color:var(--ink-900); outline:none; }
.me-pop .wn-dot { display:inline-block; width:8px; height:8px; margin-left:8px;
                  border-radius:50%; background:var(--accent); vertical-align:1px; }

/* The bell's panel. */
.bell-pop { position:fixed; top:66px; right:72px; width:420px;
            max-width:calc(100vw - 32px); max-height:calc(100vh - 96px);
            display:flex; flex-direction:column; background:var(--card);
            border-radius:18px; box-shadow:0 18px 50px rgba(12,10,24,.18);
            z-index:80; overflow:hidden; }
.bell-pop[hidden] { display:none; }
.bell-head { display:flex; align-items:center; justify-content:space-between;
             padding:16px 18px 6px; }
.bell-head h2 { margin:0; font-size:20px; }
.bell-all { font-size:13px; font-weight:600; color:var(--accent);
            text-decoration:none; }
.bell-all:hover { text-decoration:underline; }
.bell-body { overflow-y:auto; padding:0 8px 10px; }
.bell-grp h3 { display:flex; justify-content:space-between; margin:0;
               padding:12px 10px 2px; font-family:var(--font-sans);
               font-size:13px; font-weight:600; color:var(--ink-600);
               text-transform:none; letter-spacing:0; }
.bell-waiting h3 { color:var(--danger); }
.bell-n { color:var(--ink-900); font-variant-numeric:tabular-nums; }
.bell-row { display:flex; align-items:flex-start; gap:10px; padding:8px 10px;
            border-radius:10px; font-size:14px; line-height:1.35;
            color:var(--ink-900); text-decoration:none; }
a.bell-row[href]:hover, a.bell-row[href]:focus-visible { background:var(--paper-100);
                                                         outline:none; }
.bell-e { flex:none; width:22px; text-align:center; }
.bell-t { flex:1; min-width:0; }
.bell-t small { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
                overflow:hidden; color:var(--ink-500); font-size:12.5px;
                margin-top:1px; }
.bell-w { flex:none; color:var(--ink-900); font-weight:600;
          font-variant-numeric:tabular-nums; }
.bell-row.is-new .bell-t { font-weight:600; }
.bell-row.is-new .bell-t small { font-weight:400; }
.bell-dot { flex:none; width:8px; height:8px; margin-top:6px; border-radius:50%;
            background:var(--accent); }
.bell-empty { padding:18px 10px; margin:0; color:var(--ink-500); font-size:14px; }

/* Search's sheet. */
html.find-lock { overflow:hidden; }
.find-overlay { position:fixed; inset:0; z-index:400; display:flex;
                justify-content:center; align-items:flex-start;
                padding:10vh 16px 16px; }
.find-overlay[hidden] { display:none; }
.find-backdrop { position:absolute; inset:0; background:rgba(12,10,24,.5); }
.find-panel { position:relative; width:min(640px, 100%); max-height:76vh;
              display:flex; flex-direction:column; background:var(--card);
              border-radius:18px; box-shadow:0 24px 70px rgba(12,10,24,.28);
              overflow:hidden; animation:find-in .14s ease-out; }
@keyframes find-in { from { opacity:0; transform:translateY(-6px); }
                     to { opacity:1; transform:none; } }
.find-bar { display:flex; align-items:center; gap:12px;
            padding:14px 16px 14px 20px; background:var(--paper-50);
            color:var(--ink-900); }
.find-bar input { flex:1; min-width:0; width:auto; border:0; background:transparent;
                  padding:6px 0; font-family:var(--font-display); font-size:18px;
                  color:var(--ink-900); border-radius:0; }
.find-bar input:focus { outline:none; box-shadow:none; }
.find-bar input::-webkit-search-cancel-button { display:none; }
.find-close { margin:0; border:0; background:var(--paper-100); color:var(--ink-600);
              border-radius:8px; padding:6px 10px; font-family:var(--font-sans);
              font-size:12px; font-weight:600; line-height:1.3; cursor:pointer; }
.find-close:hover { background:var(--ink-900); color:var(--card); }
.find-results { overflow-y:auto; padding:6px 10px 12px; min-height:80px; }
.find-group + .find-group { margin-top:6px; }
.find-head { padding:12px 12px 6px; font-size:12px; font-weight:600;
             color:var(--brand-700); }
.find-row { display:flex; align-items:center; gap:12px; padding:9px 12px;
            border-radius:12px; color:var(--ink-900); text-decoration:none; }
.find-row.is-active { background:var(--tint); }
.find-mark { flex:none; width:34px; height:34px; border-radius:50%;
             display:inline-flex; align-items:center; justify-content:center;
             background:var(--paper-100); color:var(--ink-900); font-size:15px;
             overflow:hidden; }
.find-mark img { width:100%; height:100%; object-fit:cover; display:block; }
.find-mark-av { background:var(--ink-900); color:var(--card);
                font-family:var(--font-display); font-weight:700; font-size:12px; }
.find-text { flex:1; min-width:0; display:flex; flex-direction:column; }
.find-title { font-weight:600; overflow:hidden; text-overflow:ellipsis;
              white-space:nowrap; }
.find-sub { font-size:12px; color:var(--ink-500); overflow:hidden;
            text-overflow:ellipsis; white-space:nowrap; }
.find-go { flex:none; color:var(--accent); opacity:0; }
.find-row.is-active .find-go { opacity:1; }
.find-empty { margin:0; padding:18px 12px; color:var(--ink-600); font-size:14px; }
.find-foot { display:flex; gap:16px; padding:10px 20px;
             border-top:1px solid var(--paper-100); font-size:12px;
             color:var(--ink-500); }
.find-foot kbd { font:inherit; font-size:11px; padding:2px 6px; margin-right:3px;
                 border-radius:5px; background:var(--paper-100);
                 color:var(--ink-600); }

/* The phone's tab bar: hidden until the screen is phone-sized. */
.tabbar { display:none; }

/* A laptop: Search folds to its icon so the bar stays one line. */
@media (max-width:1180px) {
  .find-btn { min-width:0; padding:8px; }
  .find-btn-word, .find-kbd { display:none; }
  .topbar nav { gap:4px; margin-left:8px; }
}
@media (max-width:860px) {
  .topbar { gap:8px; padding:8px 14px; }
  .topbar nav a { padding:6px 9px; }
}

/* A phone: the bar keeps the mark, Search, the bell and you; the sections
   sit at the bottom, each a 52px target clear of the home bar. */
@media (max-width:680px) {
  :root { --tabbar-pb:max(14px, calc(env(safe-area-inset-bottom, 0px) + 6px));
          --tabbar-h:calc(58px + var(--tabbar-pb)); }
  .topbar nav { display:none; }
  .subbar { padding:7px 12px; }
  .tabbar { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:90;
            height:var(--tabbar-h);
            padding:6px max(6px, env(safe-area-inset-left, 0px)) var(--tabbar-pb)
                    max(6px, env(safe-area-inset-right, 0px));
            background:var(--card); box-shadow:0 -4px 18px rgba(12,10,24,.08); }
  .tabbar a { position:relative; flex:1; min-width:0; min-height:52px; display:flex;
              flex-direction:column; align-items:center; justify-content:center;
              gap:3px; border-radius:14px; color:var(--ink-500); font-size:11px;
              font-weight:600; text-decoration:none;
              -webkit-tap-highlight-color:transparent; }
  .tabbar a span { white-space:nowrap; }
  .tabbar a.on { color:var(--ink-900); }
  .tabbar a.on .ic { color:var(--accent); }
  .tabbar .nav-unread { position:absolute; top:2px; left:50%; margin-left:6px; }
  body:has(.tabbar) { padding-bottom:calc(var(--tabbar-h) + 12px); }
  .me-pop { width:min(260px, calc(100vw - 32px)); }
  .bell-pop { top:62px !important; left:8px; right:8px !important; width:auto;
              max-width:none;
              max-height:calc(100vh - 74px - var(--tabbar-h)) !important; }
  .find-overlay { padding:0; }
  .find-panel { width:100%; max-height:none; height:100%; border-radius:0; }
  .find-bar { padding:12px 12px 12px 16px; }
  .find-foot { display:none; }
}
@media (prefers-reduced-motion: reduce) { .find-panel { animation:none; } }
