/* The page header, shared by both tools: the top bar, the brand (a link home, with the
   accent dot and the as-of stamp) and the plain text/icon header controls (theme, Info).
   Each tool's markup is identical apart from the brand name; consumes only shared tokens. */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
/* The brand is a link home in the header and a plain span in the drawer, so the reset
   (no underline, inherited ink) rides on the class. */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: inherit;
}
.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
  box-shadow: 0 0 8px var(--accent);
}
.brand small {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 10px;
}
/* The as-of stamp reads as data, not a wordmark: normal case, tabular figures, no
   tracking, so the date sits legibly next to the name. */
.brand .asof {
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The wrapper is transparent so its children lay out directly in the top bar; the
   spacer inside it pushes the controls to the right edge. */
.topbar-controls {
  display: contents;
}
.topbar .spacer {
  flex: 1 1 auto;
}
/* The theme toggle and Info are plain text/icon controls, not buttons. */
.theme-toggle,
.notes-toggle {
  background: none;
  border: 0;
  padding: 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.theme-toggle:hover,
.notes-toggle:hover {
  color: var(--ink);
}
.theme-toggle:focus-visible,
.notes-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.notes-toggle svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* Narrow viewports: the header stays a single tight row of brand and icon controls.
   Same breakpoint as each tool's courtesy layout. */
@media (max-width: 760px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 9px 12px;
  }
  .brand {
    white-space: nowrap; /* the brand name stays one line */
  }
  .brand small {
    display: none;
  } /* drop the small mark / as-of stamp to make room */
  /* The theme toggle is icon-only, matching the Info control (its aria-label still
     names it for assistive tech). */
  .topbar #themeLabel {
    display: none;
  }
  /* Comfortable tap targets for the touch-first layout. */
  .theme-toggle,
  .notes-toggle {
    padding: 9px 6px;
    min-height: 40px;
  }
}
