/* ═══════════════════════════════════════════════════════════════════════════
   LogHog — shared topbar  (linked in every module)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --topbar-content-h: 56px;
  --topbar-safe-top: env(safe-area-inset-top, 0px);
  --topbar-total-h: calc(var(--topbar-content-h) + var(--topbar-safe-top));
  --topbar-slot-w: 100px;
}

/* ── Layout: push content below fixed topbar ── */
body {
  padding-top: var(--topbar-total-h) !important;
  /* border-box: padding-top is counted inside the 100dvh budget,
     so body never exceeds one screen height → no phantom scroll space */
  box-sizing: border-box !important;
  min-height: 100dvh !important;
}

/* Let .app be its natural content height — body background fills the rest.
   Overrides the min-height:100vh each module sets on .app, which was
   forcing it to fill the whole screen and creating blank space on short pages. */
.app {
  min-height: 0 !important;
}

/* ── Topbar shell ── */
.topbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: grid !important;
  grid-template-columns: var(--topbar-slot-w) 1fr var(--topbar-slot-w) !important;
  align-items: stretch !important;
  padding-top: var(--topbar-safe-top);
  box-sizing: border-box;
  height: var(--topbar-total-h);
}

/* ── Three slots ── */
.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  height: var(--topbar-content-h);
}

.topbar-left   { justify-content: flex-start; padding-left: 10px; }
.topbar-center { justify-content: center; }
.topbar-right  { justify-content: flex-end; padding-right: 10px; }

/* ── Title ── */
.topbar h1 {
  font-family: "DM Serif Display", serif;
  font-size: 21px !important;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Topbar action buttons (.tb-btn) ── */
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .tb-btn:hover {
    color: var(--text);
    background: var(--surface2);
  }
}

/* Add button — gold accent */
.tb-btn-add {
  color: var(--accent);
}

/* ── Index logo in right slot ── */
.topbar-logo-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}

.topbar-logo-slot img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
  object-position: center;
}

/* ── Admin "Inc. self?" checkbox label ── */
.tb-inc-self {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.tb-inc-self input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Watchlist floating bell (anchored just below fixed header) ── */
.float-bell {
  position: fixed;
  top: var(--topbar-total-h);
  right: 10px;
  z-index: 190;
}
