/* The top bar, shared by the app and the Django admin. Self-contained: its own colour
   variables (the admin defines --accent and others differently) and px/em sizes (the
   admin's root font size differs from the app's). Logical properties for RTL. */
.topbar {
  --tb-bg: #ffffff;
  --tb-text: #1c2430;
  --tb-muted: #5d6b7e;
  --tb-line: #dde2e9;
  --tb-accent: #1f5fbf;
  --tb-teal: #0a8f95;
  --tb-mark-filter: none;
  display: flex; align-items: center; gap: 1.5em; flex-wrap: wrap;
  padding: .6em 1.25em;
  background: var(--tb-bg); color: var(--tb-text);
  border-block-end: 1px solid var(--tb-line);
  font-family: "Segoe UI", "Arial Hebrew", Arial, "Noto Sans Hebrew", system-ui, sans-serif;
  font-size: 15px; line-height: 1.5;
  box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .topbar { --tb-bg: #1b2129; --tb-text: #e6eaf0; --tb-muted: #9aa6b6; --tb-line: #2d3540; --tb-accent: #5b9bf0; --tb-teal: #14b4ba; --tb-mark-filter: brightness(1.7) saturate(1.1); }
}
/* The theme switch (static/js/theme.js, html[data-theme]) wins over the system setting. */
html[data-theme="light"] .topbar { --tb-bg: #ffffff; --tb-text: #1c2430; --tb-muted: #5d6b7e; --tb-line: #dde2e9; --tb-accent: #1f5fbf; --tb-teal: #0a8f95; --tb-mark-filter: none; }
html[data-theme="dark"] .topbar { --tb-bg: #1b2129; --tb-text: #e6eaf0; --tb-muted: #9aa6b6; --tb-line: #2d3540; --tb-accent: #5b9bf0; --tb-teal: #14b4ba; --tb-mark-filter: brightness(1.7) saturate(1.1); }

.topbar a, .topbar a:link, .topbar a:visited, .topbar a:hover { text-decoration: none; }
.topbar .brand { display: inline-flex; align-items: center; gap: .45em; font-size: 1.15em; color: var(--tb-text); }
.topbar .brand img { display: block; filter: var(--tb-mark-filter); }
.topbar .wordmark { font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.topbar .wordmark b { font-weight: 800; }
.topbar .wordmark span { color: var(--tb-teal); }
.topbar .mainnav { display: flex; gap: 1em; flex-wrap: wrap; }
.topbar .mainnav a { color: var(--tb-muted); padding: .25em 0; }
.topbar .mainnav a:hover { color: var(--tb-text); }
.topbar .mainnav a[aria-current="page"] { color: var(--tb-text); border-block-end: 2px solid var(--tb-accent); }
.topbar .topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: .9em; }
.topbar .topbar-end form { margin: 0; }
.topbar .who { color: var(--tb-muted); }
.topbar button.link { font: inherit; background: none; border: 0; padding: 0; margin: 0; color: var(--tb-accent); cursor: pointer; }
.topbar button.link:hover { text-decoration: underline; }

/* Theme switch: automatic / light / dark. Hidden until theme.js shows it (it needs JavaScript). */
.topbar .theme-switch { display: inline-flex; border: 1px solid var(--tb-line); border-radius: 999px; padding: 2px; gap: 2px; }
.topbar .theme-switch[hidden] { display: none; }
.topbar .theme-switch button {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; margin: 0;
  border: 0; border-radius: 999px; background: none; color: var(--tb-muted); cursor: pointer;
}
.topbar .theme-switch button:hover { color: var(--tb-text); }
.topbar .theme-switch button[aria-pressed="true"] { background: var(--tb-accent); color: var(--tb-bg); }
.topbar .theme-switch button:focus-visible { outline: 2px solid var(--tb-accent); outline-offset: 1px; }
.topbar .theme-switch svg { display: block; width: 16px; height: 16px; }
