.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
  min-height: 42px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.toolbar-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-sans);
  padding: 4px 11px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.toolbar-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(167, 139, 95, 0.1);
}

.toolbar-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.toolbar-btn-clear {
  border-color: transparent;
  color: var(--text-muted);
  font-size: 11px;
}

.toolbar-btn-clear:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border);
}

.toolbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #1a1208;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 5px;
  min-width: 16px;
  height: 16px;
  margin-left: 6px;
}

.toolbar-dirty {
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
}

.toolbar-filename {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-serif);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 180px;
}

.toolbar-fontsize {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.toolbar-fontsize-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 2px 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.toolbar-fontsize-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.toolbar-fontsize-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.toolbar-wordcount {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-sans);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: default;
}

.toolbar-wordcount-sep {
  margin: 0 3px;
  opacity: 0.5;
}

/* ── Outline toggle button ───────────────────────────────────────── */
.toolbar-btn-outline {
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Analyze dropdown button ─────────────────────────────────────── */
.toolbar-analyze-btn {
  min-width: 90px;
}

.toolbar-analyze-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #1a1208;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 5px;
  min-width: 16px;
  height: 16px;
  margin-left: 6px;
}

/* Dropdown menu scoped overrides */
.toolbar-analyze-menu .context-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.toolbar-analyze-menu .context-menu-item.active {
  color: var(--accent);
}

.toolbar-analyze-count {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Story Bible toolbar ─────────────────────────────────────────── */
.toolbar-bible-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-right: 2px;
  align-self: center;
}

.toolbar-btn-bible {
  color: var(--accent);
}

.toolbar-btn-bible:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
