/* shared-ui -- the persistent app topbar. One markup shape across every
 * app: brand on the left, nav links, then a persistent feedback icon +
 * version tag pinned right (see feedback-icon.css). Markup helper in
 * topbar.js builds the DOM so a consuming app only supplies its nav items.
 *
 *   <div class="td-topbar">
 *     <div class="td-brand">TOPDECK</div>
 *     <nav class="td-nav"> <a ...>…</a> </nav>
 *     <a class="td-feedback-btn" …> … </a>
 *     <span class="td-version"></span>
 *   </div>
 */

.td-topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  background: var(--td-bg-elev);
  border-bottom: 1px solid var(--td-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.td-brand {
  font-family: var(--td-font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 15px;
  white-space: nowrap;
}
.td-brand span { color: var(--td-accent); }

.td-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
/* T-316: the menu stays on one line while it fits (topbar.js measures it);
   otherwise it takes its own row below and wraps there. Never one link per
   line beside the controls. Without topbar.js's measuring (an app that writes
   the markup itself, no data-td-fit) the old wrapping above still applies. */
.td-topbar[data-td-fit]:not(.td-nav-own-row) .td-nav { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.td-topbar.td-nav-own-row { flex-wrap: wrap; row-gap: 6px; }
.td-topbar.td-nav-own-row .td-nav { order: 3; flex: 1 1 100%; flex-wrap: wrap; }
.td-topbar .td-feedback-btn { flex: none; }
/* The log-out is a .td-feedback-btn too: only the first one pushes right, so
   the icons stay together when the menu isn't there to fill the line. */
.td-topbar .td-feedback-btn ~ .td-feedback-btn { margin-left: 0; }
.td-nav a {
  color: var(--td-text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
}
.td-nav a:hover { background: var(--td-bg-elev-2); color: var(--td-text); }
.td-nav a.active { background: var(--td-bg-elev-2); color: var(--td-accent); }

.td-version {
  color: var(--td-text-faint);
  font-family: var(--td-font-mono);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .td-topbar { gap: 12px; padding: 10px 12px; }
  .td-nav { gap: 2px; }
  .td-nav a { padding: 6px 10px; font-size: 13px; }
}
