/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.25s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: var(--space-s); padding-block: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 6px 4px 0; font-weight: 600; font-size: var(--step-0); letter-spacing: -0.02em; }
.logo svg { width: 26px; height: 26px; flex: none; }
.tabs { display: flex; gap: 2px; background: var(--hover); padding: 3px; border-radius: 999px; position: relative; }
.tab { position: relative; z-index: 1; border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: var(--step--1); font-weight: 500; color: var(--ink-2); transition: color 0.2s; }
.tab[aria-current="page"] { color: var(--ink); }
.tab-pill { position: absolute; z-index: 0; top: 3px; bottom: 3px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); }
.spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); width: clamp(180px, 22vw, 300px); transition: box-shadow 0.2s, width 0.35s var(--ease); }
.search:focus-within { box-shadow: 0 0 0 2px var(--focus); width: clamp(220px, 28vw, 380px); }
.search svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: var(--step--1); }
.search input::placeholder { color: var(--ink-3); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 16px; border-radius: 999px; border: 0;
  font-size: var(--step--1); font-weight: 500; white-space: nowrap; text-decoration: none;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s;
}
.btn:hover { background: var(--raised); box-shadow: var(--shadow-1), 0 2px 8px -2px rgba(0,0,0,0.12); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn.ghost { background: none; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { color: var(--neg); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.review-pill .count { background: var(--ink); color: var(--on-ink); border-radius: 999px; padding: 0 7px; font-size: var(--step--2); font-weight: 600; line-height: 18px; min-width: 18px; text-align: center; }
/* Top bar sheds elements as it narrows: wordmark first, then button labels, so the tabs keep their room */
@media (max-width: 1120px) { .logo span { display: none; } .logo { padding-right: 0; } }
@media (max-width: 940px) { #addBtn .lbl, .review-pill .lbl { display: none; } #addBtn { padding: 0 11px; } .review-pill { padding: 0 10px; } .search { width: clamp(150px, 20vw, 240px); } }
@media (max-width: 760px) {
  .search { order: 5; width: 100%; }
  .search:focus-within { width: 100%; }
  .tabs { order: 4; }
  .logo span { display: none; }
}

